|
Re: Question about EFeatureMap [message #431169 is a reply to message #431167] |
Wed, 01 July 2009 10:12 |
Ed Merks Messages: 33216 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 #431199 is a reply to message #431196] |
Thu, 02 July 2009 10:46 |
Ed Merks Messages: 33216 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/
|
|
|
Powered by
FUDForum. Page generated in 0.03353 seconds