Posts Tagged 'Dependency Injection'

Lessons Learned From Spring’s @Autowired

Last November we got Spring 2.5 and with it the possibility to use annotations for dependency injection (DI). Annotations can be used instead or mixed with the classic application context file(s) based on XML.

If you compare the former more complex XML configurations with what you still have to keep, after using annotations, it’s quite amazing how straightforward the XML becomes. For projects with complex DI configurations it is possible to transfer the configuration in steps.

For our ICEfaces Web application ...

More
0

How to Decontaminate a Singleton

For about three years now there’s a debate about using the Singleton pattern. Some call it evil, anti-pattern, and the like. If you have a look at the Gang of Four (GoF) patterns you’ve to realize that they are still present in the community, even more than 10 years after first publishing of the book. Patterns are commodity and the grandmasters can’t be wrong with their invention, you may think.

It’s not easy to kill a pattern like the ...

More
1

The Observer Pattern in Mixed Dependency Injection Contexts (Spring, JSF)

One of the most well-known patterns is the Observer pattern, well described in the Gang of Four (GoF) book. It allows to separate the application logic from the view(s) (if you have the focus on MVC implementations) or simply implements a notification mechanism that allows to update objects if others change their state (publisher – subscriber implementations).

Basically, the Observer pattern describes object dependencies. So, it’s a good idea to use an environment that allows to implement it with ...

More
0