Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Best practices for modularity?

Hi everyone,

I'm back.  :)  I have been using EclipseLink for OXM, and it has succeeded
extremely well for my prototype.  Thank you guys for all your help!  And
congrats on the 1.0 release.  EclipseLink is awesome.  

Now I need to figure out a general strategy for using EclipseLink OXM in our
enterprise.  I'm thinking that we will have some mappings that are
considered "common" and then others that are application-specific and not
shared.  The common vs. application mappings will be in different projects
and deployed as different jars.  I can see that it's possible to partition
the mappings from different projects so that they each have their own
project.xml fiile, and then you can have one session.xml file that is able
to work with multiple projects.xml files (we want to define as much as we
can in the project xml files for easier maintenance).

My questions are:

1.  What does it mean to have a "primary" project versus "additional"
projects in the session?  The documentation talks about how to configure
these but doesn't really go into the ramifications.  Does the order of the
projects matter?

2.  Is is possible for an application's mappings to override the ones from
the common project?

3.  Is is possible for the common project to define mappings that are
"abstract" or based on interfaces?  I see that there is an XMLChoiceMapping,
but I am not sure how to use that because I won't know ahead of time what
application-specific class I need to use.  I would like to have a common
POJO that contains composite objects that are defined in the
application-specific project.  Is that possible?

4.  Is is possible to map different root elements to the same POJO?  Or can
I use a regular expression when matching the root element name?  Our schema
is defined such that we have root elements with different names that have
very similar content, so I'd like to be able to map them to the same POJO. 
>From what I've seen from the code, it looks like I will not be able to do
this directly.  So I think my alternative is to come up with a
transformation to apply before unmarshalling and after marshalling to change
the root element name.  Or do you have other suggestions?

5.  Can you share any other best practices for implementing a modular design
with these mappings?

Thanks for your help!


View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top