Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Aggregation of abstract class
Aggregation of abstract class [message #96848] Wed, 10 December 2008 10:07 Go to next message
Eclipse UserFriend
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 09:53 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
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 !




Previous Topic:Correct way of using the output() function
Next Topic:[QVTO] More information on errors; Maybe corrupt meta models
Goto Forum:
  


Current Time: Thu Apr 25 23:07:03 GMT 2024

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

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

Back to the top