Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Enumeration question and translation issue
Enumeration question and translation issue [message #1003768] Tue, 22 January 2013 00:31 Go to next message
Jae Hee Lee is currently offline Jae Hee LeeFriend
Messages: 2
Registered: January 2013
Junior Member
Hi, I am glad that I was able to log on to this forum.

My current work involves translating XML file into EMF file.

My first question: enumeration

In my xml file there is

<componentType id="">

<componentKind> software | hardware </componentKind>

</componentType>

In this case, this means that I have to use enumeration... so what I have done is

I declared cKind enum as

enum Ckind{

software;
hardware;

}

Is this a valid way of specifying enumeration type?

Second question...

I have a thing called domain, which has to put component and its affixed things (port etc.) into the domain. We find specific component instance by looking at its ID. So what I have done is:

@gmf.node(label="name", border.width="5")
class ComponentType{

attr int ID;
attr String name;
attr String desc;
attr Ckind componentKind;

@gmf.affixed(foo="bar")
val InterfaceInstance[*] interfaceInstances;

}

@gmf.node(label="name")
class ComponentInstance{

attr int ID;
attr Trust trust;
attr String name;
attr String desc;

ref ComponentType componentTypeLink;
//The interface instance that are same as interface instance that its type has
@gmf.affixed(foo="bar")
ref ComponentType#interfaceInstances interfaceTypeLink;
}

You can see that ComponentInstance has ID.

So the domain somehow has to include some specific componentInstance or all of the componentInstance drawn on the diagram.

I think using compartment would work in this case. But I would like to know some other ways I might do this (referring to specific attributes etc.)

Thank you!
Re: Enumeration question and translation issue [message #1004209 is a reply to message #1003768] Tue, 22 January 2013 20:07 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi,

Q1: Yes, this is a valid syntax for enumerations in Emfatic.
Q2: Using a compartment for this sounds reasonable indeed.

Cheers,
Dimitris
Re: Enumeration question and translation issue [message #1004371 is a reply to message #1004209] Wed, 23 January 2013 04:44 Go to previous messageGo to next message
Jae Lee is currently offline Jae LeeFriend
Messages: 4
Registered: January 2013
Junior Member
Thank you for the reply. However, you have not answered one of my questions

that is

can I reference another class through its attribute (ID)?

for example componentInstance refer to its componentType by referring it through componentType's ID?



also... is there a way to make the line transparent? (the only option that I know is dashed, solid, dotted.
Re: Enumeration question and translation issue [message #1004626 is a reply to message #1004371] Wed, 23 January 2013 15:11 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

I'm not sure I understand the following question. Could you perhaps elaborate a bit more?

> can I reference another class through its attribute (ID)?
> for example componentInstance refer to its componentType by referring it through componentType's ID?

Regarding your second question, I don't think GMF provides support for transparency - but I could be wrong.

Cheers,
Dimitris
Previous Topic:Enumeration question and translation issue
Next Topic:EmFatic
Goto Forum:
  


Current Time: Thu Mar 28 15:19:17 GMT 2024

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

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

Back to the top