Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Can Sapphire be used with EMF models?
Can Sapphire be used with EMF models? [message #1462194] Wed, 05 November 2014 10:04 Go to next message
Dmitri Pisarenko is currently offline Dmitri PisarenkoFriend
Messages: 24
Registered: September 2014
Junior Member
Hello!

Currently, I'm evaluating EMFForms for building UIs for instances of EMF models.

In case EMFForms doesn't allow to customize a particular aspect of the UI (UIs generated by EMFForms are less pretty than those generated by Sapphire), I'd like to use Sapphire for the UI part (for displaying values of an EMF model instance and for automatically saving the values entered by the user in that model).

Questions:

1) Is it possible?
2) What disadvantages does this approach have?

Thanks in advance

Dmitri
Re: Can Sapphire be used with EMF models? [message #1462466 is a reply to message #1462194] Wed, 05 November 2014 15:57 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
No, you cannot use Sapphire UI with an EMF model. You'd have to write a Sapphire model, which should be a fairly mechanical transcribing process since modeling concepts are similar.

[Updated on: Wed, 05 November 2014 15:58]

Report message to a moderator

Re: Can Sapphire be used with EMF models? [message #1464182 is a reply to message #1462466] Fri, 07 November 2014 09:10 Go to previous messageGo to next message
Ondrej Ilcik is currently offline Ondrej IlcikFriend
Messages: 21
Registered: November 2014
Junior Member
Hello Konstantin. There's a nice explanation of relation of Sapphire to other tools from Eclipse ecosystem like e4 or Jface on the proposal page. What I'm still not sure I understand correctly though is how to integrate Sapphire into an existing application, which I believe is a common use-case.

Let me explain. Let's take the question by Dmitri more widely - I believe a common usecase for RCP developers when coming to Sapphire is that they already have some existing domain model (together with existing UI which they want to replace), be it EMF-based, POJO-based or something else. Sapphire requires it's own data model, which seems to be more tailored for the purposes of presentation in UI, but there might be perfectly valid reasons why to keep the original data model - e.g. additional functionality provided, or just the time required to change the model used by various parts of the application.

Could you recommend a way how to adopt Sapphire in this case?
Re: Can Sapphire be used with EMF models? [message #1464461 is a reply to message #1464182] Fri, 07 November 2014 15:33 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
When using Sapphire, the first step is to write a Sapphire model. This is true whether Sapphire is used in a new area or is replacing an existing solution. The rich UI experience and the rapid UI definition process is made possible by the tight coupling of the UI to one specific modeling technology. If you compare Sapphire to other UI building technologies that are able to handle an arbitrary modeling approach, such as JFace DataBindings, you will find that the developer has to write extensive wiring instructions for every property as the cost of this flexibility. Consider the wiring that's necessary for a fairly basic property editor... data, default value, possible values, validation, help, etc. With Sapphire, the developer only specifies the property name and Sapphire UI is able to automatically do all of the wiring.
Re: Can Sapphire be used with EMF models? [message #1468131 is a reply to message #1464461] Mon, 10 November 2014 15:56 Go to previous messageGo to next message
Ondrej Ilcik is currently offline Ondrej IlcikFriend
Messages: 21
Registered: November 2014
Junior Member
Thanks for your quick response. I really like the concept of Sapphire and I understand why your custom-specific modeling technology is needed to be able to provide all those nice UI features. Unfortunately I'm still not sure how to use Sapphire in our situation. The problem is that sometimes we ask a user for various information (provided by UI), but sometimes we have to to retrieve the same kind of information automatically from an external system (which does not involve any usage of UI, it might be just a background task). Naturally we would like to use the same data-model for it. What I'm not sure about is whether we can use Sapphire's model also in the latter case - which might involve things like setting various model values or performing model validation, all in a non-UI thread.

Thanks in advance for any help provided and keep up a good work!
Re: Can Sapphire be used with EMF models? [message #1469562 is a reply to message #1468131] Tue, 11 November 2014 18:16 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
A Sapphire model can be used completely outside of a UI context or a UI thread. As compared to other modeling frameworks, a Sapphire model is tuned for user experience as opposed to raw batch performance, but unless you are loading multi-MB models or need to serve a busy web site, this is unlikely to be an issue.
Previous Topic:Announcing Sapphire 8.1 Release
Next Topic:What class/interface do I need to extend/implement to create a custom Sapphire property editor?
Goto Forum:
  


Current Time: Wed Sep 19 20:11:55 GMT 2018

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

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

Back to the top