aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Factory Classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Factory Classes" Watch "Factory Classes" New topic
Author

Factory Classes

Sonali Sehgal
Ranch Hand

Joined: Jul 09, 2009
Posts: 75
Can someone give me tutorials in Java Factory classes in Java 1.6
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

What do you mean by these Factory classes ? Classes that follow the factory method pattern ? Is this related to SCJP ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Sonali Sehgal
Ranch Hand

Joined: Jul 09, 2009
Posts: 75
I am looking for a tutorial that can help me find out everything about factory classes .As far as meaning is concerned it is Classes that follow the factory method pattern
Whether this topic can be coverered in SCJP or not I am not much sure about it?
As far as I am concerned I am preparing for SCJP 1.6
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

The SCJP does not necessarily ask you about factory method pattern. There are no resources that outline these classes for the SCJP as well, as far as I know.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
There's nothing like this in the SCJP exam so...

moving this to the OO / patterns forum...


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
P Das
Ranch Hand

Joined: Jun 30, 2008
Posts: 123
Probably, I can try from my experience with others.

Basically, you are trying to create (instantiate) an object (of product) without directly calling the (product) class constructor by the client. Hence you create some client-helper-type (which is why you may need an interface, the Factory) that would call another interface that represent the Product super-type.

The basic objective of factories, which might be abstract factory, factory method, ... is to decouple the client from constructing a product. This is achieved by the above approach. In many practical apps, you have two super-types as interfaces: the Factory and the Product. Then you add concrete types to both of them, with the Factory meant to create the Product. Finally, your code becomes less brittle and more maintainable.

Hope, I was able to respond to your philosophical query.


Pranab Das, PMP, SCEA
P Das
Ranch Hand

Joined: Jun 30, 2008
Posts: 123
Sorry, I forgot to add my humble suggestion for you to take time to read the Design Patterns by the GoF, which can provide you all information that you might need.

Some people find the HFDP useful; however, personally, I find it difficult reading because it is too full of lengthy examples and funny pictures. Apart from some patterns missing, content-wise, HFDP covers the GoF patterns.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Factory Classes