Talk:Missing Opportunities for Polymorphism
From WikiContent
(Difference between revisions)
(New page: You could also use the AccountType enum as strategy and delegate the computation to it. So that would mean delegation instead of inheritance. --~~~~) |
|||
| Line 2: | Line 2: | ||
--[[User:Michael Hunger|Michael Hunger]] 18:28, 26 January 2009 (PST) | --[[User:Michael Hunger|Michael Hunger]] 18:28, 26 January 2009 (PST) | ||
| + | |||
| + | I'm not inclined to use an enum here as there is no natural ordering. In this case using an interface offers a clean separation of concerns IMHO. | ||
Current revision
You could also use the AccountType enum as strategy and delegate the computation to it. So that would mean delegation instead of inheritance.
--Michael Hunger 18:28, 26 January 2009 (PST)
I'm not inclined to use an enum here as there is no natural ordering. In this case using an interface offers a clean separation of concerns IMHO.
