You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summer is a minimized AOP and IoC kernel toolset. It provides a lightweight and efficient solution for building Java applications, supporting XML-based bean definition and dependency injection, as well as AOP functionality. The project consists of two main modules: `summer-beans` and `summer-validator`.
52
+
53
+
### Modules
54
+
-**summer-beans**: Core module for bean management, including bean definition, creation, and dependency injection. It also supports AOP features such as proxy creation and advice execution.
55
+
-**summer-validator**: A validation module that provides various validation rules for collections and objects.
56
+
57
+
Summer is a minimized AOP (Aspect-Oriented Programming) and IoC (Inversion of Control) kernel tool library. It provides a set of validators and related utility classes to simplify the validation logic of objects and collections. Additionally, it includes some functions for batch task processing.
58
+
59
+
### Validation Module
60
+
61
+
+**Rich Validation Rules**: The validation module offers a wide range of validation rules, including length checks, regular expression matching, and
62
+
collection size validations. For example, you can easily validate strings for minimum and maximum lengths, and collections for size ranges.
63
+
64
+
+**Annotation-Based Validation**: Supports annotation-based validation. You can use custom annotations to mark fields in classes and perform
65
+
validation operations on objects. For instance, use the @NotNull and @Pattern annotations to validate user-defined objects.
66
+
67
+
+**Collection Validation**: Provides specific validation capabilities for collections. You can set validation rules for the entire collection as
68
+
well
69
+
as for each element in the collection.
70
+
71
+
72
+
### Batch Task Processing Module
73
+
74
+
+**Main and Sub-Task Management**: Includes entities such as MainTask and SubTask, and corresponding data access objects (MainTaskDao). It can
75
+
manage
76
+
the status, progress, and related information of main and sub-tasks.
77
+
78
+
+**Task Monitoring and Recovery**: The TaskWatchdog class periodically checks for stuck tasks and attempts to recover them, ensuring the reliability
79
+
of task processing.
46
80
47
81
## Getting Started
48
82
49
83
### Prerequisites
84
+
- Java 8 or higher
85
+
- Maven
86
+
87
+
### Installation
88
+
1. Clone the repository:
89
+
90
+
```shell
91
+
git clone https://github.com/dianpoint/summer.git
92
+
cd summer
93
+
```
94
+
95
+
2. Build the project using Maven:
96
+
```shell
97
+
Make sure you have Java and Maven installed in your development environment.
50
98
51
99
### Installation
52
100
101
+
Clone the repository to your local machine:
102
+
103
+
```bash
104
+
git clone https://github.com/dianpoint/summer.git
105
+
106
+
```
107
+
108
+
Navigate to the project directory and build the project:
109
+
110
+
```bash
111
+
cd summer
112
+
mvn clean install
113
+
```
114
+
115
+
116
+
### Usage
117
+
118
+
#### Bean Definition and Injection
119
+
You can define beans in an XML file and use the XmlBeanDefinitionReader to load and register them. Here is an example:
120
+
```java
121
+
// Create a bean factory
122
+
AbstractBeanFactory beanFactory = new DefaultListableBeanFactory();
123
+
// Create a resource for the XML file
124
+
Resource resource = new ClassPathResource("beans.xml");
125
+
// Create a reader to load bean definitions from the resource
126
+
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
127
+
reader.loadBeanDefinitions(resource);
128
+
// Get a bean from the factory
129
+
Object bean = beanFactory.getBean("beanName");
130
+
```
131
+
132
+
#### AOP Usage
133
+
Summer supports AOP through proxy creation and advice execution. You can use the ProxyFactoryBean to create a proxy for a target object and apply advice before or after method execution.
134
+
135
+
```java
136
+
// Create a proxy factory bean
137
+
ProxyFactoryBean proxyFactoryBean = new ProxyFactoryBean();
The summer-validator module provides validation rules for collections and objects. You can use the ValidationRules and Validators classes to perform validation.
- [x] Implement basic bean definition and injection
238
+
- [x] Add AOP support
239
+
- [ ] Improve validation module with more rules
240
+
- [ ] Add support for annotation-based configuration
241
+
+ [ ] Implement @Autowired and @Component annotations
242
+
+ [ ] Provide annotation scanning functionality
243
+
244
+
See the issues for a full list of proposed features and known issues.
245
+
246
+
247
+
### Contributing
248
+
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
249
+
250
+
1. Fork the Project
251
+
2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
252
+
3. Commit your Changes (git commit -m 'Add some AmazingFeature')
253
+
4. Push to the Branch (git push origin feature/AmazingFeature)
254
+
5. Open a Pull Request
255
+
256
+
257
+
### License
258
+
Summer is distributed under the Apache License 2.0 License. See License.txt for more information.
0 commit comments