Skip to content

A Simple Spring implementation for learning

License

Notifications You must be signed in to change notification settings

dzzhyk/mine-spring

Repository files navigation

English | 简体中文

mine-spring

A Simple Spring-Framework implementation for learning.

Background

mine-spring is a practice product of learning Spring-Framework source code.
Through this project, you can understand the simple implementation ways of spring and learn about Spring more clearly!

Features

  1. Simple Spring IoC container implementation.
  2. AOP programming support.
  3. Simple yet functional springMVC function.
  4. Almost the same annotation usage as Spring-Framework.
  5. JavaConfig Class @Configuration support
  6. MultipartFile upload and download MultipartFile
  7. Jsp and simple HTML template support which support el-expression ${}
  8. @RequestBody and @ResponseBody support
  9. @Autowired
  10. coming soon...

Usage

create an empty web project, then add mine-spring maven dependency:

<dependency>
    <groupId>com.yankaizhang</groupId>
    <artifactId>mine-spring</artifactId>
    <version>0.0.5</version>
</dependency>

Quick Example

@Controller
public class TestController {

    @Autowired
    TestServiceImpl testService;

    @RequestMapping("/index")
    public String index(){
        testService.hi();
        return "index";
    }
}

For more examples, check module mine-spring-example and example project short-link-server

Related Efforts

Update

update logs

TODO

  • Spring IoC Container implementation
  • BeanPostProcessor and BeanFactoryPostProcessor
  • @Configuration and @Bean based Java Config support
  • Annotation Based AOP support @Aspect
  • @ResponseBody and JSON parser
  • @Autowired property injection
  • MultipartFile upload and download support
  • @Around Aspect
  • Simple Spring JDBC
  • transaction support
  • Simple ORM like Spring Data JPA

Known Bugs

  • The Controller's method cannot be accessed by the AOP aspect.
  • Repeated registration when registering HandlerMapping.
  • Circular Reference for singleton and prototype beans

Maintainer

@dzzhyk

Contribute

@dzzhyk @Amber-coder @adiaoer @daydreamofscience

If you like this repository, why not star 🌟 or fork ✈️ it ? I'm working hard 💪!

Contact

License

  • MIT © dzzhyk

Inheritance relationship

  • BeanDefinition

image-20210321135946207

  • BeanFactory

image-20210321140051848

  • ApplicationContext

image-20210321140144404

  • AopProxy

image-20210321140304290

image-20210321140322045