Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Question about EFeatureMap
Question about EFeatureMap [message #431167] Wed, 01 July 2009 09:58 Go to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi,

quick question about FeatureMaps:
Let an EClass have several EStructuralFeatures (e.g. preferredOrders,
standardOrders to stick with the common example, but also an additional
many-valued-EReference to, lets say Address).
Additionally the EClass has the orders-EFeatureMap.

Do I understand correctly that the link between the orders EFeatureMap
and the EStructuralFeatures preferredOrders and standardOrders is only
by implementation of the derived features preferredOrders and
standardOrders?
So there is, i.e., no modelwise-declared constraint which would prevent
something like orders.add(addressStructuralFeature, addressObject)?
Or is there and I have missed it?

Or to put it more generally: does an EFeatureMap allow to get any item
added as long as the EStructuralFeature of the FeatureMap.Entry is a
feature of the containing class? Or can the features of the items be
somehow limited by declaration?

Cheers,
Stefan
Re: Question about EFeatureMap [message #431169 is a reply to message #431167] Wed, 01 July 2009 10:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Stefan,

Comments below.

Stefan Winkler wrote:
> Hi,
>
> quick question about FeatureMaps:
> Let an EClass have several EStructuralFeatures (e.g. preferredOrders,
> standardOrders to stick with the common example, but also an additional
> many-valued-EReference to, lets say Address).
> Additionally the EClass has the orders-EFeatureMap.
>
> Do I understand correctly that the link between the orders EFeatureMap
> and the EStructuralFeatures preferredOrders and standardOrders is only
> by implementation of the derived features preferredOrders and
> standardOrders?
>
Yes.
> So there is, i.e., no modelwise-declared constraint which would prevent
> something like orders.add(addressStructuralFeature, addressObject)?
> Or is there and I have missed it?
>
FeatureMapUtil.getValidator is used to ensure that only
sensible/allowed/meaningful things are added to the feature map.
> Or to put it more generally: does an EFeatureMap allow to get any item
> added as long as the EStructuralFeature of the FeatureMap.Entry is a
> feature of the containing class?
No.
> Or can the features of the items be
> somehow limited by declaration?
>
Yes, the extended meta data annotations limit what's allowed.
> Cheers,
> Stefan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Question about EFeatureMap [message #431196 is a reply to message #431169] Thu, 02 July 2009 07:48 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Ed,

thanks for the answer. Follow-up question below.
>> Or can the features of the items be somehow limited by declaration?
>>
>
> Yes, the extended meta data annotations limit what's allowed.
>
Ok, I had a look at ExtendedMetaData and also came to the
FeatureMapUtil.BasicValidator.

So, if I want to decide (for the CDO store implementation) which values
are possible for a FeatureMap, I would use a

List<EStructuralFeature> includedFeatures = ...;
validator = new FeatureMapUtil.BasicValidator(myContainingClass,
myFeatureMapFeature);
for(EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
if(validator.isIncluded(feature) {
includedFeatures.add(feature);
}
}

Is this correct?
Or is there an easier way to determine that set?


Thanks!
Stefan
Re: Question about EFeatureMap [message #431199 is a reply to message #431196] Thu, 02 July 2009 10:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060003040106030004030608
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Stefan,

In general, a feature map could allow features from the DocumentRoot
class of other packages, i.e., for a feature map that corresponds to a
substitution group or wildcard. In that case, the set of features
allowed is effectively unbounded, much like the set of subclasses is
unbounded.


Stefan Winkler wrote:
> Hi Ed,
>
> thanks for the answer. Follow-up question below.
>
>>> Or can the features of the items be somehow limited by declaration?
>>>
>>>
>> Yes, the extended meta data annotations limit what's allowed.
>>
>>
> Ok, I had a look at ExtendedMetaData and also came to the
> FeatureMapUtil.BasicValidator.
>
> So, if I want to decide (for the CDO store implementation) which values
> are possible for a FeatureMap, I would use a
>
> List<EStructuralFeature> includedFeatures = ...;
> validator = new FeatureMapUtil.BasicValidator(myContainingClass,
> myFeatureMapFeature);
> for(EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
> if(validator.isIncluded(feature) {
> includedFeatures.add(feature);
> }
> }
>
> Is this correct?
> Or is there an easier way to determine that set?
>
>
> Thanks!
> Stefan
>

--------------060003040106030004030608
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Stefan,<br>
<br>
In general, a feature map could allow features from the DocumentRoot
class of other packages, i.e., for a feature map that corresponds to a
substitution group or wildcard.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Hide elements in [List]Viewer
Next Topic:[sdo serialization] want to use reference instead of id
Goto Forum:
  


Current Time: Thu Apr 25 07:45:04 GMT 2024

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

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

Back to the top