aspose file tools*
The moose likes Beginning Java and the fly likes Facatory Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Facatory Methods" Watch "Facatory Methods" New topic
Author

Facatory Methods

chaitanya krishna
Greenhorn

Joined: Dec 27, 2004
Posts: 16
Hi,
pls tell about what is mean by factory methods...
what is purpose...
give me some example regarding Factory methods

regards
krishna
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi,

Factory method is one of the Gang of Four's creational patterns. The purpose of the pattern is to define an interface for creating objects - but let the subclasses decide wich class to instantiate.

Take a look at http://www.fluffycat.com/java/JavaNotes-GoFFactoryMethod.html
for some source code.

If you need more, then try to ask google - you'll get plenty of hits.

/Svend Rost
Charles McGuire
Ranch Hand

Joined: Jan 18, 2005
Posts: 99
A JavaBean stores information.

A FactoryBean works with a JavaBean and contains the CRUD (create, read, update, and delete) methods and JDBC code.

The good part about FactoryBeans is that they keep your JavaBeans from being cluttered up with CRUD methods and JDBC code.

The bad part about FactoryBeans is that you have twice as many classes.

If you are not using separate FactoryBeans now, you probably have all the JDBC, and CRUD methods in your one JavaBean right now.


There's no place like 127.0.0.1
 
 
subject: Facatory Methods