Sciology = Science + Technology

Commonsense in Technology

Archive for the ‘Naked Objects’ Category

Persist your EMF Objects with Teneo

Posted by sureshkrishna on October 9, 2007

JMatter, NakedObjects and EMF are few technologies that i have been interested recently. That fact that all these technologies allows to create the model, generate the code for UI and finally persist the UI State in Object Reational Databases, makes me get excited about these. Without the help of these frameworks, some business usecases which needs the domain model/metadata to be persisted in the databases does require a lot of hand-coding and often requires long months of implementation. JMatter and Naked Object are supposedly generate the OR mapping from the domain data to the direct database tables with the help of the Hibernate mapping.

For all the EMF and Eclipse lovers it would be difficult to change their applications to JMatter or NakedObjects.  And one reason that i do not want to do it right now is that these frameworks are yet to support the SWT and interop with EMF models. For the Object relational database persistence of the metadata and domain models i found the Teneo project from eclipse to be quite promising.

What is Teneo : Teneo is the eclipse sub-project from  EMFT, which aims at providing the database persistency solution for EMF using Hibernate or JPOX/JDO 2.0. It supports automatic creation of EMF to Relational Mappings and the related database schemas. EMF Objects can be queried and stored using the advanced queries like HQL and JDOQL.

Why use Teneo

  • Teneo allows you to start with your model (UML or XML Schema) and automatically generate the java source code and object-relational mappings.
  • Teneo takes over much (or even all) of the manual work of creating relational mapping schemes.
  • Teneo supports JPA annotations on model level, this keeps your java code clean from persistency specific constructs.
  • The integration with EMF allows you to generate Eclipse RCP editors which persist automatically to a relational database.

And More  Teneo automatically maps the EMF model to a Hibernate OR mapping. The automatic mapping can be done in-memory when your application is initialized or a separate hibernate mapping file can be generated. The generated hbm file can be adapted manually and used in the runtime layer. To handle the EMF resource management and also the Hibernate mappings, a special runtime layer called EMF-Hibernate Runtime layer was developed. Teneo takes care of instantiating the EMF Objects and getters/setters for EFeatures of EMF from database.

This project is definitely a great relief to the EMF and Eclipse developers. Now everyone can persist their models in the Databases with a cleaner Hibernate implementation.

References

Posted in Eclipse, EMF, Java, JMatter, Naked Objects, Plug-ins, Plugin | Tagged: , , , , , , | 4 Comments »

Is “Naked Objects” trying to address similar problems as “EMF” ?

Posted by sureshkrishna on October 2, 2007

Yesterday i was going through the article from the Naked Objects about their platform and architecture. Once i gone through some of their articles and website, i had an impression that its also solving subset/similar set of problems solved by EMF.

For the ones who is not familiar with the Naked Objects, its “an open source Java-based application development platform. It’s called Naked Objects because all you need to develop are your domain objects – the Naked Objects platform auto-creates an object-oriented user interface (giving you the choice of different styles) and the underlying database (using Hibernate)“.

Thus the developer has to develop only the domain model and the UI and Persistence mechanism is auto-generated by the platform. I tried to draw some categories on which i felt Naked Objects is in similar lined as EMF.

Domain Model : Naked Objects requires the entire domain model to be developed in plain java and the domain validations to be described in each of the domain class. That means that domain class will contains the data + behavior + validations. Last but not the lease, each class must implement a NakedObject interface.

All the eclipse projects that i have worked on till date, have EMF models designed as domain models. Mostly created right from the scratch (Omondo, Together, or plain ECore Editor) or from schema. In my view i have always used custom diagnostics/validations for each domain class. In principle i do have my validations on each class.

UI Generation : Naked Objects framework does generate the Web and RCP kind of UIs. I have seen the demos of both the UI and its definitely appealing.  At this point of time, i am not sure how they tackled the “Separation of Concerns”. I really like the differentiation between the View, Content and Label providers level. Not sure if we do have the access to change the editors and custom UI thats generated.

Of course regarding EMF, it does generate the Edit and Editor Plugins along with the Model. I love this separation of concerns about the Content and Labels for the Viewers.  Though the generated editor does contain different kinds of editors, i am at will to change them. I can change what ever i want from this Editor.

Rapid Application Development : Yes in my view both of them does support a very fast development of applications and validation of concepts (though i have not used Naked Objects, i am making this claim on what is mentioned their site and what i have seen in demos) .

In the end i guess in both the frameworks, developers will need to change the UI. As i believe we do need some custom User Interface all the time. Every customer is unique and every customer wants a different UI.

Persistence : Naked Objects claims that it can persist the data directly via hibernate. I feel this is a real good feature, as many a times i do need a persistence mechanism. I would say this is definitely an advancement.

EMF does provide the XML and XMI as the default persistence mechanisms. I did use the Oracle Toplink as a persistence layer for EMF. Of course we do also have the hibernate support, but i have not personally used it.

Interesting thing would be if Naked Objects working with Eclipse. That means i get a similar UI and Persistence mechanism in addition to what EMF provides.

Posted in Eclipse, EMF, Hibernate, Naked Objects, Plug-ins, Plugin, Top Link | 4 Comments »

 
Follow

Get every new post delivered to your Inbox.