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.
46
56
47
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.
48
58
@@ -71,6 +81,19 @@ the status, progress, and related information of main and sub-tasks.
71
81
## Getting Started
72
82
73
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
74
97
Make sure you have Java and Maven installed in your development environment.
75
98
76
99
### Installation
@@ -90,6 +113,153 @@ mvn clean install
90
113
```
91
114
92
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