CDM Library » History » Revision 35
« Previous |
Revision 35/120
(diff)
| Next »
Andreas Müller, 09/26/2007 07:11 PM
How To - Releases
CDM Java Library¶
- Table of contents
- CDM Java Library
The CDM Library is meant to be a shared library for the between several applications which can be of any kind, i.e. J2EE having an application container, simple command line tools or swing desktop applications.
The library defines a persistent domain model, EDITs CommonDataModel, that can be serialsed and read in XML. Business logic shared between applications should be part of this library as much as possible, while application specific logic has to stay out. We hope to develop this library in collaboration with the CATE project initially.
Release¶
We are currently debating whether OSGi bundles and/or JAR archives are our preferred form of a CDM library release.
Source Code¶
The source:trunk/cdm can be found in the EDIT subversion repository:
http://dev.e-taxonomy.eu/svn/trunk/cdm
For building Apache Ant must be installed as well Java JDK.
Layers¶
Spring 2.0 Framework¶
We use the Spring 2.0 framework to develop the library and keep the coupling of components low.
Domain Model w/ persistency¶
Domain objects (also called business objects sometimes) are directly taken as POJOs from the CommonDataModel. The logic inherent to the domain objects are restricted to their own object graph, i.e. their own properties and related objects. But not unrelated objects available through DAOs only. Typical logic includes validation and calculations.
Property change support¶
We plan to implement java.bean propertyChangeSupport methods to send change events to registered lissteners:
Validation¶
Validation primarily in setter methods. Implement separate Rule classes too?
XML binding¶
using JAXB
DAO¶
Every domain class has at least a DAO for CRUD operations.
O/RM¶
using JPA w/ Hibernate . Alternatively try TopLink
Service layer¶
The service layer defines the primary public exposed interface for other applications. Every DAO is also exposed as a service, but more complex services can be offered too. Complex validation is part of the service layer as well as import/export of XML files using the XML binding of the domain objects.
XML (Un)Marshalling¶
Services to read and write xml data into domain objects using the JAXB annotations in the domain model
Validation¶
Validation across unrelated domain objects needs to be implemented outside of the domain model. The service layer takes care of this. Validation rules could (should?) be implemented as separate Rule classes
HowTo's¶
Releases¶
run ant:distAsZip from build.xml in project edit_cdm
upack dist\zip\cdmLibrary.zip
put cdmLibrary.jar and all jars from dist\zip\lib into project eu.etaxonomy.cdmLibrary
refresh project and add all unknown libraries to the project classpath
update classpath in plugin.xml\Runtime
test with project eu.etaxonomy.taxeditor
Background¶
Spring Resources¶
http://www.java2s.com/Code/Java/Hibernate/Spring-Hibernate.htm
http://www.shoesobjects.com/blog/2004/11/21/1101083542880.html
Hibernate Resources¶
Updated by Andreas Müller almost 17 years ago · 35 revisions