This work is based on DAO-Prototype, made by James Rutherford, and it's now syncronized with the current code in
trunk of version 1.5. The code is at this link.
The idea is to improve the architecture, solving some problems in the implementation.

Problems

The highest-level problem is the high coupling between Business Logic Layer and Storage Layer: DAO objects, that are part of the persistence level, perform logic and are massively used by model objects, so the Business Level is very much dependent from the Storage Level.
This problem can be separated in different problems, moreover there are several other architectural
problems.

The proposed solution follows a Domain-Driven approach: Business Logic Layer and Storage Layer have been revised.

Business Logic Layer

To revise this layer two J2EE patterns have been used: Session Facade and Application Service.
Model objects have now only attributes, and no behaviour: the only methods are setter/getter ones. A model object knows its relations with its fathers and its children: e.g. a collection keeps a list of all the community it belongs to and all the items it owns.

Logic is now owned only by managers, no more logic owned by DAOs. The old managers have been invested with more responsabilities, and new managers with specific purposes have been created.
These are some important changes:

Storage Layer

Storage Layer have been revised using Domain Store pattern. This layer is now totally transparent, because the other layers know only its interface, ApplicationService class. 
 To implement Domain Store, Java Persistence (JPA) has been used, with Hibernate as JPA Engine. All model objects have been mapped with JPA Annotations: grounding on these mappings, the DB Schema is automatically generated, there are no DBMS-specifical directives. Only standard JPA annotations have been used, so it's really easy to change JPA-Engine (e.g. TopLink).
Simple CRUD operations are responsability of JPA's EntityManager, while research operations and complex queries are performed by DAOs: DAO objects have now no logic, they perform only queries to "access the data".
The methods of ApplicationService just call EntityManager or a particular DAO.

New architecture

What follows is a high-level view of the architecture of the prototype:

Current status