Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is a factory method?

 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please give me a good definition of "factory method", with an example? i come across it a bit in my readings, but not yet clear on its meaning.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://en.wikipedia.org/wiki/Factory_method
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
http://en.wikipedia.org/wiki/Factory_method


Ouch, that description actually is *wrong*! Take a look at my comment in the discussion.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The notion of Design Patterns is *wrong*, so the article is destined to be wrong

Where *is* this divine authoritative source of Truth anyway?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Morris:
The notion of Design Patterns is *wrong*, so the article is destined to be wrong

Where *is* this divine authoritative source of Truth anyway?


Design Patterns don't have anything to do with authoritative sources of truth. If you want to start a discussion about what design patterns *are*, the OO forum probably would be a good place.

The article is wrong because, independently of wether you find it to be *useful* or not, it doesn't describe the design pattern as documented in the GoF book.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Ouch, that description actually is *wrong*! Take a look at my comment in the discussion.

Ouch, you're right.

Perhaps, Ilja, you should take a stab at editing that Wiki page?
[ November 12, 2005: Message edited by: marc weber ]
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:


Design Patterns don't have anything to do with authoritative sources of truth. If you want to start a discussion about what design patterns *are*, the OO forum probably would be a good place.

The article is wrong because, independently of wether you find it to be *useful* or not, it doesn't describe the design pattern as documented in the GoF book.


I didn't mean to suggest that design patterns are indeed related to authoritative sources of truth. But to suggest that something is *wrong* without supplying an axiom indeed is related, since only a divine force could make such a claim (GoF perhaps?). That I claim that the very notion itself is wrong is using an assumed axiom (that software should be valid (which relies on some unstated definition)). If you provide an axiom, I'll invalidate it for you I don't want to discuss it really; I was just making claims to the contrary in the hope that the absurdity might come to the fore. I'll get back in my box now
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:

Ouch, you're right.

Perhaps, Ilja, you should take a stab at editing that Wiki page?


Perhaps I will do that. I'm not sure about the etiquette at wikipedia, though.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Perhaps I will do that. I'm not sure about the etiquette at wikipedia, though.

How to edit a page -- go for it Ilja!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, you should edit it out. I almost did. But since you saw it first.

Mark
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this discussion to the OOP forum.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:
Yeah, you should edit it out. I almost did. But since you saw it first.


Don't hold back! I'm currently not sure when I will find the time, and I can still copyedit your's...

For what it's worth, I'd probably add a link to a (probably not yet existing) article describing the Creation Method pattern, as described in "Refactoring to Patterns".
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my view, the term "Factory Method" is a name, given to a specific pattern as described in the GoF book, by the GoF authors, accepted that way by the patterns community.

Therefore an article trying to explain the term "Factory Method", in the context of Design Patterns (a concept that got coined by the GoF book!), but failing to describe something that matches the description in the GoF book, in my opinion *is* wrong - in a similar sense than a US travel guide describing "Washington DC" as "a term generally referring to a town or a village at the east coast". Without any divine force being involved (at least not verifiably ).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic