Sunday, April 15, 2012

Decorator Pattern

See solution (ptomli) at http://stackoverflow.com/questions/1425749/anaemic-domain-models-or-where-to-put-logic

also Mark Seemann's comment which seems to allude to use of the strategy pattern in place of an "evil" enum:
but I would change the Channel type to an abstract type that has a GetProductCode method that takes an IProduct as input. Then you could have two concrete implementations (RetailChannel and TradeChannel) the implement that method differently.



No comments:

Post a Comment