Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.6 KB

logic.asciidoc

File metadata and controls

46 lines (32 loc) · 1.6 KB

Logic Layer

In this chapter we are going to create business logic layer for already implemented database entities, repositories, and queries. We are going to prepare transfer-objects together with use-cases and proper component tests.

Transfer objects

In the dataaccess exercise you have created the dataaccess layer. Now, for the logic layer we create the entity interfaces and transfer-objects in the package org.example.app.task.common.

For each entity we extract interface and create ETO:

  • for TaskListEntity extract interface TaskList and create class TaskListEto.

  • for TaskItemEntity extract interface TaskItem and create class TaskItemEto.

Ensure you have all properties (getters and setters) from Entity in the entity interface except for relations.

TOs

Use-Cases

Now that we have created ETOs we create use-cases for CRUD functionality on our business-objects:

  • UcFindTaskList

  • UcFindTaskItem

  • UcSaveTaskList

  • UcSaveTaskItem

  • UcDeleteTaskList

  • UcDeleteTaskItem

Each of use-case implementation shall be annotated as following:

@ApplicationScoped
@Named
@Transactional