Git Product home page Git Product logo

cleanarchitectureumltemplate's Introduction

Clean Architecture UML Template

Clean Architecture で設計する際にUMLを書くためのテンプレートです。

UMLは PlantUML を使用して出力可能です。

テンプレートで出力した画像

ClassSpec

Clean Architecture について

出典はこちらから。

内側に変化しにくいもの外側に変化しやすいものを配置する構造です。
Layer

もう少し具体的には

  • 外側(青色や緑色の層)
    • 使用するデータベースに関する処理やテーブルに格納するデータ構造
    • データの送受信やファイルI/Oなど他システムとの連携部分
    • 画面のレイアウトや操作方法などUI部分
    • 内側のデータを外側のデータに合致させるデータ変換処理
      • 外側のシステム等が変わればデータ構造も変わる可能性があるので外側に変換処理を置く
  • 内側(赤色や黄色の層)
    • システムで解決する内容
      • そのシステムで何を管理し、何を処理するのか、といった根本部分
    • 根幹となるデータ構造

また、上記を踏まえた上で 自分より内側にあるものしか知らない 様に実装を行う。
※要するに 自分よりも外側にあるクラス名やモデル名などをコードの中に書かない

もしも自分より外側に位置する処理を行いたい、といった場合には
インターフェースで処理を定義し、その処理を実装した外側のクラスを注入することで
処理を委譲する。

以下に「ダメな実装」と「良い実装」を示す。

NG

OK

cleanarchitectureumltemplate's People

Contributors

masayukifukada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

negi111111

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.