Skip to content

Component details

SunilOS edited this page Mar 12, 2019 · 11 revisions

Persistent Bean

Marksheet POJO bean is created. It is made persistent class using @Entity annotation. It is mapped with table using @Table annotation

DAO (Data Access Object) class

  1. DAO contains data access logic.
  2. DAO is implemented using JPA.
  3. JPA dao is created by extending JpaRepository<persistent-class, primary-key-class> interface.
  4. You do not need to create implementation class of this interface. Spring creates its implementation at run time with basic crud operation methods.

Here we have created MarksheetRespositoryInt dao interface by extends JpaRepository<Marksheet, Long> interface

Service

  1. Service class contains business logic
  2. It handles transactions.
  3. @Transactional annotation is used to make this class transactional
  4. It uses DAO to manipulate database

Here we have created MarksheetServiceInt interface and its implementation class MarksheetServiceImpl

Form Bean

It is POJO bean. It binds Marksheet http request data and apply declarative input validations. Data is bound with form bean when data is submitted to be added or updated in database.

We have created MarksheetForm class and applied annotation for input validations.

REST Controller

It provides REST Web API to add, update, delete, get, and search Marksheet. It is created with help of @RestController annotation.

Here we have created MarksheetCtl rest controller.

Controller performs business operations with help of Service classes.

Sequence Diagram

Add Sequence Diagram

Clone this wiki locally