Factory Pattern
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Simon_Patterson
Posted On:   Friday, October 18, 2002 02:42 AM

Morning All, Just a quick query for you...! I am developing a document management system, the system has to handle different types of file in different ways. For Example, a AutoCAD dwg file must be converted to a pdf when it is transferred etc.. So what I have got is a FileHandlerFactory which is used to create the appropriate FileHandler depending upon the type of object passed (A file is encapsulated in an object with its meta-data, such as a DWGObject, DOCObject etc..). Each FileHandler implements a GenericFileHandler interface. My question is this. My FileHandlerFactory i   More>>

Morning All,



Just a quick query for you...!



I am developing a document management system, the system has to handle different types of file in different ways.



For Example, a AutoCAD dwg file must be converted to a pdf when it is transferred etc..



So what I have got is a FileHandlerFactory which is used to create the appropriate FileHandler depending upon the type of object passed (A file is encapsulated in an object with its meta-data, such as a DWGObject, DOCObject etc..).



Each FileHandler implements a GenericFileHandler interface.



My question is this.



My FileHandlerFactory is a standard class , when would it be required to use and abstract Factory?



I cannot think of an instance that would require a Factory which created Factories? Could someone please provide me with an example, or just explain where I am losing the plot... thanks in advance

Simon Patterson.

   <<Less

Re: Factory Pattern

Posted By:   Lasse_Koskela  
Posted On:   Friday, October 18, 2002 04:31 AM

A factory creating factories is actually a good example of abstraction layers.


You can compose the whole thing from smaller things, which in turn compose of even smaller things. In other words, the inner factory provides abstraction for the outer factory.


Did this help at all?

About | Sitemap | Contact