Results 1 to 3 of 3

Thread: Design patterns

  1. #1
    Freddie is offline Member
    Join Date
    May 2007
    Posts
    41
    Rep Power
    0

    Default 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

  2. #2
    fritz is offline Member
    Join Date
    May 2007
    Posts
    4
    Rep Power
    0

    Default

    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.

  3. #3
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    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

Similar Threads

  1. Design Calendar UI
    By praveen.kb in forum AWT / Swing
    Replies: 0
    Last Post: 01-21-2008, 12:54 PM
  2. Replies: 2
    Last Post: 07-04-2007, 07:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •