Home » Modeling » UML2 » isAttribute always returns false
| |
Re: isAttribute always returns false [message #1052960 is a reply to message #1052935] |
Wed, 01 May 2013 15:19 |
Hector Chavez Messages: 34 Registered: February 2010 |
Member |
|
|
Thanks Ed,
I modified the example to have well formed properties and I still get the same result. Do you know of any case of a non-navigable attribute that would make isAttribute return true?
...
Class car = rootPackage.createOwnedClass("Car", false);
Class gas = rootPackage.createOwnedClass("Gas", false);
PrimitiveType type = rootPackage.createOwnedPrimitiveType("String");
Property name = car.createOwnedAttribute("name", type, 1, 1);
System.out.println(name.isAttribute(name)); // false
Association assoc = car.createAssociation(true,
AggregationKind.NONE_LITERAL, "needs", 0, 1, gas, false,
AggregationKind.NONE_LITERAL, "car", 0, 1);
Property car_needs = assoc.getMemberEnd("needs", gas);
Property gas_car = assoc.getMemberEnd("car", car);
System.out.println(car_needs.isAttribute(car_needs)); //false
System.out.println(gas_car.isAttribute(gas_car)); //false
Thanks.
|
|
|
Re: isAttribute always returns false [message #1052962 is a reply to message #1052960] |
Wed, 01 May 2013 15:23 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
My comment on navigability was just based on reading the code without
following up the specifications of the called routines.
It looks as if the assumption was that no one would call isAttribute for
navigable attributes since that would be redundant. This seems wrong
with respect to UML 2.5; hence my suggestion to raise a Bugzilla.
Regards
Ed Willink
On 01/05/2013 16:19, Hector Chavez wrote:
> Thanks Ed,
>
> I modified the example to have well formed properties and I still get
> the same result. Do you know of any case of a non-navigable attribute
> that would make isAttribute return true?
>
> ..
>
> Class car = rootPackage.createOwnedClass("Car", false);
> Class gas = rootPackage.createOwnedClass("Gas", false);
>
> PrimitiveType type = rootPackage.createOwnedPrimitiveType("String");
> Property name = car.createOwnedAttribute("name", type, 1, 1);
>
> System.out.println(name.isAttribute(name)); // false
>
> Association assoc = car.createAssociation(true,
> AggregationKind.NONE_LITERAL, "needs", 0, 1, gas, false,
> AggregationKind.NONE_LITERAL, "car", 0, 1);
>
> Property car_needs = assoc.getMemberEnd("needs", gas);
> Property gas_car = assoc.getMemberEnd("car", car);
>
> System.out.println(car_needs.isAttribute(car_needs)); //false
> System.out.println(gas_car.isAttribute(gas_car)); //false
>
>
> Thanks.
|
|
| |
Goto Forum:
Current Time: Sat Apr 20 04:04:55 GMT 2024
Powered by FUDForum. Page generated in 0.03545 seconds
|