Somebody asked me this question in interview. How will I implement spring features without using Spring framework. Means suppose if I need to create a simple application for login/logout which will have all the features of spring framework without using Spring framework. What are the design patterns I will have to use and where I will use what? Any help on this , any tutorial which can answer this question?
in order to use your own Dependency injection, you will have to build the bean manager and provide all the benefits it has which will be huge task if you have to provide all the features of spring DI
but ofcourse you can make a simple one though
AOP - spring is the best! there are other AOP tools like AspjectJ but those tools will modify your class files either during compile time or load time of the class
springs speciality in AOP is that it creates a new class called proxy which will intercept the actual calls and advices the bean.
again, this feature could be created either by building a tool on top of cglib and dynamic proxies or the next option would be to use AspectJ
Spring JMX - spring just abstracts the boiler plate code of finding the mbeanserver and registering the mbean with it.
you can easily build a smiple module to hide the JMX related code and provide a simple API to register MBeans
spring JDBC - very much like spring JMX where it just hides or abstracts the boilerplate code of opening connection, closing connection etc which you can do it easily
overall, the last 2 features are just a layer of indirection to the actual technologies! but the first two features are the real features(tools) provided by spring which could be replaced with another tool.