Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » GenModel fails on some ECore types(GenModel fails on some ECore types)
GenModel fails on some ECore types [message #1695238] Wed, 13 May 2015 01:13 Go to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
From the EMF book I do understand that I will have to implement the ability to serialize some ECore classes. What I don't understand is how to get GenModel to work and not gives errors on the ECore classes that require manual coding of the serializable interface.
index.php/fa/21786/0/


Oxygen 3a
Windows 10
Re: GenModel fails on some ECore types [message #1695251 is a reply to message #1695238] Wed, 13 May 2015 05:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Paul,

So your goal is to create a GenModel despite the fact that the Ecore
model is invalid and you don't want to change the Ecore model to be
valid? Note that as of EMF 2.9 the Sample Ecore Editor supports live
validation (you can enabled it from the menu bar). In any case, you need
to make the data type of those attributes serializable and specialize
the generated XyzFactoryImpl's method for that data type.


On 13/05/2015 3:13 AM, Paul Roubekas wrote:
> From the EMF book I do understand that I will have to implement the ability to serialize some ECore classes. What I don't understand is how to get GenModel to work and not gives errors on the ECore classes that require manual coding of the serializable interface.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GenModel fails on some ECore types [message #1695287 is a reply to message #1695251] Wed, 13 May 2015 11:12 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Ed: Thank you for taking the time to answer this newbie's stupid questions. Please hang with me on this. It is my understanding the "serializable" and "Transient" are not the same thing. I don't see a "serializable" property on the nine Ecore types that have errors in the ECore model. Are you saying that all nine must be made "Transient" because "Transient" and "serializable" are locked together somehow in EMF? I know I will have to write the code to make the EClasses "serializable', I expect that. What I don't understand is how to tell the ECore model the attrubute is "serializable" to get past the validation error.

On a side note... Is it possible that because the "ETypeParameter" is unspecified that I have having these issues? The drop down box has nothing for any of the nine attributes in error. See one example below.
index.php/fa/21791/0/
  • Attachment: Snap6.png
    (Size: 18.86KB, Downloaded 297 times)


Oxygen 3a
Windows 10
Re: GenModel fails on some ECore types [message #1695291 is a reply to message #1695287] Wed, 13 May 2015 11:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Paul,

Comments below.


On 13/05/2015 1:12 PM, Paul Roubekas wrote:
> Ed: Thank you for taking the time to answer this newbie's stupid questions. Please hang with me on this. It is my understanding the "serializable" and "Transient" are not the same thing.
Yes, the one is a property on the data type and the other a property on
a structural feature...
> I don't see a "serializable" property on the nine Ecore types that have errors in the ECore model.
Where are you looking? All EDataTypes have this property and it's
generally true bu default unless you've set it to false...
> Are you saying that all nine must be made "Transient" because "Transient" and "serializable" are locked together somehow in EMF?
In order to serialize the value of a feature, it must of course be
possible to serialize that value, and so the data type for that value
must be serializeable.
> I know I will have to write the code to make the EClasses "serializable', I expect that.
No, you don't have to write such code. Model instances are serialized
reflectively by resource implementations.
> What I don't understand is how to tell the ECore model the attrubute is "serializable" to get past the validation error.
You've already told it that, but it's making it clear to you that the
serializer will fail attempting to serialize the values for those
attributes.
>
> On a side note... Is it possible that because the "ETypeParameter" is unspecified that I have having these issues?
No.
> The drop down box has nothing for any of the nine attributes in error. See one example below.
>
I see in your picture that you're using EDataTypes from Ecore. Ones
that are not serializeable. If somehow you want them to be
serializeable (which doesn't make much sense for the ones I see in your
screen capture, you'd need to define your own EDataType wrapper and
define it to be serializeable. If you're a newbie, what you're trying
to do seems a little out of whack. What concretely are you trying to
accomplish?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GenModel fails on some ECore types [message #1695312 is a reply to message #1695287] Wed, 13 May 2015 13:01 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Quote:
What concretely are you trying to accomplish?


I am starting to develop a brand new Eclipse RCP application. I have used Eclipse based tooling a lot. What I have not done, until now, is write a Eclipse RCP application. I read the Eclipse book on EMF. I am going through the book on plug-ins now. What I am trying to do "concretely" is compare the different methods of using EMF, Papyrus and Plug-ins together for my RCP application. Since I have not found anything that speaks to how to use these great technologies together I am doing the research for my own benefit and then I can write up a wiki page for the benefit of others. I have seen this type of question during my research, without any sold answers. My reading and testing has uncovered two dead ends and two different supported (designed to work) ways to use EMF, Papyrus and Plug-ins. But both supported methods have issues. I am have a hard time understand how the whole Eclipse ecosystem is so big and strong with great features and designs without a highly mature way to model the EMF Ecore foundation in UML with a correspondingly feature rich Java code generator. I am hoping I am missing something that I will uncover as I methodically go through the different ways of using EMF, Plug-ins and Papyrus together.

Method 1) Make the model in EMF. Then make a GenModel in EMF. Then Generate the Java Code. Then use the four generated projects to continue development. As you know EMF is not a UML tool. So, while EMF does a great job of creating the base classes, a software architect needs to take it the next level and model Activity, Class, Communication, Component, Composite Structure, Deployment, Interaction Overview, Package, Sequence, StateMachine, Timing, UseCase Diagrams. What seems to be a problem to me (maybe my newbie-ness is tripping me up here, I don't know yet) is when one discovers an error while doing UML that requires a change or a new ECore class. There is no "updated EMF Model to existing Papyrus model" merge feature in Papyrus. So making a change in the EMF model is a dead end. I spent several day figuring this out.

Method 2) Start with an empty Papyrus project. Load ECore as a registered profile into Papyrus. Then build the Class diagram from there. The down side that I have seen with this approach is that the properties tab does no editing ECore properties, the field is just text. Being a newbie this would be an endless source of bugs. The other negative is that the Generate Java code is very weak compared to what EMF creates.

Dead end method 3) Click and drag the EMF UML model from EMF canvas onto the Papyrus Canvas. While it seems to work I have been told this method is not suppose to work and to expect problems that will not be considered bugs that need fixing in the future.

Dead end method 4) EMF to Papyrus then use the EMF Java code generator, not the Papyrus Java code generator, on the Papyrus UML. While it seems to work I have been told this method is not suppose to work and to expect problems that will not be considered bugs that need fixing in the future.

Method 5) Just don't use UML? Just use EMF and Plug-ins?





Oxygen 3a
Windows 10
Re: GenModel fails on some ECore types [message #1695324 is a reply to message #1695312] Wed, 13 May 2015 13:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Paul,

Comments below.

On 13/05/2015 3:01 PM, Paul Roubekas wrote:
> Quote:
>> What concretely are you trying to accomplish?
>
>
> I am starting to develop a brand new Eclipse RCP application. I have
> used Eclipse based tooling a lot. What I have not done, until now, is
> write a Eclipse RCP application. I read the Eclipse book on EMF. I
> am going through the book on plug-ins now. What I am trying to do
> "concretely" is compare the different methods of using EMF, Papyrus
> and Plug-ins together for my RCP application. Since I have not found
> anything that speaks to how to use these great technologies together I
> am doing the research for my own benefit and then I can write up a
> wiki page for the benefit of others. I have seen this type of
> question during my research, without any sold answers. My reading and
> testing has uncovered two dead ends and two different supported
> (designed to work) ways to use EMF, Papyrus and Plug-ins. But both
> supported methods have issues. I am have a hard time understand how
> the whole Eclipse ecosystem is so big and strong with great features
> and designs without a highly mature way to model the EMF Ecore
> foundation in UML with a correspondingly feature rich Java code
> generator.
I still remember my IBM days and asked a similar question about IBM's
UML-based graphical modeling tools. I.e., wouldn't it be useful for
customers to be able to map their UML model to Ecore and generated code
from it? I was told, "The customers haven't asked for that." So then
I asked, what are the customers using these tools for then, if not to
generate something useful. I was told they use it to "draw pretty
pictures"... Hmm, okay...
> I am hoping I am missing something that I will uncover as I
> methodically go through the different ways of using EMF, Plug-ins and
> Papyrus together.
When I want a pretty picture of my Ecore model, I use Ecore tools. It's
not perfect, but it's pretty darned nice...
>
> Method 1) Make the model in EMF. Then make a GenModel in EMF. Then
> Generate the Java Code. Then use the four generated projects to
> continue development. As you know EMF is not a UML tool.
Thanks goodness. :-P
> So, while EMF does a great job of creating the base classes, a
> software architect needs to take it the next level and model Activity,
> Class, Communication, Component, Composite Structure, Deployment,
> Interaction Overview, Package, Sequence, StateMachine, Timing,
> UseCase Diagrams.
Well, I generally don't need that, but I can understand that some will
need that...
> What seems to be a problem to me (maybe my newbie-ness is tripping me
> up here, I don't know yet) is when one discovers an error while doing
> UML that requires a change or a new ECore class. There is no "updated
> EMF Model to existing Papyrus model" merge feature in Papyrus. So
> making a change in the EMF model is a dead end. I spent several day
> figuring this out.
I see.
> Method 2) Start with an empty Papyrus project. Load ECore as a
> registered profile into Papyrus. Then build the Class diagram from
> there. The down side that I have seen with this approach is that the
> properties tab does no editing ECore properties, the field is just
> text. Being a newbie this would be an endless source of bugs. The
> other negative is that the Generate Java code is very weak compared to
> what EMF creates.
I see.
>
> Dead end method 3) Click and drag the EMF UML model from EMF canvas
> onto the Papyrus Canvas. While it seems to work I have been told this
> method is not suppose to work and to expect problems that will not be
> considered bugs that need fixing in the future.
I see.
>
> Dead end method 4) EMF to Papyrus then use the EMF Java code
> generator, not the Papyrus Java code generator, on the Papyrus UML.
> While it seems to work I have been told this method is not suppose to
> work and to expect problems that will not be considered bugs that need
> fixing in the future.
>
> Method 5) Just don't use UML? Just use EMF and Plug-ins?
Yes, that's the approach most folks take. And when they're not so
interested in pretty pictures, Xcore is also quite handy...
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GenModel fails on some ECore types [message #1695333 is a reply to message #1695324] Wed, 13 May 2015 13:56 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Quote:
> Method 5) Just don't use UML? Just use EMF and Plug-ins?
Yes, that's the approach most folks take. And when they're not so
interested in pretty pictures, Xcore is also quite handy...


