Code Monkey home page Code Monkey logo

domain-driven-design-template's Introduction

Domain-Driven Design Template

A Domain-Driven Design template project with Gradle & Spring Boot for IntelliJ IDEA. Inspired by 'Domain-Driven Design: Tackling Complexity in the Heart of Software, by Eric J. Evans'.

Layered Architecture

The concept of layers in software design is a metaphor that is widely accepted in the industry. They allow different parts of the system to operate in isolation, conforming to the separation of concerns, while only depending on themselves and the layers beneath them.

In an object-orientated program, UI, database, and other support code often gets written directly into the business objects. Additional business logic is embedded in the behaviour of UI widgets and database scripts. This happens because it is the easiest way to make things work, in the short run.

So although its easy to 'hack' your new features into the codebase to speed up the implementation delivery, forethought into the design of the application, the domain, and its elements will ultimately eliminate future code debt and make the software easier to maintain, extend and understand.

Presentation Layer

Responsible for showing information to the user and interpreting the user's commands. The external actor might sometimes be another computer system rather than a human user.

Application Layer

Defines the jobs the software is supposed to do and directs the expressive domain objects to work out problems. The tasks this layer is responsible for are meaningful to the business or necessary for interaction with the applications layers of other systems. This layer is kept thin. It does not contain business rules or knowledge, but only coordinates tasks and delegates work to collaborations of domain objects in the next layer down. It does not have state reflecting the business situation, but it can have state that reflects the progress of a task for the user or the program.

Domain Layer

Responsible for representing concepts of the business, information about the business situation, and business rules. State that reflects the business situation is controlled and used here, even though the technical details of storing it are delegated to the infrastructure. This layer is the heart of business software.

Infrastructure

Provides generic technical capabilities that support the higher layers; message sending for the application, persistence for the domain, drawing widgets for the UI, and so on. The infrastructure layer may also support the pattern of interactions between the four layers through an architectural framework.

Separation of Concerns

Separating the domain layer from the infrastructure and user interface layers allows a much cleaner design of each layer. Isolated layers are much less expensive to maintain, because they tend to evolve at different rates and respond to different needs. The separation also helps with development in a distributed system, to allow different layers to be placed flexibly in different servers or clients, in order to minimise communication overhead and improve performance. (Fowler, 1996)

All quotes above, unless otherwise cited, are from 'Domain-Driven Design: Tackling Complexity in the Heart of Software, Eric J. Evans.

For a repository containing domain-driven design elements as marker interfaces. See my domain-library.

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.