Emphatic metamodel - Dynamic "attr" for "class" [message #1858568] |
Sat, 08 April 2023 04:19 |
Clever Alves Messages: 101 Registered: August 2019 |
Senior Member |
|
|
Hi there,
In the Filesystem metamodel [1], would it be possible to code a dynamic attribute called "creator"? By dynamic, I mean, for example, a given file might have only one creator, but other files might have two or three creators. Could I code such an "attr" as reliant upon the user's choice somehow, or do I necessarily have to code a certain amount of "creator" attributes explicitly like "creator1", "creator2", etc.?
ORIGINAL CODE
@gmf.node(label = "name")
class File {
attr String name;
}
FIXED-NUMBER SOLUTION
@gmf.node(label = "name")
class File {
attr String name;
attr String creator1;
attr String creator2;
attr String creator3;
}
DESIRED SOLUTION
@gmf.node(label = "name")
class File {
attr String name;
attr (?) String creator; // It's up to the model user the number of creators
}
Thank you.
[1] https://www.eclipse.org/epsilon/doc/eugenia/
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05566 seconds