File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Facatory Methods

chaitanya krishna

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

Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904

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
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
I agree. Here's the link:
subject: Facatory Methods
It's not a secret anymore!