• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Facatory Methods

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
pls tell about what is mean by factory methods...
what is purpose...
give me some example regarding Factory methods

regards
krishna
 
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic