aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes multiple classification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "multiple classification" Watch "multiple classification" New topic
Author

multiple classification

william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
Hi,
Can anyone clarify the following questions.
1.What is the significance of multiple classification?
2.Can multiple classification be implemented in Java?
3.What is the difference between Dynamic and static classfication?
Thanks in advance
William


Help me!Help you!!!
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Where have you found these questions? Can you take an opening shot at any of them? That will help us know what kind of answers you are looking for and where we should start so we don't cover old ground for you.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
Originally posted by Stan James:
Where have you found these questions? Can you take an opening shot at any of them? That will help us know what kind of answers you are looking for and where we should start so we don't cover old ground for you.

Hi Stan,
My question is based on the content in UML distilled on 'Multiple and dynamic classification'. I am having a problem trying to map what is said as the difference between multiple classification and multiple inheritance to how it can be achived in Java.For the time being I have reconciled that I would implement multiple classification by creating an object whose class implements many disconnected interfaces.Multiple inheritance(which cannot be implemented in java) will therefore be a class being a subclass of multiple superclasses.
The book goes on to state how classification can be dynamic and static and how objects can change type in dynamic classification.I am just not able relate this to any implementation in Java.
thanks,
William
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Another ranch hand, Bala, has a little article on this topic, #2 on this list: http://www.zepho.com/articles.html

The distinction between classification and generalization (inheritance) is not something I had thought much about before. It's an interesting idea and may make you more comfortable with implementing multiple interfaces.
Edwin Keeton
Ranch Hand

Joined: Jul 10, 2002
Posts: 214

Multiple inheritance usually means direct implementation inheritance from two (or more) parent classes. This is different from an inheritance hierarchy, where a subtype inherits from its parent, which in turn is a subtype of its parent, (and so on).

I say it usually means that because, depending on the context, multiple inheritance sometimes describes multiple interface inheritance.

Multiple classification gets ugly really fast when you try to implement it. At least when I try to implement it, I should say. On the other hand, if you allow that an actor can only play one role at a time, you can use object inheritance to capture basically the same information as multiple classification.

Objects related through object inheritance represent the same domain entity, just as in multiple classification. You can simulate object inheritance in Jave by having the parent and child implement the same interface, and passing messages to the child directly through to the parent.

You could implement the multiple classification diagram in UML distilled this way. The sex type classification would be reduced to an attribute of Person, the patient classification as another role that a Person could play, (outside the role generalization set), then implement the actor-role relationship through object inheritance.

Again, this is based on the stipulation that an actor can only play one role at a time. My understanding of multiple classification is that, back to the diagram, a Person instance can play the role of a Patient and Doctor at the same time.

Multiple classification is useful for domain/conceptual modeling to show the different ways we are interested in classifying the parent class. I can't remember having seen, or think of an example, of classifications that aren't roles played by the parent, or that can't be reduced to attributes.


SCJP, SCWCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: multiple classification
 
Similar Threads
Reg multiple and dynamic classification in UML
Multiple and Dynamic Classification
multiple classification and multiple inheritance
dynamic classification
UML : composition vs aggregation