Git Product home page Git Product logo

frognotedatabaseclient's Introduction

概要

このプログラムは、FrogNoteDataBaseServerを用いた、クライアントアプリです。 実際に運営するサービスではないため、全ソースを公開しています。 Vue.jsの勉強用のリポジトリなので、エラーハンドリングなどは行っていません。

動作

YouTubeに動画をアップロードしています。 紹介動画

設計

設計

Entry層

Entry層ではアプリケーションの起動処理(一度だけ行う処理)を行います。 そのため、非常に薄いレイヤとなっています。

UI層

UI層では、コンポーネントやビューを実装しています。図では表現できていませんが、MVVMパターンに倣って実装しています。ViewとView Modelは単一ファイルコンポーネントとして記述しているので、階層にはなっていません。

Application層

アプリ層では、アプリ単位での状態を保存・取得、ユースケースをまとめたクラスを実装しています。

ユースケースを実装した理由

UI層が直接インフラ層に依存することで、イベントハンドラ内にUIに関係しない処理が散らばってしまうという問題があります。この問題を解決するために、アプリケーション層内で、ユースケースごとにメソッドを実装することでUIに関連しない処理を外部に隠ぺいするというという方法を採りました。 また、この方法にはもう一つメリットがあり、インフラ層の影響をUI層が直接受けなくなります。

storeをアプリ層内部においた理由

storeはアプリケーションの状態の保存のみに使うこととしました。そのため、Web APIにアクセスするrepositoryとは明確に区別をつけています。

repository store
揮発性がない情報を扱います。 揮発性がある情報を扱います。

Infrastructure層

この層では、Web APIにアクセスし、認証や、データの送受信を行います。

なぜインフラ層を下位レイヤとしなかったのか

一般に、インフラ層は下位レイヤとして実装します。そのためには、依存性逆転を実現する必要がありますが、そこまでして下位に配置する必要はないと判断しています。 なぜなら、repositoryをテスト用など、使い分ける予定がないからです。そのため、依存性逆転をすることでかえって処理の見通しが悪くなると判断しました。

Domain層

現状この層はドメインモデルを表現するための層になっています。APIサーバと同様に、「利用者ごとにFrogNoteのバックアップデータを永続化する」という目的なので、今回の場合、「ユーザ」、「バックアップ」がドメインモデルにあたります。

frognotedatabaseclient's People

Contributors

autumnsky1010 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.