.NET Framework

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sajithamol

    .NET Framework

    What is the difference between Factory and Abstract Factory Patterns?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by sajithamol
    What is the difference between Factory and Abstract Factory Patterns?
    Please do not post questions in the articles section.
    Moved to the forum.

    Have you tried google for those patterns?
    The patterns have been described over and over again

    Comment

    • radcaesar
      Recognized Expert Contributor
      • Sep 2006
      • 759

      #3
      Originally posted by sajithamol
      What is the difference between Factory and Abstract Factory Patterns?
      The Factory pattern is meant to give you the ability to generically construct objects (rather than explicitly declare what you want to create via the "new" keyword you defer to a factory and take what it gives you)
      The Abstract Factory pattern is meant to give you the ability to generically construct Factories.
      So, for instance, say you want to create widgets with a certain look and feel. You could use the Factory pattern and ask a ButtonFactory to make buttons and a TextArea factory to make TextAreas, but since you want the same look and feel for all widgets you could just ask the WidgetFactory to give you a WidgetFactory for a given Look and Feel and then ask it to make Buttons and TextAreas and whatever else, knowing that it has handled which kind of button and whatever else you need.

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Originally posted by sajithamol
        What is the difference between Factory and Abstract Factory Patterns?
        Just wondering whether these are interview questions that will land you that great job... I'm also wondering what problems you are having research it yourself? My opinion is that these sort of questions are best learned out of a book. IMO.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by kenobewan
          Just wondering whether these are interview questions that will land you that great job... I'm also wondering what problems you are having research it yourself? My opinion is that these sort of questions are best learned out of a book. IMO.
          Yep, especially from the holy book itself, the gang of four.

          Comment

          Working...