Talk:Missing Opportunities for Polymorphism

From WikiContent

(Difference between revisions)
Jump to: navigation, search
(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. --~~~~)
Current revision (19:00, 4 July 2009) (edit) (undo)
 
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.

Personal tools