Lecture 4: 2nd March 2006
Creational Patterns - Abstract Factory
Creational Patterns consists of abstract factory, prototype, singleton, factory method and Buider patterns.
Creational patterns have been classified under creational because they create objects at runtime. An example of when you can see a creational pattern in action with the creation of an object at runtime is when you , take a juke box. Once money has been inserted in the machine and the desired song selected, only then will the machine play the music desired.
On this particular day, we started off with the Abstract Factory.
Abstract Factory, is a design pattern that is administered to objects which are closely related in a family or are very dependant of one another in the creation of objects without specifying concreate classes at runtime.An abstract interface is given to the client and hiding the controlling mechanism, or process that are in the concrete classes from the client. [1]
Since the objects of the AbstractFactory are closely related, one of the problems of implementing this is that, it becames difficult to add new products to the abstract factory and entiles changing the whole structure, subclasses and the abstract classes. its one of the disadvantages of this design pattern[2]
References
[1]Eric and Elizabeth Freeman with Karthy sierra and Bert Bates, 2004, Head First design patterns, pg 156, ISBN:0-596-00712-4
[2] Eric and Elizabeth Freeman with Karthy sierra and Bert Bates, 2004, Head First Design Patterns, Pg 159, ISBN:0-596-00712-4
Creational Patterns - Abstract Factory
Creational Patterns consists of abstract factory, prototype, singleton, factory method and Buider patterns.
Creational patterns have been classified under creational because they create objects at runtime. An example of when you can see a creational pattern in action with the creation of an object at runtime is when you , take a juke box. Once money has been inserted in the machine and the desired song selected, only then will the machine play the music desired.
On this particular day, we started off with the Abstract Factory.
Abstract Factory, is a design pattern that is administered to objects which are closely related in a family or are very dependant of one another in the creation of objects without specifying concreate classes at runtime.An abstract interface is given to the client and hiding the controlling mechanism, or process that are in the concrete classes from the client. [1]
Since the objects of the AbstractFactory are closely related, one of the problems of implementing this is that, it becames difficult to add new products to the abstract factory and entiles changing the whole structure, subclasses and the abstract classes. its one of the disadvantages of this design pattern[2]
References
[1]Eric and Elizabeth Freeman with Karthy sierra and Bert Bates, 2004, Head First design patterns, pg 156, ISBN:0-596-00712-4
[2] Eric and Elizabeth Freeman with Karthy sierra and Bert Bates, 2004, Head First Design Patterns, Pg 159, ISBN:0-596-00712-4
0 Comments:
Post a Comment
<< Home