Home » Modeling » EMF » classic (?) (meta-)modeling problem
classic (?) (meta-)modeling problem [message #490307] |
Thu, 08 October 2009 10:19 |
Andre Ribeiro Messages: 58 Registered: July 2009 |
Member |
|
|
Hi all,
I'm looking for the best solution for a (meta-)modeling problem, which
although typical can be somewhat tricky:
*_Problem_*:
I want to give my users the possibility to define their own objects
(e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
Vehicle may contain properties such as number of wheels of type Integer,
color of type Enum{BLUE, BLACK, YELLOW} ) and then with the definition
of that object the user should be able to instantiate some "objects" of
that type (e.g. "black_vehicle_001" (with property wheels=4),
"circular_table_002")
Detail: All this info has to be persisted on a relational database using
Spring + Hibernate combination.
Possible solutions I've found so far:
_*#1*_
1. Define a model for the user to specify the objects (meta-language).
2. Use M2M transformations to build the user created models according to
the interpretation of the meta-language
_problem with this solution_: I don't know if there is the possibility
to have M2M transformations (i heard of ATL, QVT, etc.) in runtime.
_*#2*_
Model the problem in Object Oriented Paradigm using UML or XSD and use
some Teneo/CDO magic to get the DB up and running without knowing any
details about its underlying structure.
_problem with this solution_: I don't know if any of the above
(Teneo/CDO) is capable of such a thing, at all.
Any wise advise from the modeling masters out there?!
Thanks a lot in advance!
Cheers,
André
|
|
|
Re: classic (?) (meta-)modeling problem [message #490314 is a reply to message #490307] |
Thu, 08 October 2009 10:47 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
André,
Comments below.
André Ribeiro wrote:
> Hi all,
>
> I'm looking for the best solution for a (meta-)modeling problem, which
> although typical can be somewhat tricky:
>
> *_Problem_*:
> I want to give my users the possibility to define their own objects
> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
> Vehicle may contain properties such as number of wheels of type
> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with the
> definition of that object the user should be able to instantiate some
> "objects" of that type (e.g. "black_vehicle_001" (with property
> wheels=4), "circular_table_002")
>
> Detail: All this info has to be persisted on a relational database
> using Spring + Hibernate combination.
>
> Possible solutions I've found so far:
> _*#1*_
> 1. Define a model for the user to specify the objects (meta-language).
> 2. Use M2M transformations to build the user created models according
> to the interpretation of the meta-language
>
> _problem with this solution_: I don't know if there is the possibility
> to have M2M transformations (i heard of ATL, QVT, etc.) in runtime.
>
> _*#2*_
> Model the problem in Object Oriented Paradigm using UML or XSD
Or Ecore.
> and use some Teneo/CDO magic to get the DB up and running without
> knowing any details about its underlying structure.
>
> _problem with this solution_: I don't know if any of the above
> (Teneo/CDO) is capable of such a thing, at all.
Yes, there is support for mapping UML or XSD onto Ecore (much like your
#1 approach) and from there Teneo supports mapping such a model unto
database tables. Naturally you can use Ecore directly as well.
>
>
> Any wise advise from the modeling masters out there?!
> Thanks a lot in advance!
>
> Cheers,
> André
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: classic (?) (meta-)modeling problem [message #490329 is a reply to message #490307] |
Thu, 08 October 2009 11:29 |
Stefan Winkler Messages: 307 Registered: July 2009 Location: Germany |
Senior Member |
|
|
Hi André,
Comments below.
> _*#2*_
> Model the problem in Object Oriented Paradigm using UML or XSD and use
> some Teneo/CDO magic to get the DB up and running without knowing any
> details about its underlying structure.
>
> _problem with this solution_: I don't know if any of the above
> (Teneo/CDO) is capable of such a thing, at all.
CDO should support storing (meta-)models and models which are created
dynamically using reflective EMF.
The only problem might be that, once an instance model is stored in a
database, the meta-model must not change any more. I'm even not sure if
this is only a CDO-restriction or if it is a restriction of EMF in
general. It could be possible that once an instance is created, the
meta-model must not change any more.
So, in you scenario, it would not be possible to change the Vehicle
class (e.g., by adding another property) if there's already an instance
of that class.
If you want to support such a case, you would have to implement a model
evolution strategy for yourself, e.g., create a new EPackage holding a
new version of the meta-model and then create new instances of the
existing objects as instances of the new meta-model).
Cheers,
Stefan
|
|
|
Re: classic (?) (meta-)modeling problem [message #490331 is a reply to message #490307] |
Thu, 08 October 2009 11:48 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
To add some Teneo related notes:
Afaics I have been doing the type of thing you describe for a customer. This customer has the requirement of allowing
their customers (=enduser/consultant) to be able to add types to the system. Teneo is used to store both the model (as a
blob, there is no other way for that part..) and store instance data. So for them I developed a model store to store
models themselves. A model store instance is used to create an instance store to store instances. Multiple model stores
can co-exist next to eachother together with their related instance store. The model store and instance stores can make
use of different databases. The system also supports updates on the model (adding xsd's in their case). This customer
used xsd's for the model and I wrote some code to take care of converting them to ecore (at runtime, is standard EMF code).
The approach supports adding new types to the system, removing/changing types is more tricky as there may already be
data in the database.
Hibernate supports some form of changing/updating the database schema. With this it should be possible to do some
updates of the schema/model (new types for example). However, many relational db's will lock the complete db when
updating the db schema.
Therefore I developed EAV schema support: http://www.elver.org/hibernate/eav_mapping.html
With EAV there is one set of tables storing all models. So this is stable for model changes.
The nice thing with EAV using Teneo is that you can distribute your model over different mapping approaches: a part of
the model can be mapped as EAV while the rest can be modeled to specific tables (including references between them). So
the dynamic types can be stored in an EAV db schema and a more static type can be stored in specific tables.
Let me know if you want more information. As it is done for a customer I can describe some part of the solution, for
actual code for the model store etc I am afraid that I can only that on consulting basis.
gr. Martin
André Ribeiro wrote:
> Hi all,
>
> I'm looking for the best solution for a (meta-)modeling problem, which
> although typical can be somewhat tricky:
>
> *_Problem_*:
> I want to give my users the possibility to define their own objects
> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
> Vehicle may contain properties such as number of wheels of type Integer,
> color of type Enum{BLUE, BLACK, YELLOW} ) and then with the definition
> of that object the user should be able to instantiate some "objects" of
> that type (e.g. "black_vehicle_001" (with property wheels=4),
> "circular_table_002")
>
> Detail: All this info has to be persisted on a relational database using
> Spring + Hibernate combination.
>
> Possible solutions I've found so far:
> _*#1*_
> 1. Define a model for the user to specify the objects (meta-language).
> 2. Use M2M transformations to build the user created models according to
> the interpretation of the meta-language
>
> _problem with this solution_: I don't know if there is the possibility
> to have M2M transformations (i heard of ATL, QVT, etc.) in runtime.
>
> _*#2*_
> Model the problem in Object Oriented Paradigm using UML or XSD and use
> some Teneo/CDO magic to get the DB up and running without knowing any
> details about its underlying structure.
>
> _problem with this solution_: I don't know if any of the above
> (Teneo/CDO) is capable of such a thing, at all.
>
> Any wise advise from the modeling masters out there?!
> Thanks a lot in advance!
>
> Cheers,
> André
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: classic (?) (meta-)modeling problem [message #490400 is a reply to message #490314] |
Thu, 08 October 2009 14:31 |
Andre Ribeiro Messages: 58 Registered: July 2009 |
Member |
|
|
Ed, thanks very much for the reply.
Comments in-line.
Ed Merks wrote:
> André,
>
> Comments below.
>
> André Ribeiro wrote:
>> Hi all,
>>
>> I'm looking for the best solution for a (meta-)modeling problem,
>> which although typical can be somewhat tricky:
>>
>> *_Problem_*:
>> I want to give my users the possibility to define their own objects
>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>> Vehicle may contain properties such as number of wheels of type
>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with the
>> definition of that object the user should be able to instantiate some
>> "objects" of that type (e.g. "black_vehicle_001" (with property
>> wheels=4), "circular_table_002")
>>
>> Detail: All this info has to be persisted on a relational database
>> using Spring + Hibernate combination.
>>
>> Possible solutions I've found so far:
>> _*#1*_
>> 1. Define a model for the user to specify the objects (meta-language).
>> 2. Use M2M transformations to build the user created models according
>> to the interpretation of the meta-language
>>
>> _problem with this solution_: I don't know if there is the
>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>> in runtime.
>>
>> _*#2*_
>> Model the problem in Object Oriented Paradigm using UML or XSD
> Or Ecore.
right! UML or XSD just seem more natural (one less language) to me.
>> and use some Teneo/CDO magic to get the DB up and running without
>> knowing any details about its underlying structure.
>>
>> _problem with this solution_: I don't know if any of the above
>> (Teneo/CDO) is capable of such a thing, at all.
> Yes, there is support for mapping UML or XSD onto Ecore (much like
> your #1 approach) and from there Teneo supports mapping such a model
> unto database tables. Naturally you can use Ecore directly as well.
I just used Teneo now in a proof-of-concept project, but i realized now
that Teneo will generate orm.xml hibernate file but it cannot take care
of persisting directly the EObjects themselves or alternatively creating
Hibernate Annotated entities (java code). I personally am a fond of
Hibernate Annotations for database creation and schema maintenance (PKs,
FKs, etc...).
as always thanks for the wise bits & tips :)
>>
>>
>> Any wise advise from the modeling masters out there?!
>> Thanks a lot in advance!
>>
>> Cheers,
>> André
|
|
|
Re: classic (?) (meta-)modeling problem [message #490401 is a reply to message #490400] |
Thu, 08 October 2009 14:39 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
André,
Comments below.
André Ribeiro wrote:
> Ed, thanks very much for the reply.
> Comments in-line.
>
> Ed Merks wrote:
>> André,
>>
>> Comments below.
>>
>> André Ribeiro wrote:
>>> Hi all,
>>>
>>> I'm looking for the best solution for a (meta-)modeling problem,
>>> which although typical can be somewhat tricky:
>>>
>>> *_Problem_*:
>>> I want to give my users the possibility to define their own objects
>>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>>> Vehicle may contain properties such as number of wheels of type
>>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with the
>>> definition of that object the user should be able to instantiate
>>> some "objects" of that type (e.g. "black_vehicle_001" (with property
>>> wheels=4), "circular_table_002")
>>>
>>> Detail: All this info has to be persisted on a relational database
>>> using Spring + Hibernate combination.
>>>
>>> Possible solutions I've found so far:
>>> _*#1*_
>>> 1. Define a model for the user to specify the objects (meta-language).
>>> 2. Use M2M transformations to build the user created models
>>> according to the interpretation of the meta-language
>>>
>>> _problem with this solution_: I don't know if there is the
>>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>>> in runtime.
>>>
>>> _*#2*_
>>> Model the problem in Object Oriented Paradigm using UML or XSD
>> Or Ecore.
> right! UML or XSD just seem more natural (one less language) to me.
Well, when using EMF the way you're describing they're actually one more
language as in scenario #1 rather than one less.
>>> and use some Teneo/CDO magic to get the DB up and running without
>>> knowing any details about its underlying structure.
>>>
>>> _problem with this solution_: I don't know if any of the above
>>> (Teneo/CDO) is capable of such a thing, at all.
>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>> your #1 approach) and from there Teneo supports mapping such a model
>> unto database tables. Naturally you can use Ecore directly as well.
> I just used Teneo now in a proof-of-concept project, but i realized
> now that Teneo will generate orm.xml hibernate file but it cannot take
> care of persisting directly the EObjects themselves
Yes it does.
> or alternatively creating Hibernate Annotated entities (java code). I
> personally am a fond of Hibernate Annotations for database creation
> and schema maintenance (PKs, FKs, etc...).
> as always thanks for the wise bits & tips :)
I'm confuse by your assertion. Teneo is all about integrating with
Hibernate so you can save EObjects to a data base...
>>>
>>>
>>> Any wise advise from the modeling masters out there?!
>>> Thanks a lot in advance!
>>>
>>> Cheers,
>>> André
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: classic (?) (meta-)modeling problem [message #490407 is a reply to message #490401] |
Thu, 08 October 2009 14:48 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Thanks Ed, I am also confused, after all these many years of hard work, people still believe that Teneo does not persist
EObjects :-).
gr. Martin
Ed Merks wrote:
> André,
>
> Comments below.
>
> André Ribeiro wrote:
>> Ed, thanks very much for the reply.
>> Comments in-line.
>>
>> Ed Merks wrote:
>>> André,
>>>
>>> Comments below.
>>>
>>> André Ribeiro wrote:
>>>> Hi all,
>>>>
>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>> which although typical can be somewhat tricky:
>>>>
>>>> *_Problem_*:
>>>> I want to give my users the possibility to define their own objects
>>>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>>>> Vehicle may contain properties such as number of wheels of type
>>>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with the
>>>> definition of that object the user should be able to instantiate
>>>> some "objects" of that type (e.g. "black_vehicle_001" (with property
>>>> wheels=4), "circular_table_002")
>>>>
>>>> Detail: All this info has to be persisted on a relational database
>>>> using Spring + Hibernate combination.
>>>>
>>>> Possible solutions I've found so far:
>>>> _*#1*_
>>>> 1. Define a model for the user to specify the objects (meta-language).
>>>> 2. Use M2M transformations to build the user created models
>>>> according to the interpretation of the meta-language
>>>>
>>>> _problem with this solution_: I don't know if there is the
>>>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>>>> in runtime.
>>>>
>>>> _*#2*_
>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>> Or Ecore.
>> right! UML or XSD just seem more natural (one less language) to me.
> Well, when using EMF the way you're describing they're actually one more
> language as in scenario #1 rather than one less.
>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>> knowing any details about its underlying structure.
>>>>
>>>> _problem with this solution_: I don't know if any of the above
>>>> (Teneo/CDO) is capable of such a thing, at all.
>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>> your #1 approach) and from there Teneo supports mapping such a model
>>> unto database tables. Naturally you can use Ecore directly as well.
>> I just used Teneo now in a proof-of-concept project, but i realized
>> now that Teneo will generate orm.xml hibernate file but it cannot take
>> care of persisting directly the EObjects themselves
> Yes it does.
>> or alternatively creating Hibernate Annotated entities (java code). I
>> personally am a fond of Hibernate Annotations for database creation
>> and schema maintenance (PKs, FKs, etc...).
>> as always thanks for the wise bits & tips :)
> I'm confuse by your assertion. Teneo is all about integrating with
> Hibernate so you can save EObjects to a data base...
>>>>
>>>>
>>>> Any wise advise from the modeling masters out there?!
>>>> Thanks a lot in advance!
>>>>
>>>> Cheers,
>>>> André
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: classic (?) (meta-)modeling problem [message #490411 is a reply to message #490400] |
Thu, 08 October 2009 14:56 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi André,
To prevent any possible confusion. Teneo consists of both a mapping and a runtime part. The mapping part allows you to
generate a mapping (orm.xml or hbm file) and the runtime part supports persisting EObjects in the database (both
generated EObjects as well as dynamic EMF EObjects). There is a runtime for EclipseLink and one for Hibernate.
For Hibernate the runtime part can also take care of the mapping at runtime (the default mode).
See this tutorial:
http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
Or in short (this code takes care of mapping also):
final HbDataStore dataStore = new HbSessionDataStore();
dataStore.setName("My Great Datastore");
dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
dataStore.initialize();
final SessionFactory sessionFactory = dataStore.getSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
Library library = LibraryFactory.eINSTANCE.createLibrary();
library.setName("My Library");
session.save(library);
session.getTransaction().commitTransaction();
(note: I used the hibernate session here but you can also do the same thing using an EntityManager).
gr. Martin
André Ribeiro wrote:
> Ed, thanks very much for the reply.
> Comments in-line.
>
> Ed Merks wrote:
>> André,
>>
>> Comments below.
>>
>> André Ribeiro wrote:
>>> Hi all,
>>>
>>> I'm looking for the best solution for a (meta-)modeling problem,
>>> which although typical can be somewhat tricky:
>>>
>>> *_Problem_*:
>>> I want to give my users the possibility to define their own objects
>>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>>> Vehicle may contain properties such as number of wheels of type
>>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with the
>>> definition of that object the user should be able to instantiate some
>>> "objects" of that type (e.g. "black_vehicle_001" (with property
>>> wheels=4), "circular_table_002")
>>>
>>> Detail: All this info has to be persisted on a relational database
>>> using Spring + Hibernate combination.
>>>
>>> Possible solutions I've found so far:
>>> _*#1*_
>>> 1. Define a model for the user to specify the objects (meta-language).
>>> 2. Use M2M transformations to build the user created models according
>>> to the interpretation of the meta-language
>>>
>>> _problem with this solution_: I don't know if there is the
>>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>>> in runtime.
>>>
>>> _*#2*_
>>> Model the problem in Object Oriented Paradigm using UML or XSD
>> Or Ecore.
> right! UML or XSD just seem more natural (one less language) to me.
>>> and use some Teneo/CDO magic to get the DB up and running without
>>> knowing any details about its underlying structure.
>>>
>>> _problem with this solution_: I don't know if any of the above
>>> (Teneo/CDO) is capable of such a thing, at all.
>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>> your #1 approach) and from there Teneo supports mapping such a model
>> unto database tables. Naturally you can use Ecore directly as well.
> I just used Teneo now in a proof-of-concept project, but i realized now
> that Teneo will generate orm.xml hibernate file but it cannot take care
> of persisting directly the EObjects themselves or alternatively creating
> Hibernate Annotated entities (java code). I personally am a fond of
> Hibernate Annotations for database creation and schema maintenance (PKs,
> FKs, etc...).
> as always thanks for the wise bits & tips :)
>>>
>>>
>>> Any wise advise from the modeling masters out there?!
>>> Thanks a lot in advance!
>>>
>>> Cheers,
>>> André
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: classic (?) (meta-)modeling problem [message #490420 is a reply to message #490411] |
Thu, 08 October 2009 15:27 |
Andre Ribeiro Messages: 58 Registered: July 2009 |
Member |
|
|
Hi Martin,
You're solution seems really nice indeed :) (the best I've seen so far)
But i forgot to mention one more requirement that i have, which is rich
UI edition.of the model's instances.
I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
generate nice UIs (Editors, Views and/or PropertySources) for the user
created models.
How did you solve the problem of UI? Are you using standard "Properties
View" editing for your costumers models?
much thanks.
cheers,
André
Martin Taal wrote:
> Hi André,
> To prevent any possible confusion. Teneo consists of both a mapping
> and a runtime part. The mapping part allows you to generate a mapping
> (orm.xml or hbm file) and the runtime part supports persisting
> EObjects in the database (both generated EObjects as well as dynamic
> EMF EObjects). There is a runtime for EclipseLink and one for Hibernate.
> For Hibernate the runtime part can also take care of the mapping at
> runtime (the default mode).
>
> See this tutorial:
> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>
> Or in short (this code takes care of mapping also):
> final HbDataStore dataStore = new HbSessionDataStore();
> dataStore.setName("My Great Datastore");
> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
> dataStore.initialize();
> final SessionFactory sessionFactory = dataStore.getSessionFactory();
> Session session = sessionFactory.openSession();
> session.beginTransaction();
> Library library = LibraryFactory.eINSTANCE.createLibrary();
> library.setName("My Library");
> session.save(library);
> session.getTransaction().commitTransaction();
>
> (note: I used the hibernate session here but you can also do the same
> thing using an EntityManager).
>
> gr. Martin
>
> André Ribeiro wrote:
>> Ed, thanks very much for the reply.
>> Comments in-line.
>>
>> Ed Merks wrote:
>>> André,
>>>
>>> Comments below.
>>>
>>> André Ribeiro wrote:
>>>> Hi all,
>>>>
>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>> which although typical can be somewhat tricky:
>>>>
>>>> *_Problem_*:
>>>> I want to give my users the possibility to define their own objects
>>>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>>>> Vehicle may contain properties such as number of wheels of type
>>>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with
>>>> the definition of that object the user should be able to
>>>> instantiate some "objects" of that type (e.g. "black_vehicle_001"
>>>> (with property wheels=4), "circular_table_002")
>>>>
>>>> Detail: All this info has to be persisted on a relational database
>>>> using Spring + Hibernate combination.
>>>>
>>>> Possible solutions I've found so far:
>>>> _*#1*_
>>>> 1. Define a model for the user to specify the objects (meta-language).
>>>> 2. Use M2M transformations to build the user created models
>>>> according to the interpretation of the meta-language
>>>>
>>>> _problem with this solution_: I don't know if there is the
>>>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>>>> in runtime.
>>>>
>>>> _*#2*_
>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>> Or Ecore.
>> right! UML or XSD just seem more natural (one less language) to me.
>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>> knowing any details about its underlying structure.
>>>>
>>>> _problem with this solution_: I don't know if any of the above
>>>> (Teneo/CDO) is capable of such a thing, at all.
>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>> your #1 approach) and from there Teneo supports mapping such a model
>>> unto database tables. Naturally you can use Ecore directly as well.
>> I just used Teneo now in a proof-of-concept project, but i realized
>> now that Teneo will generate orm.xml hibernate file but it cannot
>> take care of persisting directly the EObjects themselves or
>> alternatively creating Hibernate Annotated entities (java code). I
>> personally am a fond of Hibernate Annotations for database creation
>> and schema maintenance (PKs, FKs, etc...).
>> as always thanks for the wise bits & tips :)
>>>>
>>>>
>>>> Any wise advise from the modeling masters out there?!
>>>> Thanks a lot in advance!
>>>>
>>>> Cheers,
>>>> André
>
>
|
|
|
Re: classic (?) (meta-)modeling problem [message #490424 is a reply to message #490420] |
Thu, 08 October 2009 15:40 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
André,
Teneo and EEF each apply for any EMF model and their usage is
orthogonal, i.e., you should be able to use EEF and Teneo together.
André Ribeiro wrote:
> Hi Martin,
>
> You're solution seems really nice indeed :) (the best I've seen so far)
>
> But i forgot to mention one more requirement that i have, which is
> rich UI edition.of the model's instances.
>
> I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
> generate nice UIs (Editors, Views and/or PropertySources) for the user
> created models.
> How did you solve the problem of UI? Are you using standard
> "Properties View" editing for your costumers models?
>
> much thanks.
> cheers,
> André
>
> Martin Taal wrote:
>> Hi André,
>> To prevent any possible confusion. Teneo consists of both a mapping
>> and a runtime part. The mapping part allows you to generate a mapping
>> (orm.xml or hbm file) and the runtime part supports persisting
>> EObjects in the database (both generated EObjects as well as dynamic
>> EMF EObjects). There is a runtime for EclipseLink and one for Hibernate.
>> For Hibernate the runtime part can also take care of the mapping at
>> runtime (the default mode).
>>
>> See this tutorial:
>> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>>
>> Or in short (this code takes care of mapping also):
>> final HbDataStore dataStore = new HbSessionDataStore();
>> dataStore.setName("My Great Datastore");
>> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>> dataStore.initialize();
>> final SessionFactory sessionFactory = dataStore.getSessionFactory();
>> Session session = sessionFactory.openSession();
>> session.beginTransaction();
>> Library library = LibraryFactory.eINSTANCE.createLibrary();
>> library.setName("My Library");
>> session.save(library);
>> session.getTransaction().commitTransaction();
>>
>> (note: I used the hibernate session here but you can also do the same
>> thing using an EntityManager).
>>
>> gr. Martin
>>
>> André Ribeiro wrote:
>>> Ed, thanks very much for the reply.
>>> Comments in-line.
>>>
>>> Ed Merks wrote:
>>>> André,
>>>>
>>>> Comments below.
>>>>
>>>> André Ribeiro wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>>> which although typical can be somewhat tricky:
>>>>>
>>>>> *_Problem_*:
>>>>> I want to give my users the possibility to define their own
>>>>> objects (e.g. Vehicle, Table, etc.) along with the objects
>>>>> properties (e.g. Vehicle may contain properties such as number of
>>>>> wheels of type Integer, color of type Enum{BLUE, BLACK, YELLOW} )
>>>>> and then with the definition of that object the user should be
>>>>> able to instantiate some "objects" of that type (e.g.
>>>>> "black_vehicle_001" (with property wheels=4), "circular_table_002")
>>>>>
>>>>> Detail: All this info has to be persisted on a relational database
>>>>> using Spring + Hibernate combination.
>>>>>
>>>>> Possible solutions I've found so far:
>>>>> _*#1*_
>>>>> 1. Define a model for the user to specify the objects
>>>>> (meta-language).
>>>>> 2. Use M2M transformations to build the user created models
>>>>> according to the interpretation of the meta-language
>>>>>
>>>>> _problem with this solution_: I don't know if there is the
>>>>> possibility to have M2M transformations (i heard of ATL, QVT,
>>>>> etc.) in runtime.
>>>>>
>>>>> _*#2*_
>>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>>> Or Ecore.
>>> right! UML or XSD just seem more natural (one less language) to me.
>>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>>> knowing any details about its underlying structure.
>>>>>
>>>>> _problem with this solution_: I don't know if any of the above
>>>>> (Teneo/CDO) is capable of such a thing, at all.
>>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>>> your #1 approach) and from there Teneo supports mapping such a
>>>> model unto database tables. Naturally you can use Ecore directly
>>>> as well.
>>> I just used Teneo now in a proof-of-concept project, but i realized
>>> now that Teneo will generate orm.xml hibernate file but it cannot
>>> take care of persisting directly the EObjects themselves or
>>> alternatively creating Hibernate Annotated entities (java code). I
>>> personally am a fond of Hibernate Annotations for database creation
>>> and schema maintenance (PKs, FKs, etc...).
>>> as always thanks for the wise bits & tips :)
>>>>>
>>>>>
>>>>> Any wise advise from the modeling masters out there?!
>>>>> Thanks a lot in advance!
>>>>>
>>>>> Cheers,
>>>>> André
>>
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: classic (?) (meta-)modeling problem [message #490428 is a reply to message #490420] |
Thu, 08 October 2009 15:45 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi André,
I am afraid I can't really help you with that part. This was a client with a web front-end, I am also more developing
web apps myself...
An interesting other approach you can think of is the combination of CDO 3.0-Teneo-Hibernate. But you have to check the
comments by Stefan Winkler regarding how to update models at runtime.
See also this post on flexible UI's and CDO:
http://ekkescorner.wordpress.com/
gr. Martin
André Ribeiro wrote:
> Hi Martin,
>
> You're solution seems really nice indeed :) (the best I've seen so far)
>
> But i forgot to mention one more requirement that i have, which is rich
> UI edition.of the model's instances.
>
> I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
> generate nice UIs (Editors, Views and/or PropertySources) for the user
> created models.
> How did you solve the problem of UI? Are you using standard "Properties
> View" editing for your costumers models?
>
> much thanks.
> cheers,
> André
>
> Martin Taal wrote:
>> Hi André,
>> To prevent any possible confusion. Teneo consists of both a mapping
>> and a runtime part. The mapping part allows you to generate a mapping
>> (orm.xml or hbm file) and the runtime part supports persisting
>> EObjects in the database (both generated EObjects as well as dynamic
>> EMF EObjects). There is a runtime for EclipseLink and one for Hibernate.
>> For Hibernate the runtime part can also take care of the mapping at
>> runtime (the default mode).
>>
>> See this tutorial:
>> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>>
>> Or in short (this code takes care of mapping also):
>> final HbDataStore dataStore = new HbSessionDataStore();
>> dataStore.setName("My Great Datastore");
>> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>> dataStore.initialize();
>> final SessionFactory sessionFactory = dataStore.getSessionFactory();
>> Session session = sessionFactory.openSession();
>> session.beginTransaction();
>> Library library = LibraryFactory.eINSTANCE.createLibrary();
>> library.setName("My Library");
>> session.save(library);
>> session.getTransaction().commitTransaction();
>>
>> (note: I used the hibernate session here but you can also do the same
>> thing using an EntityManager).
>>
>> gr. Martin
>>
>> André Ribeiro wrote:
>>> Ed, thanks very much for the reply.
>>> Comments in-line.
>>>
>>> Ed Merks wrote:
>>>> André,
>>>>
>>>> Comments below.
>>>>
>>>> André Ribeiro wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>>> which although typical can be somewhat tricky:
>>>>>
>>>>> *_Problem_*:
>>>>> I want to give my users the possibility to define their own objects
>>>>> (e.g. Vehicle, Table, etc.) along with the objects properties (e.g.
>>>>> Vehicle may contain properties such as number of wheels of type
>>>>> Integer, color of type Enum{BLUE, BLACK, YELLOW} ) and then with
>>>>> the definition of that object the user should be able to
>>>>> instantiate some "objects" of that type (e.g. "black_vehicle_001"
>>>>> (with property wheels=4), "circular_table_002")
>>>>>
>>>>> Detail: All this info has to be persisted on a relational database
>>>>> using Spring + Hibernate combination.
>>>>>
>>>>> Possible solutions I've found so far:
>>>>> _*#1*_
>>>>> 1. Define a model for the user to specify the objects (meta-language).
>>>>> 2. Use M2M transformations to build the user created models
>>>>> according to the interpretation of the meta-language
>>>>>
>>>>> _problem with this solution_: I don't know if there is the
>>>>> possibility to have M2M transformations (i heard of ATL, QVT, etc.)
>>>>> in runtime.
>>>>>
>>>>> _*#2*_
>>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>>> Or Ecore.
>>> right! UML or XSD just seem more natural (one less language) to me.
>>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>>> knowing any details about its underlying structure.
>>>>>
>>>>> _problem with this solution_: I don't know if any of the above
>>>>> (Teneo/CDO) is capable of such a thing, at all.
>>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>>> your #1 approach) and from there Teneo supports mapping such a model
>>>> unto database tables. Naturally you can use Ecore directly as well.
>>> I just used Teneo now in a proof-of-concept project, but i realized
>>> now that Teneo will generate orm.xml hibernate file but it cannot
>>> take care of persisting directly the EObjects themselves or
>>> alternatively creating Hibernate Annotated entities (java code). I
>>> personally am a fond of Hibernate Annotations for database creation
>>> and schema maintenance (PKs, FKs, etc...).
>>> as always thanks for the wise bits & tips :)
>>>>>
>>>>>
>>>>> Any wise advise from the modeling masters out there?!
>>>>> Thanks a lot in advance!
>>>>>
>>>>> Cheers,
>>>>> André
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: classic (?) (meta-)modeling problem [message #490429 is a reply to message #490424] |
Thu, 08 October 2009 15:49 |
Andre Ribeiro Messages: 58 Registered: July 2009 |
Member |
|
|
Ed,
I'm aware of that, but when using metamodeling you don't know the models
your costumers are going to create and i believe EEF needs to generate
the UI code for known models.
There's no such thing as "Dynamic EEF", is it?
Ed Merks wrote:
> André,
>
> Teneo and EEF each apply for any EMF model and their usage is
> orthogonal, i.e., you should be able to use EEF and Teneo together.
>
>
> André Ribeiro wrote:
>> Hi Martin,
>>
>> You're solution seems really nice indeed :) (the best I've seen so far)
>>
>> But i forgot to mention one more requirement that i have, which is
>> rich UI edition.of the model's instances.
>>
>> I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
>> generate nice UIs (Editors, Views and/or PropertySources) for the
>> user created models.
>> How did you solve the problem of UI? Are you using standard
>> "Properties View" editing for your costumers models?
>>
>> much thanks.
>> cheers,
>> André
>>
>> Martin Taal wrote:
>>> Hi André,
>>> To prevent any possible confusion. Teneo consists of both a mapping
>>> and a runtime part. The mapping part allows you to generate a
>>> mapping (orm.xml or hbm file) and the runtime part supports
>>> persisting EObjects in the database (both generated EObjects as well
>>> as dynamic EMF EObjects). There is a runtime for EclipseLink and one
>>> for Hibernate.
>>> For Hibernate the runtime part can also take care of the mapping at
>>> runtime (the default mode).
>>>
>>> See this tutorial:
>>> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>>>
>>> Or in short (this code takes care of mapping also):
>>> final HbDataStore dataStore = new HbSessionDataStore();
>>> dataStore.setName("My Great Datastore");
>>> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>>> dataStore.initialize();
>>> final SessionFactory sessionFactory = dataStore.getSessionFactory();
>>> Session session = sessionFactory.openSession();
>>> session.beginTransaction();
>>> Library library = LibraryFactory.eINSTANCE.createLibrary();
>>> library.setName("My Library");
>>> session.save(library);
>>> session.getTransaction().commitTransaction();
>>>
>>> (note: I used the hibernate session here but you can also do the
>>> same thing using an EntityManager).
>>>
>>> gr. Martin
>>>
>>> André Ribeiro wrote:
>>>> Ed, thanks very much for the reply.
>>>> Comments in-line.
>>>>
>>>> Ed Merks wrote:
>>>>> André,
>>>>>
>>>>> Comments below.
>>>>>
>>>>> André Ribeiro wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>>>> which although typical can be somewhat tricky:
>>>>>>
>>>>>> *_Problem_*:
>>>>>> I want to give my users the possibility to define their own
>>>>>> objects (e.g. Vehicle, Table, etc.) along with the objects
>>>>>> properties (e.g. Vehicle may contain properties such as number of
>>>>>> wheels of type Integer, color of type Enum{BLUE, BLACK, YELLOW} )
>>>>>> and then with the definition of that object the user should be
>>>>>> able to instantiate some "objects" of that type (e.g.
>>>>>> "black_vehicle_001" (with property wheels=4), "circular_table_002")
>>>>>>
>>>>>> Detail: All this info has to be persisted on a relational
>>>>>> database using Spring + Hibernate combination.
>>>>>>
>>>>>> Possible solutions I've found so far:
>>>>>> _*#1*_
>>>>>> 1. Define a model for the user to specify the objects
>>>>>> (meta-language).
>>>>>> 2. Use M2M transformations to build the user created models
>>>>>> according to the interpretation of the meta-language
>>>>>>
>>>>>> _problem with this solution_: I don't know if there is the
>>>>>> possibility to have M2M transformations (i heard of ATL, QVT,
>>>>>> etc.) in runtime.
>>>>>>
>>>>>> _*#2*_
>>>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>>>> Or Ecore.
>>>> right! UML or XSD just seem more natural (one less language) to me.
>>>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>>>> knowing any details about its underlying structure.
>>>>>>
>>>>>> _problem with this solution_: I don't know if any of the above
>>>>>> (Teneo/CDO) is capable of such a thing, at all.
>>>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>>>> your #1 approach) and from there Teneo supports mapping such a
>>>>> model unto database tables. Naturally you can use Ecore directly
>>>>> as well.
>>>> I just used Teneo now in a proof-of-concept project, but i realized
>>>> now that Teneo will generate orm.xml hibernate file but it cannot
>>>> take care of persisting directly the EObjects themselves or
>>>> alternatively creating Hibernate Annotated entities (java code). I
>>>> personally am a fond of Hibernate Annotations for database creation
>>>> and schema maintenance (PKs, FKs, etc...).
>>>> as always thanks for the wise bits & tips :)
>>>>>>
>>>>>>
>>>>>> Any wise advise from the modeling masters out there?!
>>>>>> Thanks a lot in advance!
>>>>>>
>>>>>> Cheers,
>>>>>> André
>>>
>>>
|
|
|
Re: classic (?) (meta-)modeling problem [message #490436 is a reply to message #490429] |
Thu, 08 October 2009 16:01 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
André,
Ask them. :-P
André Ribeiro wrote:
> Ed,
>
> I'm aware of that, but when using metamodeling you don't know the
> models your costumers are going to create and i believe EEF needs to
> generate the UI code for known models.
> There's no such thing as "Dynamic EEF", is it?
>
> Ed Merks wrote:
>> André,
>>
>> Teneo and EEF each apply for any EMF model and their usage is
>> orthogonal, i.e., you should be able to use EEF and Teneo together.
>>
>>
>> André Ribeiro wrote:
>>> Hi Martin,
>>>
>>> You're solution seems really nice indeed :) (the best I've seen so far)
>>>
>>> But i forgot to mention one more requirement that i have, which is
>>> rich UI edition.of the model's instances.
>>>
>>> I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
>>> generate nice UIs (Editors, Views and/or PropertySources) for the
>>> user created models.
>>> How did you solve the problem of UI? Are you using standard
>>> "Properties View" editing for your costumers models?
>>>
>>> much thanks.
>>> cheers,
>>> André
>>>
>>> Martin Taal wrote:
>>>> Hi André,
>>>> To prevent any possible confusion. Teneo consists of both a mapping
>>>> and a runtime part. The mapping part allows you to generate a
>>>> mapping (orm.xml or hbm file) and the runtime part supports
>>>> persisting EObjects in the database (both generated EObjects as
>>>> well as dynamic EMF EObjects). There is a runtime for EclipseLink
>>>> and one for Hibernate.
>>>> For Hibernate the runtime part can also take care of the mapping at
>>>> runtime (the default mode).
>>>>
>>>> See this tutorial:
>>>> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>>>>
>>>> Or in short (this code takes care of mapping also):
>>>> final HbDataStore dataStore = new HbSessionDataStore();
>>>> dataStore.setName("My Great Datastore");
>>>> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>>>> dataStore.initialize();
>>>> final SessionFactory sessionFactory = dataStore.getSessionFactory();
>>>> Session session = sessionFactory.openSession();
>>>> session.beginTransaction();
>>>> Library library = LibraryFactory.eINSTANCE.createLibrary();
>>>> library.setName("My Library");
>>>> session.save(library);
>>>> session.getTransaction().commitTransaction();
>>>>
>>>> (note: I used the hibernate session here but you can also do the
>>>> same thing using an EntityManager).
>>>>
>>>> gr. Martin
>>>>
>>>> André Ribeiro wrote:
>>>>> Ed, thanks very much for the reply.
>>>>> Comments in-line.
>>>>>
>>>>> Ed Merks wrote:
>>>>>> André,
>>>>>>
>>>>>> Comments below.
>>>>>>
>>>>>> André Ribeiro wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>>>>> which although typical can be somewhat tricky:
>>>>>>>
>>>>>>> *_Problem_*:
>>>>>>> I want to give my users the possibility to define their own
>>>>>>> objects (e.g. Vehicle, Table, etc.) along with the objects
>>>>>>> properties (e.g. Vehicle may contain properties such as number
>>>>>>> of wheels of type Integer, color of type Enum{BLUE, BLACK,
>>>>>>> YELLOW} ) and then with the definition of that object the user
>>>>>>> should be able to instantiate some "objects" of that type (e.g.
>>>>>>> "black_vehicle_001" (with property wheels=4), "circular_table_002")
>>>>>>>
>>>>>>> Detail: All this info has to be persisted on a relational
>>>>>>> database using Spring + Hibernate combination.
>>>>>>>
>>>>>>> Possible solutions I've found so far:
>>>>>>> _*#1*_
>>>>>>> 1. Define a model for the user to specify the objects
>>>>>>> (meta-language).
>>>>>>> 2. Use M2M transformations to build the user created models
>>>>>>> according to the interpretation of the meta-language
>>>>>>>
>>>>>>> _problem with this solution_: I don't know if there is the
>>>>>>> possibility to have M2M transformations (i heard of ATL, QVT,
>>>>>>> etc.) in runtime.
>>>>>>>
>>>>>>> _*#2*_
>>>>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>>>>> Or Ecore.
>>>>> right! UML or XSD just seem more natural (one less language) to me.
>>>>>>> and use some Teneo/CDO magic to get the DB up and running
>>>>>>> without knowing any details about its underlying structure.
>>>>>>>
>>>>>>> _problem with this solution_: I don't know if any of the above
>>>>>>> (Teneo/CDO) is capable of such a thing, at all.
>>>>>> Yes, there is support for mapping UML or XSD onto Ecore (much
>>>>>> like your #1 approach) and from there Teneo supports mapping such
>>>>>> a model unto database tables. Naturally you can use Ecore
>>>>>> directly as well.
>>>>> I just used Teneo now in a proof-of-concept project, but i
>>>>> realized now that Teneo will generate orm.xml hibernate file but
>>>>> it cannot take care of persisting directly the EObjects themselves
>>>>> or alternatively creating Hibernate Annotated entities (java
>>>>> code). I personally am a fond of Hibernate Annotations for
>>>>> database creation and schema maintenance (PKs, FKs, etc...).
>>>>> as always thanks for the wise bits & tips :)
>>>>>>>
>>>>>>>
>>>>>>> Any wise advise from the modeling masters out there?!
>>>>>>> Thanks a lot in advance!
>>>>>>>
>>>>>>> Cheers,
>>>>>>> André
>>>>
>>>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: classic (?) (meta-)modeling problem [message #490442 is a reply to message #490428] |
Thu, 08 October 2009 16:22 |
Andre Ribeiro Messages: 58 Registered: July 2009 |
Member |
|
|
yep, I've seen that post before ... I'm sure Helios + CDO + RedView will
be a blasting combination for nice UI and dynamic modeling ... but so
far we're using Galileo over here ;)
thanks,
André
Martin Taal wrote:
> Hi André,
> I am afraid I can't really help you with that part. This was a client
> with a web front-end, I am also more developing web apps myself...
>
> An interesting other approach you can think of is the combination of
> CDO 3.0-Teneo-Hibernate. But you have to check the comments by Stefan
> Winkler regarding how to update models at runtime.
>
> See also this post on flexible UI's and CDO:
> http://ekkescorner.wordpress.com/
>
> gr. Martin
>
> André Ribeiro wrote:
>> Hi Martin,
>>
>> You're solution seems really nice indeed :) (the best I've seen so far)
>>
>> But i forgot to mention one more requirement that i have, which is
>> rich UI edition.of the model's instances.
>>
>> I was thinking in using EMFT-EET (http://wiki.eclipse.org/EEF) to
>> generate nice UIs (Editors, Views and/or PropertySources) for the
>> user created models.
>> How did you solve the problem of UI? Are you using standard
>> "Properties View" editing for your costumers models?
>>
>> much thanks.
>> cheers,
>> André
>>
>> Martin Taal wrote:
>>> Hi André,
>>> To prevent any possible confusion. Teneo consists of both a mapping
>>> and a runtime part. The mapping part allows you to generate a
>>> mapping (orm.xml or hbm file) and the runtime part supports
>>> persisting EObjects in the database (both generated EObjects as well
>>> as dynamic EMF EObjects). There is a runtime for EclipseLink and one
>>> for Hibernate.
>>> For Hibernate the runtime part can also take care of the mapping at
>>> runtime (the default mode).
>>>
>>> See this tutorial:
>>> http://www.elver.org/hibernate/tutorialone/tutorial1_intro.h tml
>>>
>>> Or in short (this code takes care of mapping also):
>>> final HbDataStore dataStore = new HbSessionDataStore();
>>> dataStore.setName("My Great Datastore");
>>> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>>> dataStore.initialize();
>>> final SessionFactory sessionFactory = dataStore.getSessionFactory();
>>> Session session = sessionFactory.openSession();
>>> session.beginTransaction();
>>> Library library = LibraryFactory.eINSTANCE.createLibrary();
>>> library.setName("My Library");
>>> session.save(library);
>>> session.getTransaction().commitTransaction();
>>>
>>> (note: I used the hibernate session here but you can also do the
>>> same thing using an EntityManager).
>>>
>>> gr. Martin
>>>
>>> André Ribeiro wrote:
>>>> Ed, thanks very much for the reply.
>>>> Comments in-line.
>>>>
>>>> Ed Merks wrote:
>>>>> André,
>>>>>
>>>>> Comments below.
>>>>>
>>>>> André Ribeiro wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I'm looking for the best solution for a (meta-)modeling problem,
>>>>>> which although typical can be somewhat tricky:
>>>>>>
>>>>>> *_Problem_*:
>>>>>> I want to give my users the possibility to define their own
>>>>>> objects (e.g. Vehicle, Table, etc.) along with the objects
>>>>>> properties (e.g. Vehicle may contain properties such as number of
>>>>>> wheels of type Integer, color of type Enum{BLUE, BLACK, YELLOW} )
>>>>>> and then with the definition of that object the user should be
>>>>>> able to instantiate some "objects" of that type (e.g.
>>>>>> "black_vehicle_001" (with property wheels=4), "circular_table_002")
>>>>>>
>>>>>> Detail: All this info has to be persisted on a relational
>>>>>> database using Spring + Hibernate combination.
>>>>>>
>>>>>> Possible solutions I've found so far:
>>>>>> _*#1*_
>>>>>> 1. Define a model for the user to specify the objects
>>>>>> (meta-language).
>>>>>> 2. Use M2M transformations to build the user created models
>>>>>> according to the interpretation of the meta-language
>>>>>>
>>>>>> _problem with this solution_: I don't know if there is the
>>>>>> possibility to have M2M transformations (i heard of ATL, QVT,
>>>>>> etc.) in runtime.
>>>>>>
>>>>>> _*#2*_
>>>>>> Model the problem in Object Oriented Paradigm using UML or XSD
>>>>> Or Ecore.
>>>> right! UML or XSD just seem more natural (one less language) to me.
>>>>>> and use some Teneo/CDO magic to get the DB up and running without
>>>>>> knowing any details about its underlying structure.
>>>>>>
>>>>>> _problem with this solution_: I don't know if any of the above
>>>>>> (Teneo/CDO) is capable of such a thing, at all.
>>>>> Yes, there is support for mapping UML or XSD onto Ecore (much like
>>>>> your #1 approach) and from there Teneo supports mapping such a
>>>>> model unto database tables. Naturally you can use Ecore directly
>>>>> as well.
>>>> I just used Teneo now in a proof-of-concept project, but i realized
>>>> now that Teneo will generate orm.xml hibernate file but it cannot
>>>> take care of persisting directly the EObjects themselves or
>>>> alternatively creating Hibernate Annotated entities (java code). I
>>>> personally am a fond of Hibernate Annotations for database creation
>>>> and schema maintenance (PKs, FKs, etc...).
>>>> as always thanks for the wise bits & tips :)
>>>>>>
>>>>>>
>>>>>> Any wise advise from the modeling masters out there?!
>>>>>> Thanks a lot in advance!
>>>>>>
>>>>>> Cheers,
>>>>>> André
>>>
>>>
>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 26 23:22:36 GMT 2024
Powered by FUDForum. Page generated in 0.05237 seconds
|