Factory and Abstract Factory Pattern [closed]?

Abstract factory doesn't use composition.. it uses inheritance only. Instance in Abstract factory returns a factory and from the desired class can be instantiated. Abstract factory is just a layer above Factory design pattern.. To know more about composition Check java.Io package in Java.

If a FileReader class needs to be instantiated a File Object is mandatory. Like new FileReader(new File("")). This is known as composition and it is no where used in Abstract factory.

Factory Pattern defines an interface for creating objects and lets subclasses decide which objects to be created (inheritence). This way client only needs to know the abstract type they are using. Abstract Factory provides abstract type for creating family of products.

Subclasses of this type define how these products are produced. The product subclasses create parallel sets of product families.(composition).

– pchajer Jan 6 '11 at 10:46 You better refer to Head First Design Patterns Book. They got lots of examples, explaining this – Nipuna Silva Jan 6 '11 at 15:15.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions