August 2009
Intermediate to advanced
352 pages
9h 21m
English
"I agree with everything you say, but I would attack to the death your right to say it."
Whether or not lifecycle is a part of dependency injection is a divisive issue. However, like scoping, it can be a powerful tool when used correctly, and it fits closely with dependency injection. In this chapter we'll look at the basic form of lifecycle offered by the language runtime—constructors. We'll also look at managed lifecycle as offered by more elaborate frameworks like servlets and EJBs, to illustrate how lifecycle is domain specific. On the way we'll examine the pitfalls of relying on one-size-fits-all lifecycle models.
Finally, we'll look at how to design and implement a custom lifecycle ...
Read now
Unlock full access