I believe that agile modeling and POJOs work well together. In particular, POJOs and modern ORM frameworks such as Hibernate and EJB3 let you build complex domain models. Unlike, EJB CMP, they support inheritance and other kinds of rich relationships between objects.

I believe its possible to adopt POJOs in a mostly incremental fashion. For example with application, which used EJB session and entity beans application, we took the following approach:

In theory, with a larger domain model you could replace each connected subgraph of entity beans with Hibernate separately.

2. New code was written using Spring and Hibernate - this coincided with the beginning of v2 of the product so we were writing lots of new code.

3. As the need arose (e.g. old code needed to be enhanced or new code needed to call old code) we then converted each session bean into a POJO that used Spring for transaction management. It also helped that most session beans were true facades that delegated to an existing POJO manager.

There are certainly other ways to do the migration. And, some of what you do depends on the starting point. For example, if you have a lot code in your EJBs you could incrementally change each EJB into a pure EJB facade that delegates to a POJO that it gets from Spring. You could then either get rid of the EJB or continue to use it.

I hope this helps.

Chris

This thread has been viewed 1018 times.

All times above are in ranch (not your local) time.
The current ranch time is Nov 19, 2018 18:43:53.