Well, let’s think of a situation. You have a third-party library that reads a large piece of text(e.g. 662 more words
Tags » Design Pattern
In my previous post I have discussed about dependency injection..In this post I will discuss how to use dependency injection using google Guice.
Guice is a java framework that dose dependency injection not like spring it is not a container ,it fulfill one task i.e dependency injection request.The dependency injector is itself is a service and like any other service, it must be constructed and prepared before it can be used. 445 more words
There are so many different design patterns in programming, e.g., builder pattern, guided builder pattern, factory/supplier pattern, factory-method pattern, visitor pattern, etc. Design patterns are merely guidelines for effective coding, but they have their merits in solving commonly re-occuring problems. 1,081 more words
Basically, instead of having your objects creating a dependency or asking a factory object to make one for them, you pass the needed dependencies in to the constructor or via property setters, and you make it somebody else’s problem (an object further up the dependency graph, or a dependency injector that builds the dependency graph). 177 more words