Giter Site home page Giter Site logo

vue-oreore-ca's Introduction

vue-oreore-CA

clean architecture勉強用Todoアプリ

Setup

# install
npm install

# Compiles and hot-reloads for development
npm run dev

# Compiles and minifies for production
npm run build

Dependency Rules

  • 下図に従う。
  • 外側のモジュールから内側のモジュールに向かってのみ依存する。
  • 内側のモジュールはインターフェースを介して外側のモジュールを使用する。

clean-architecture

controllers

  • 外界からの入力に応じた処理振り分けを行う。
  • ControllerFactoryにより生成される。
  • 生成するために必要なインスタンスは、各種ControllerFactoryを継承したクラスで定義する。

usecases

  • アプリケーション固有の業務ロジックを担当する。
  • controllerの処理振り分けにより実行される。
  • gatewayによるデータ処理と、処理結果をpresenterに伝播させる。

entities

  • 一般的な規則などを抽象化する。
  • データの加工やバリデーションなどの業務ロジックを担当する。

gateways

  • usecaseからインターフェースを介して実行される。
  • DB保存やAPI実行などのデータ操作を抽象化する。
  • infrastructureのインターフェースを介して、DBからの取得や保存、API実行などを行う。

infrastructure

  • ストレージ操作、API実行の具体的な処理を行う。

presenters

  • usecaseから伝えられた処理結果を画面表示用に整形する。
  • 整形した処理結果はviewStateを介してviewで使用される。

view

  • ユーザーが直接触れる画面と、そのコンポーネントを取りまとめる。
  • 各画面は、必要なcontrollerを生成して、画面操作に応じたcontrollerメソッドを実行する。

Class Diagram

class

vue-oreore-ca's People

Contributors

yr260625 avatar

Watchers

 avatar

vue-oreore-ca's Issues

[Feature]アプリ構成変更

概要

  • アプリの規模に対してファイル数が多すぎる。
  • 似たようなコードがEntity、DTO、Presenterに散らばっている。
  • Controllerは受けた値をDTO化してUsecaseに渡すだけで、役割がほぼない。てか無駄にDTO増やしている感ある。
  • APIの返却値がほぼそのまま表示されるので、Presenterの役割がほぼない。

目的

  • 余分なファイル数を減らす。
  • 無意味なメソッドを減らす。

変更内容

  • Controllerの役割をPresenterが引き継ぐ。
  • PresenterはUsecaseを実行し、実行結果をViewに返却する。
  • ViewはイベントをPresenterに通知する。またPresenterから受けた値によりViewの表示を切り替える。
  • View、Presenter、Domain(Usecase、Entity)、Repository(driver)の構造にする。
  • 外側のレイヤーから内側のレイヤーへ依存するルールは踏襲する。

タスク

  • タスク1
  • タスク2
  • タスク3

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.