Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » element.getXYZs(String name, boolean ignoreCase, EClass eclass)
element.getXYZs(String name, boolean ignoreCase, EClass eclass) [message #892119] Wed, 27 June 2012 07:16 Go to next message
Eclipse User
Hi UMLer,

I was wondering whether it would make sense to generate convenience methods
for containment associations to retrieve a list of elements instead of
merely single elements.

For example.

Namespace.getMember(String name, boolean ignoreCase, EClass eclass)
retrieves one element, why not having the same very convenient thing for
multiple elements?

Namespace.getMembers(String name, boolean ignoreCase, EClass eclass), and in
work e.g. classifier.getMembers(null, true, UMLPackage.Literals.CONSTRAINT)
to retrieve all constraints for the classifier?

Before filing this as an issue in Bugzilla, I wanted to figure out what the
developers think about this (and it might be the case that it is already
present in UML2 4.0.0, since I'm still working on UML2 3.2.0). If the dev
teams agrees I'm happy to put this into Bugzilla as enhancement request.

Regards,
Marc-Florian
Re: element.getXYZs(String name, boolean ignoreCase, EClass eclass) [message #892174 is a reply to message #892119] Wed, 27 June 2012 09:53 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4045
Registered: July 2009
Senior Member
Hi

(I'm not a UML2 developer, but I have some idea of the constraints and
possible directions.)

Simple historical answer:

More methods may be helpful but lead to bloat. Difficult compromise.
Make a strong case for the bloat.

More forward looking answer:

[UML2 4.0.0 very nearly had fewer methods, at least the model level.
This regression was fixed at RC3.]

UML 2.5 is likely to have semantically accurate OCL definitions of
nearly all UML functions. Rather than manually transcode these into
Java, it would be nice to auto-generate the Java from the OCL, thereby
ensuring coherence of Eclipse MDT/UML2, and functional utility of the
OMG UML OCL.

Juno introduces an experimental OCL to Java code generator that is used
for about 20 WFRs in the OCL validator. The quality of this code leaves
a lot to be desired. Improvements may be in place for Kepler and/or UML 2.5.

Once the UML utility functions are auto-generated, it may be practical
to maintain a lean, a compromise and a bloated, UML run-time just by
varying auto-generation parameters.

(A Bugzilla stops the suggestion being forgotten.)

Regards

Ed Willink


On 27/06/2012 08:16, Florian Wendland wrote:
> Hi UMLer,
>
> I was wondering whether it would make sense to generate convenience
> methods for containment associations to retrieve a list of elements
> instead of merely single elements.
>
> For example.
>
> Namespace.getMember(String name, boolean ignoreCase, EClass eclass)
> retrieves one element, why not having the same very convenient thing
> for multiple elements?
>
> Namespace.getMembers(String name, boolean ignoreCase, EClass eclass),
> and in work e.g. classifier.getMembers(null, true,
> UMLPackage.Literals.CONSTRAINT) to retrieve all constraints for the
> classifier?
>
> Before filing this as an issue in Bugzilla, I wanted to figure out
> what the developers think about this (and it might be the case that it
> is already present in UML2 4.0.0, since I'm still working on UML2
> 3.2.0). If the dev teams agrees I'm happy to put this into Bugzilla as
> enhancement request.
>
> Regards,
> Marc-Florian
Previous Topic:How to get the type of the element
Next Topic:UML2 4.0 and ActivityNodes
Goto Forum:
  


Current Time: Tue Sep 16 21:42:38 GMT 2014

Powered by FUDForum. Page generated in 0.01645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software