• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple classification and multiple inheritance

 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fowler says,
"Note that multiple classification is different from multiple inheritance. Multiple inheritance says that a type may have many supertypes, but that a single type must be defined for each object. Multiple classification allows multiple types for an object without defining a specific type for the purpose"
I'm not clear about what he says? Can someone please clarify,
Thanks.
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read Martin Fowler's pdf document on the roles and subtyping and could make some sense(i guess) of what he is talking above.
Multiple classification is a concept that can be achieved by implementation of multiple interfaces (roles). Hence we have an object(type) that is implementing multiple types without defining the object type for the specific purpose of multiple classification. This is not the case in multiple inheritance. I guess dynamic classification gives further flexibility to multiple classification with the ability of switching between the roles of a particular object. Did i or still , not really sure
Any thoughts will be appreciated.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you got it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic