Skip to main content

Spring Java API Design Patterns

Default Pattern

We keep default generated Spring Java API Design Pattern simple, with minimum layers. To make it easy to understand and start using faster.

RequestControllerRepositoryEntity

Introducing Layers in Design Patterns

Low-code Customize - Add Layers

Add Service Layer

Please refer to this page for details on Adding Service Layer - For Business Logic Add Service Layer

Builder Studio Enhancements

(Coming Soon)

Builder Studio Options to introduce Layers in Spring Java API Design Pattern to meet your project requirements.

  • Service Layer - For Business Logic
  • DTO Pattern - To Bring all required data in one go from multiple entities.

Layers in this Pattern:

  • Presentation Layer
    • Controller
  • Business Layer: Business Logic, Validations
    • Service Layer
    • DTO (Data Transfer Object)
    • Mapper (Convert Entity to DTO)
  • Data Access | Persistence Layer
    • Repository
    • Entity

Implementation

  • Convert the domain objects to the DTO in the service layer as part of Business Logic.
  • Reduce the accessability of domain objects only to service layer.
  • Reduce the business logic inside controllers, use them for/as Presentation Layer.
Presentation LayerBusiness LogicData Access
RequestControllerService Layer (DTO ⇔ Entity)RepositoryEntity