views:

13

answers:

0

We are considering splitting our hibernate tables into packages or domains (invoicing, sales, ..etc), primarily for dependency management issues.

It doesn't break neatly of course, so we aren't sure how to handle relationships that cross domains. It would be nice to have a new entity annotation for this, but meanwhile one idea is to make multiple copies of model in which there is some variation in how relations are annotated to 'snip off the loose ends'. These altered entites would probably need to be made 'read only' in the other models they don't belong to. Also, we would keep using the existing full model for a while as we transition apps to use the smaller ones.

So for example, most tables should exist entirely in one model or another; but if Domain1.Table1 relates to Domain2.Table2, then you would make a read-only copy of each in the other's domain. The copy would have it's other relationships in it's domain changed into 'dead ends' (probably by replacing relationship links with an integer fk reference attribute instead).

The point being, we'd like to have some way to manage our maven builds so that when someone changes an attribute on a table, we have declared dependencies on just that domain's model, so we can reduce the number of apps that need to be rebuilt. (we have tight deployment outage windows).

Oh, and all the domains have to use the same java package for compatibility with our legacy EJB persistence tool

So that's the idea. Any suggestions/feedback/comments? Thanks!