Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Would you like to model both the domain layer and UML Objects at the same time ?
Would you like to model both the domain layer and UML Objects at the same time ? [message #684298] Wed, 15 June 2011 11:35 Go to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Object approach with UML is different from the domain layer modeling (e.g. database)
Having said that what do you think if you could create database stereotypes in your class diagram and immediately get ORM annotations in your java code ?

The concept is to use a database profile which allow you to add ORM stereotypes (e.g. Hibernate, EJB3) on classes, attributes and methods. When you add a stereotype then the ORM annotation is immediately created in your java code. Without much effort, you can get Hibernate to generate your database schema automatically, dispensing entirely with SQL scripts.
It is also a big time saver to think at object level. Annotations are a great way to manage your database persistence. With annotations, you don't need to bother with XML mapping files. You can also leverage the sensible default behavior to drastically reduce the amount of code you need to maintain.

Do you think that domain layer should be model at the same time as UML objects ?

[Updated on: Wed, 15 June 2011 11:36]

Report message to a moderator

(no subject) [message #684352 is a reply to message #684298] Wed, 15 June 2011 13:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Vlad,

The subject line is a bit incoherent...

Vlad Varnica wrote:
> Object approach with UML
You mean an object-oriented approach, i.e., using inheritance?
> is different from the domain layer modeling (e.g. database)
I've never heard the "domain layer" modeling term. Databases use a
relational approach rather than an object oriented approach. Maybe
that's what you're getting at...
> Having said that what do you think if you could create database
> stereotypes in your class diagram and immediately get ORM annotations
> in your java code ?
That's pretty much analogous to JPA in Java and Teneo's approach for ORM
mapping for Ecore...
>
> The concept is to use a database profile which allow you to add ORM
> stereotypes (e.g. Hibernate, EJB3) on classes, attributes and methods.
> When you add a stereotype then the ORM annotation is immediately
> created in your java code. Without much effort, you can get Hibernate
> to generate your database schema automatically, dispensing entirely
> with SQL scripts.
Lots of people like this approach.
> It is also a big time saver to think at object level. Annotations are
> a great way to manage your database persistence. With annotations, you
> don't need to bother with XML mapping files.
Using XML to describe ORM is just one approach. One might imagine a DSL
and of course annotations or stereotypes are really much like a DSL.
> You can also leverage the sensible default behavior to drastically
> reduce the amount of code you need to maintain.
Yes, that's why many people like this approach.
> Do you think that domain layer should be model at the same time as UML
> objects ?
I'd certain not call a relational representation "the domain layer" but
that's just terminology. One of the difficulties of ORM is how to map
an inheritance hierarchy onto tables. Of course if you avoid
inheritance, that particular problem goes away. Maybe that's why you've
been advocating inheritance avoidance...
Re: (no subject) [message #684360 is a reply to message #684352] Wed, 15 June 2011 13:34 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Ed,

I get your point which is to say that Teneo with EMF is the same as Java with annotations.
Hibernate/EJB3 are a standard as well as UML.
Teneo and EMF have already failed. Having said that what next ....

[Updated on: Wed, 15 June 2011 13:34]

Report message to a moderator

Re: (no subject) [message #684388 is a reply to message #684360] Wed, 15 June 2011 14:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Vlad,

Of course I don't agree that Teneo has failed, but that's just you being
provocative.

In terms of what next, people will use what they find is valuable.
Because many people find this approach of annotating/stereotyping their
primary object-oriented representation with ORM mapping information to
be extremely useful it's an approach we're bound to see continue well
into the future. Of course not everyone is looking to stuff their data
into a database, so not everyone will care about this topic...


Vlad Varnica wrote:
> Ed,
>
> I get your point which is to say that Teneo with EMF is the same as
> Java with annotations.
> Hibernate/EJB3 are a standard as well as UML.
> Teneo and EMF have already failed having said that what next ....
Previous Topic:Problems with static profiles in fragment bundle
Next Topic:relationship of dependency - profile and class
Goto Forum:
  


Current Time: Sat Dec 20 15:49:49 GMT 2014

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

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