Aggregation of abstract class [message #96848] |
Wed, 10 December 2008 05:07  |
Eclipse User |
|
|
|
Originally posted by: maxime.hoeffel.etudiant.univ-nancy2.fr
Hello,
I would like to know if it is possible to define a aggregation of
abstract class ?
I have to model the UML meta-model and the SQL Meta Model in order to
transform an UML model into a SQL model ...
You can find these meta-model here : http://sheisonfire.free.fr/ATL/
Here is my UML km3 file :
package Classe {
class Classifier {
attribute name : String;
}
class Class extends Classifier {
reference feature[*] container : Feature;
}
class Typed {
attribute name : String;
reference type[0-1] : Classifier;
}
class DataType extends Classifier {
}
class Set extends DataType {
reference elementType : Classifier;
}
abstract class Feature extends Typed {
attribute visibility : String;
}
class AssociationEnd extends Feature {
reference otherEnd : AssociationEnd;
reference end[2-*] : Association oppositeOf association;
}
class Attribute extends Feature {
}
class Operation extends Feature {
reference operation_ container : Parameter;
}
class Association {
reference association : AssociationEnd oppositeOf end;
}
class Parameter extends Typed {
}
}
package PrimitiveTypes {
datatype String;
}
And you can see the error I get, below when I want to make the
tranformation :
GRAVE: The class 'Feature' is not a valid classifier
java.lang.IllegalArgumentException: The class 'Feature' is not a valid
classifier
My simple model to transfrom (it is a test version, so it is very
simple, at the moment) :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns="Classe">
<Class name="TestDeClasse">
<feature name="test_attr" visibility="public" />
<feature name="mon_second_attribut" visibility="private" />
</Class>
<Class name="Test2">
</Class>
<DataType name="String"/>
</xmi:XMI>
Thanks in advance for any help !
|
|
|
Re: [ATL]Aggregation of abstract class [message #96918 is a reply to message #96848] |
Thu, 11 December 2008 04:53  |
Eclipse User |
|
|
|
Hi maxime
first don't forget to start you answer by [ATL] if it is the main topic
of the question
As feature is an abstract class you can't put it as target in rule but
as source it's possible. Maybe your rule are not correct can you post them ?
Maxime a écrit :
> Hello,
>
> I would like to know if it is possible to define a aggregation of
> abstract class ?
>
> I have to model the UML meta-model and the SQL Meta Model in order to
> transform an UML model into a SQL model ...
> You can find these meta-model here : http://sheisonfire.free.fr/ATL/
>
>
> Here is my UML km3 file :
> package Classe {
>
> class Classifier {
> attribute name : String;
> }
>
> class Class extends Classifier {
> reference feature[*] container : Feature;
> }
>
> class Typed {
> attribute name : String;
> reference type[0-1] : Classifier;
> }
>
> class DataType extends Classifier {
> }
>
> class Set extends DataType {
> reference elementType : Classifier;
> }
>
> abstract class Feature extends Typed {
> attribute visibility : String;
> }
>
> class AssociationEnd extends Feature {
> reference otherEnd : AssociationEnd;
> reference end[2-*] : Association oppositeOf association;
> }
>
> class Attribute extends Feature {
> }
>
> class Operation extends Feature {
> reference operation_ container : Parameter;
> }
>
> class Association {
> reference association : AssociationEnd oppositeOf end;
> }
>
> class Parameter extends Typed {
>
> }
> }
>
> package PrimitiveTypes {
> datatype String;
> }
>
>
> And you can see the error I get, below when I want to make the
> tranformation :
>
> GRAVE: The class 'Feature' is not a valid classifier
> java.lang.IllegalArgumentException: The class 'Feature' is not a valid
> classifier
>
>
> My simple model to transfrom (it is a test version, so it is very
> simple, at the moment) :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns="Classe">
> <Class name="TestDeClasse">
> <feature name="test_attr" visibility="public" />
> <feature name="mon_second_attribut" visibility="private" />
> </Class>
> <Class name="Test2">
> </Class>
> <DataType name="String"/>
> </xmi:XMI>
>
>
> Thanks in advance for any help !
|
|
|
Powered by
FUDForum. Page generated in 0.02887 seconds