Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2007, 10:02 PM
Member
 
Join Date: May 2007
Posts: 42
Freddie is on a distinguished road
Design patterns
I have readen the book "Thinking in Pattern "(Bruce Eckel) and I dont understand the factory pattern
can you explain me?
because I searched in internet but I still dont understand

I need an example
please help me
Freddy
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-11-2007, 11:01 PM
Member
 
Join Date: May 2007
Posts: 5
fritz is on a distinguished road
The factory pattern lets you create different kinds of objects. I may have a dinnerFactory that returns dinner objects. Depending on what i pass it, it may return a pizzaDinner, a steakDinner, or a hamburgerDinner object - all of which are sub-classes of the Dinner class.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-12-2007, 08:21 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
Let me add some thing more , There is one more pattern called abstractfactory which is an extention of this. Say in the above example we have fixed the factory as dinner factory but consider a situation in which it can be either dinner facotory or a supper factory In that case we use the abstract factory
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adapter design pattern JavaForums Java Blogs 0 03-08-2008 11:00 PM
Design Patterns - Basics (II) JavaForums Java Blogs 0 02-10-2008 12:26 AM
Design Patterns - Basics (I) JavaForums Java Blogs 0 02-10-2008 12:26 AM
Design Calendar UI praveen.kb AWT / Swing 0 01-21-2008 01:54 PM
Patterns to application with swing and hibernate Peter Database 2 07-04-2007 08:58 AM


All times are GMT +3. The time now is 10:57 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org