The object that needs to be implemented does not need to instantiate the dependent objects and can rely on the assembler to do the job
The assembler will gather and instantiate, if necessary, all the dependent objects and make them available to the implemented object.
The assembler gathers the required classes through configuration files so a change in the assembler only needs changes to the configuration file.
An example of an assembler is the Spring Framework.
Problem: Know the steps of an algorithim and the order of the steps, but dont know how to perform all the steps.
Solution: Encapsulate the individual steps we dont know how to perform as abstract methods, and provide an abstarct superclass that invokes them in the correct order. Concrete subclasses of this abstract superclass implement the abstarct methods to perform the individual steps.
No comments yet.