«« Next » « Previous
«« Next » « Previous

Link Details

Vote up, vote down. It doesn't matter which - just vote! Login and vote now.
Link 76901 thumbnail

By shamsm
via shamsmi.blogspot.com
Submitted: Apr 21 2008 / 11:53

Last year I had wrote about the factory patterns, I just thought I'd share those links with you all. Simple Factory: http://shamsmi.blogspot.com/2007/08/simple-factory.html Factory Method Pattern: http://shamsmi.blogspot.com/2007/08/factory-method-pattern.html Abstract Factory Pattern: http://shamsmi.blogspot.com/2007/08/abstract-factory-pattern.html
  • 3
  • 0
  • 259
  • 41

Comments

Add your comment
User 131196 avatar

Jakob Jenkov replied ago:

1 votes Vote down Vote up Reply

Nice of you to share them :-)

One comment: You state that "it is time to familiarize ourselves with ... Favor Object Composition over Inheritance", but your text doesn't really explain how the abstract factory pattern adheres to this rule.

If you continue to write about creational patterns, may I suggest adding the whole issue of dependency injection containers, which hide whatever factory pattern you choose to use, from the objects created?

User 228530 avatar

shamsm replied ago:

0 votes Vote down Vote up Reply

@jj83777
thanks for your comments.

regarding Favor Object Composition over Inheritance, we can see in the Fountain class that we now maintain a reference to AbstractFountainFactory to perform the createXxx() operations.

regarding DI, I must admit DI was not into my consideration when i wrote, However, any instance of AbstractFountainFactory could have been DI-ed into the Fountain class using constructor -based or setter-based injection :)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (3)



Voters Against This Link (0)