This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 107590 - composition semantics of a multi valued attribute defined by using a DataType as Alias
Summary: composition semantics of a multi valued attribute defined by using a DataTyp...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 09:29 UTC by garganti
Modified: 2010-09-23 09:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description garganti 2007-06-21 09:29:53 UTC
For multi valued attribute, MOF prescribes that (from MOF docs)
------------------
"The possible aggregation semantics of an Attribute depend on its type:
• If an Attribute’s type is expressed as a DataType, it has “non-aggregate” semantics.
• If an Attribute’s type is expressed as a Class, it has “composite” semantics.

In cases where an Attribute has “composite” semantics, the Class instance which is the value of the Attribute is a 
component of the Class instance that contains the Attribute, not vice-versa."
------------------
However, it is possible to have non composite multi valued attribute by using a DataType as Alias of the orginal Class:

------------------
"Note – The above description reflects the fact that the Attribute model element does not have an “aggregation” 
attribute. A Class-valued Attribute with “non-aggregate” semantics is currently expressed by making the Attribute’s 
type a DataType, where the DataType’s “typeCode” is an object reference type that is linked to the Class via a 
TypeAlias."
------------------
This is also remarked in the specs for JMI (4.8.10):

"If an AliasType that is an alias to an object is used as the type of an attribute, the
composition semantics do not apply to that attribute."

------------------
MDR ignores the fact that a multi valued attribute is defined over an Alias and builds the List (or Collection) as 
org.netbeans.mdr.handlers.AttrListWrapper, which checks the composition and rises a CompositionViolationException if 
needed.

I belive that the right implementation is like when an attribute is a Collection, i.e. a standard List or something 
like that.
Comment 1 David Strupl 2010-09-23 09:15:38 UTC
I am closing all reports in category Java/Unsupported as wontfix. These should
be dead issues --- if the reported cases are against some live part of the
NetBeans IDE please reopen and we can discuss to which category they belong.