Home » Modeling » UML2 » UML and multiple/diamond inheritance
| |
Re: UML and multiple/diamond inheritance [message #475265 is a reply to message #475206] |
Tue, 28 August 2007 23:12 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Andreas,
I would expect that only the redefinition of the feature (from A) is
"available" in X. If both A and B contain features with the same name/type,
I'd say that yes, you have a problem - this situation is best avoided in
general. In practice, this can perhaps be addressed by defining a new
feature (again with the same name and type) that redefines both of the
inherited features. Otherwise, the UML2 code generator will rename one of
the inherited features to make it distinct.
Note that mapping redefinitions to an implementation in a language like Java
isn't trivial; in the UML2 code generator, we've tried to support some of
the common scenarios (e.g. those found in UML itself), but I'm sure some
scenarios aren't being handled properly. If you run into problems, let us
know!
Kenn
"Andreas Werner" <andreas.werner@itso-berlin.de> wrote in message
news:a580138911d908c9b3bef5affd18@news.eclipse.org...
> Hi newsgroup,
> I'm working on a heavyweight extension of the UML metamodel.
> So my problem is that I have the case in which two classes called A and B
> inherit from uml::Class, and another class X is inheriting from A and B.
> (Aka. diamond inheritance)
>
> What happens in X, if a feature of uml::Class is redefined (and renamed)
> only in A, but not in B? Are both features available? ( I'd like to have
> only the redefined one to be there in X! ;) )
>
> Besides, is there a problem, if A as well as B contain features with the
> same name and type?
>
> Kind regards, Andreas
>
>
|
|
| |
Re: UML and multiple/diamond inheritance [message #624555 is a reply to message #475206] |
Tue, 28 August 2007 23:12 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Andreas,
I would expect that only the redefinition of the feature (from A) is
"available" in X. If both A and B contain features with the same name/type,
I'd say that yes, you have a problem - this situation is best avoided in
general. In practice, this can perhaps be addressed by defining a new
feature (again with the same name and type) that redefines both of the
inherited features. Otherwise, the UML2 code generator will rename one of
the inherited features to make it distinct.
Note that mapping redefinitions to an implementation in a language like Java
isn't trivial; in the UML2 code generator, we've tried to support some of
the common scenarios (e.g. those found in UML itself), but I'm sure some
scenarios aren't being handled properly. If you run into problems, let us
know!
Kenn
"Andreas Werner" <andreas.werner@itso-berlin.de> wrote in message
news:a580138911d908c9b3bef5affd18@news.eclipse.org...
> Hi newsgroup,
> I'm working on a heavyweight extension of the UML metamodel.
> So my problem is that I have the case in which two classes called A and B
> inherit from uml::Class, and another class X is inheriting from A and B.
> (Aka. diamond inheritance)
>
> What happens in X, if a feature of uml::Class is redefined (and renamed)
> only in A, but not in B? Are both features available? ( I'd like to have
> only the redefined one to be there in X! ;) )
>
> Besides, is there a problem, if A as well as B contain features with the
> same name and type?
>
> Kind regards, Andreas
>
>
|
|
|
Goto Forum:
Current Time: Wed Sep 25 23:22:08 GMT 2024
Powered by FUDForum. Page generated in 0.03598 seconds
|