-
Notifications
You must be signed in to change notification settings - Fork 2
2.2 Service 7 Person Architecture Java 2
Basically the Person Service Architecture of is structered in 5 Layers:
@created by Tran Anh Hoang
The API- Layer is the first tier layer, which include the Entry- and Endpoints of the RESTful Jetty Server. This layer will be used to access Data whithout knowing about the underlaying Layers and Classes.
The Repository-Interface-Layer is an abtraction layer. The goal is to create a contract between the API-Layer and the Repository-Layer, so the API-Layer still know the methods of the Repository-Layer but not the implementation.
Repository-Layer represent the implementation of the Repository-Interface-Layer and is also an abstraction layer between JPA-Layer and Repository-Layer. This Layer can be sepereted in 2 smaller Layer, but for the clarity and understanding, we merged those 2 layer together. In this layer there are the business logic of the Repository-Interface-Layer and it can access Data from the JPA-Layer but not knowing the implementation of the JPA-Layer.
The Model Layer includes all the classes for the mapping of the database-entity. It also has a DataProvides class, which create some test instances of the model-classes and persist it in the database.
The JPA-Layer is the deepest level of the project. In this layer there are JpaPersonDao, JpaGenricDao, JpaPersonAvatarDaos all those 3 classes are using EntityManager to access the database, read and write data in the tables.