Wow really, that explains it. Bye Bye UML.

On a trivial side note...
Do you remember TogetherSoft's ControlCenter? it did the UML -> Java round tripping very well. I lost track once Borland bought out TogetherSoft. I just looked at the borland's web site and have no idea which product absorbed control center.


Oxygen 3a
Windows 10
Re: GenModel fails on some ECore types [message #1695337 is a reply to message #1695333] Wed, 13 May 2015 14:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Paul,

No, I never looked closely at TogetherSoft. Unfortunately the big
software vendors often treat software like it was fashion, i.e., that it
should be driven to change simply for the sake of change, i.e., mostly
to get you to buy the next version even if it's devoid of any
substantive improvement. And of course it's always more fashionable to
invest in something new than it is to really improve something that
already exists...


On 13/05/2015 3:56 PM, Paul Roubekas wrote:
> Quote:
>> > Method 5) Just don't use UML? Just use EMF and Plug-ins?
>> Yes, that's the approach most folks take. And when they're not so
>> interested in pretty pictures, Xcore is also quite handy...
>
>
> Wow really, that explains it. Bye Bye UML.
>
> On a trivial side note...
> Do you remember TogetherSoft's ControlCenter? it did the UML -> Java
> round tripping very well. I lost track once Borland bought out
> TogetherSoft. I just looked at the borland's web site and have no
> idea which product absorbed control center.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:storing html values in xmi
Next Topic:[xcore] No difference with annotation use
Goto Forum:
  


Current Time: Thu Mar 28 19:48:04 GMT 2024

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

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

Back to the top