Variation on the strategy pattern ?
From: Bruno Desthuilliers (bdesth.tagada_at_tsoin-tsoin.free.fr)
Date: 12/21/03
- Next message: Val: "Re: The Sort Excercise"
- Previous message: Val: "Re: The Sort Excercise"
- Next in thread: Daniel T.: "Re: Variation on the strategy pattern ?"
- Reply: Daniel T.: "Re: Variation on the strategy pattern ?"
- Reply: Uncle Bob (Robert C. Martin): "Re: Variation on the strategy pattern ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Dec 2003 23:13:59 +0100
Hi
I have a class of objects (let's say 'Document') that may be build from
differents data sources (text or HTML or XML files, a database, etc). To
abstract the way one of these object can be build, I have defined an
interface (let's say 'DocMaker'), and have various concrete classes
implementing that interface.
The concrete class to use is choosen at run-time, according to the
context (conf files + 'doc type' + etc) - in fact, the concrete DocMaker
object instanciation is handled by a Factory...
I have (almost) the same case with a 'Menu' object, a 'MenuMaker'
interface, and some concrete MenuMakers that can build the Menu from a
filesystem or an XML file or a database or whatever.
Note that in both cases, a concrete 'DocMaker' or 'MenuMaker' can use
other concrete Doc|MenuMakers to build the Document or Menu from
multiple sources (like a Document mixing datas from an HTML file with
data from a database...)
It seems to me that it's a variation on the Strategy pattern, but since
it's more used as a creationnal pattern than as a behavioral one, I
wondered if there was an 'official' name for this use of the Strategy
pattern (and if yes, some link to it - I did STFF but did not find
anything like this...)
TIA
Bruno
- Next message: Val: "Re: The Sort Excercise"
- Previous message: Val: "Re: The Sort Excercise"
- Next in thread: Daniel T.: "Re: Variation on the strategy pattern ?"
- Reply: Daniel T.: "Re: Variation on the strategy pattern ?"
- Reply: Uncle Bob (Robert C. Martin): "Re: Variation on the strategy pattern ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|