This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
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.
No, there's not going to be a single article or tutorial on this. You're actually going to have to learn about design patterns, and use Spring and get familiar with what it does.
Which makes this a good interview question - it actually requires knowledge and experience - not just memorizing stock answers or APIs.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted
0
You can go to Spring website, download source code and read it.