Domain Driven Design
What I can say, still a new new thing to do if you are working with a serious project, think it twice. It had given me some interesting challenge. Spring, aspectj, and Hibernate, the domain object are injected with the repository. Some how, domain driven design made me think that Eric Even's "Entity" are similar to EJB's "Entity" bean. They are all heavy objects. They all hide the details about the database operations. They all need this factory and service to complete the life cycle. Let me know if I am wrong about this. This is about a subtle problem during my development of a project. It related to hibernate lazy initialization. When the domain object loaded with hibernate configured lazy="true", and spring + run time aspectjweaver was trying to inject in the data store, I had this "CGLIB Enhancement failed [classname]" failure from hibernate. . Took me an hour to find out what really happened. Had no clue at first. Then there is no ot...