Analysis
Overview
New module of the sophie2 project, used as an API to access a database from the server module. Will provide interface to the "server core" layer to persist, save to the database, search for and delete data.
Task requirements
- Write basic server persistence module to the extend needed by the other tasks in Revision 0.
- the persistence API should communicate with the Database(to select and update information)
- it should give the interface for easier manipulation with users and groups.
- Write good JUnit test that test all of the logic written.
- Write a flexible interface to the database API, that can be changed easily.
- Write the basic schema of the database and think of a way to store the creation logic in a good place.
Task result
The result will be a database module in initial state, which will be able to store and retrieve the data needed by the server core's security services. JUnit tests. Initial schema of the database.
Implementation idea
The persistence module will contain Data Access managers with methods like :
void saveEntity(Entity myEntity) {...} void getEntityByField(String field) {...} void persistEntity(Entity myEntity)
etc.. The managers will query the database directly using Database Access provider written for the purpose, that will be changeable. The API will be work with the generated Database Schema to the extend it is written.
Related
S2S_CORE_SECURITY_R0
S2S_DEPLOY_TECHNOLOGIES_R0
The schema must be useful for #1293
How to demo
See that the written logic connects to the database properly and creates the Database Schema. The module can successfully persist, update, delete and search for data in the chosen database.
Design
- The DatabaseManager and Data Access Objects should be implemented using the Singleton pattern.
- The DatabaseSchema statements should be implemented using the database diagram:
- the implementation should be made using the basic persistence class diagram:
- Here are the tests for the new persistence module created: 602
trunk/sophie2-platform/modules/org.sophie2.server.persistence/src/test/java/org/sophie2/server/persistence/EmbeddedDatabaseManagerTest.java
trunk/sophie2-platform/modules/org.sophie2.server.persistence/src/test/java/org/sophie2/server/persistence/dao/GroupDaoTest.java
trunk/sophie2-platform/modules/org.sophie2.server.persistence/src/test/java/org/sophie2/server/persistence/dao/UserDaoTest.java
- This demo is for helping to get into the derby database:
Implementation
The implementation is in 602 and 609.
Testing
Comments
(Write comments for this or later revisions here.)