Git Product home page Git Product logo

codebaybackend's Introduction

Codebay

Application developed with Spring Boot and structured with Hexagonal Architecture made by Quathar.

In this application you will be able to simulate an e-commerce basic functionality and its management part.

Index

Structure (Hexagonal Architecture)

Hexagonal Architecture, also known as Ports and Adapters Architecture, is a design pattern used to create loosely coupled application components. This architecture allows an application to be equally driven by users, programs, automated tests, or batch scripts, and to be developed and tested in isolation from its eventual runtime devices and databases.

To create this structure the SOLID principles are followed.

SOLID Principles:

  • Single Responsibility Principle: A class should have only one reason to change.
  • Open/Closed Principle: Software entities should be open for extension but closed for modification.
  • Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program (Contract Design).
  • Interface Segregation Principle: No client should be forced to depend on methods it does not use.
  • Dependency Inversion Principle: High-level modules should not depend on low-level modules. Both should depend on abstractions.

Domain

The Domain Layer is the core of the Architecture. It contains the business logic and rules of the application. This layer is independent of any external systems or frameworks, ensuring that the business logic remains decoupled from technical concerns.

Key components:

  • Entities: Represent the core business objects of the application.
  • Value Objects: Represent immutable objects that are distinguishable only by their attributes.
  • Aggregates: Represent a cluster of associated objects that are treated as a single unit.
  • Repositories: Define the interface for interacting with the data source (commonly a database).
  • Domain Services: These are services that contain domain logic which doesn't naturally fit within an entity or value object.
  • Events: Represent domain events that are raised by the domain layer and consumed by the application layer.

Application

The Application Layer is responsible for orchestrating the business logic and coordinating the flow of data between the domain and the infrastructure layers. It contains application services, which are used to implement use cases and application-specific logic.

Key components:

  • Application Services: These services contain the application-specific business logic and orchestrate the interaction between the domain and infrastructure layers.
  • DTOs (Data Transfer Objects): These are simple objects used to transfer data between the application and other layers.
  • Mappers: These are responsible for converting between domain objects and DTOs.

Infrastructure

The Infrastructure Layer is responsible for providing technical capabilities to the application. It includes implementations for repositories, external services, and other technical concerns. This layer interacts with external systems such as databases, messaging systems, and other services.

Key components:

  • Adapters: These are implementations of the interfaces defined in the domain layer. They handle the interaction with external systems.
  • Repositories: These are concrete implementations of the repository interfaces defined in the domain layer.
  • Configuration: This includes configuration classes and files for setting up the infrastructure components.

codebaybackend's People

Contributors

quathar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.