Coder Social home page Coder Social logo

clean-architecture-go's Introduction

Clean Architecture For Go

Experimental boilerplate to comply clean architecture for Go.

SOLID principles

SOLID principles serve as guidelines for creating flexible and maintainable software. Each principle aims to facilitate robust design against changes and extensions, improving maintainability and reusability.

SRP: Single Responsibility Principle (単一責任の原則)

A class should have only one responsibility, and there should be only one reason for it to change. This minimizes the impact of class changes on other parts of the system.

OCP: Open-Closed Principle (オープン・クローズドの原則)

Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. Adding new features should be achieved through extension points without modifying existing code.

LSP: Liskov Substitution Principle (リスコフの置換原則)

Subtypes (derived classes, implementing classes, etc.) should be substitutable for their base types. This means that subtypes can be used interchangeably with their base types without modifying the base type's code.

ISP: Interface Segregation Principle (インターフェース分離の原則)

Clients should not be forced to depend on interfaces they do not use. Interfaces should be clearly defined based on the set of functionalities that clients require.

DIP: Dependency Inversion Principle (依存関係逆転の原則)

High-level modules should not depend on low-level modules. Both should depend on abstractions. This principle promotes loose coupling by ensuring that dependencies are based on abstractions rather than concrete implementations.

Layer Definition

The Clean Architecture Concept

Example Diagram

Enterprise Business Rules

  • Entities

Application Business Rules

  • Usecases
    • Interactor:
    • Input Interface
    • Output Interface
    • Data Access Interface

Interface Adapters

  • Controllers: Input Data Process
  • Presenters: Output Data Process
  • Gateways or Repositories: Data Access Process

Frameworks & Drivers

  • UI
  • Database
  • Web
  • Devices
  • External Interfaces

clean-architecture-go's People

Contributors

nenonaoki avatar

Stargazers

Abdulhafiz KAŞGARLI avatar Kγ0suKε avatar Shuya Motouchi avatar  avatar akagikouzanh avatar TSUBOI Shotaro avatar Yusuke Saito 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.