开发者

why use spring? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 12 years ago.

I am very much confused whether i should use spring

Reason - I want to develop a loosely coupled code which i think can b开发者_如何学JAVAe developed using Factory pattern and interfaces... and dependency injection can be implemented without using spring too...(by passing parameters).. why should i use spring then ?? Which are the other benefits of spring which i am unaware of..It would be really helpful if you could give me code samples comparing spring codes and simple java code(interfaces)...indicating how spring code is better...

Thanks


You must go through Martin fowler's article http://martinfowler.com/articles/injection.html


Spring offers many services other than its IOC container. Declarative transactions, JMS, Timing/Scheduling, AOP, a MVC framework, etc.

Whether or not it's the right technology for your project depends on what exactly your project requirements are, and the environment in which it will be run.


Spring, among a lot of other things, is a library/framework for enabling dependency injection. You are welcome to code your own dependency injection library/framework and use that, thereby not requiring Spring.

If you create a powerful, annotation based, dependency injection library/framework, chances are, you'll come to something very similar to what spring already is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