wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes HF Design Pattern - Abstract Factory and Factory Method Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "HF Design Pattern - Abstract Factory and Factory Method Pattern" Watch "HF Design Pattern - Abstract Factory and Factory Method Pattern" New topic
Author

HF Design Pattern - Abstract Factory and Factory Method Pattern

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
Hi,
Does your book cover Abstract Factory and Factory Method Pattern with a real world example as all the design pattern books i have read so far have not done a good job of providing clear explanation and example, at least to me. I am looking for the situation each one these patterns is required and disadvantage if these patterns are not used in those situation.
thanks.
-Tulsi
Elisabeth Robson
author
Ranch Hand

Joined: May 14, 2004
Posts: 173
    
    6
Hi Tulsi,

We do cover Abstract Factory and Factory Method in the Factory chapter (chapter 4). We have an example that starts simple (with Simple Factory) and is used throughout the rest of the chapter, and we modify it as we go along to show the use of the factories.

It's a pizza shop example - so, if you mean by "real world" an example that computes payroll or similar ( ) then no, it's not "real world" - but it is pretty in-depth and hopefully will give you a good idea of how the factory patterns work. We start by simply providing a way to make different kinds of pizzas (Simple Factory). From there we show how you can gain the benefit of shared code and easily extend and change your pizza factory, by using Factory Method. Then for Abstract Factory, we show how you might want to break up the process of making a pizza and be able to specify how to put different ingredients together depending on which style of pizza you're making.

At the end of the chapter, there is a fireside chat between Factory Method and Abstract Factory that discusses when each is appropriate, as well as a two-page diagram that shows what each pattern is and the differences between them.

Let me know if you read this chapter and have any feedback about it.

Thanks!

Elisabeth


Co-Author of Head First JavaScript Programming
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

At the end of the chapter, there is a fireside chat between Factory Method and Abstract Factory that discusses when each is appropriate, as well as a two-page diagram that shows what each pattern is and the differences between them.


That is great! Search this forum and you will lot of posts comparing the the above two patterns.


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HF Design Pattern - Abstract Factory and Factory Method Pattern
 
Similar Threads
Java Design Pattern
Abstract Factory Pattern
clarification on abstract factory
Factory + Singleton + DAO + Persistence Framwork
How good is this book for a java developer?