Giter VIP home page Giter VIP logo

business-logic-patterns's Introduction

Business Logic Patterns

目的とアプローチ

  • 業務アプリケーション分野のドメインオブジェクトの設計パターンを提供する
  • 型(値の種類)の設計スキルを向上するための学習教材や設計のヒントとして提供する
  • そのまま再利用するための汎用的な部品は提供しない
  • 基本レベルとして、金額・数量・率・日付など、業務で関心のある値の計算・判断を扱う値オブジェクトの設計パターンを提供する
  • 応用レベルとして、値オブジェクトを組み合わせた複合オブジェクトの設計パターンを提供する

wikiページ https://github.com/masuda220/business-logic-patterns/wiki

考え方

  • 標準APIの BigDecimalや、LocalDateは汎用的で使いにくい
    • 有効な値の範囲が広すぎる
    • 余計なメソッドが多い
    • 余計なオプション指定(引数)が多い
    • 足りないメソッドが多い
  • その他の公開されているライブラリも同じ
  • 特定の文脈で、特定の用途に使いやすい、値を扱うクラスのシンプルな設計パターンを揃えたい
  • 具体的で限定的な用途を想定して、汎用ライブラリの設計を思い切って単純化する

対象とする範囲

現在の対象範囲は、以下の通り

領域 説明 実装
数量と単位 数量計算や、単位換算 Quantity, Unit
金額 金額計算、税、割引。いったんは、円に限定 Amount, DailyPayroll
日付 日付計算、日数計算 Days
識別番号/識別名 一致不一致の判定
範囲 from-toを扱うクラス、そのコレクション AmountRange, DateRange
位置 位置の表現、距離計算、場所の判定
分類 クラシフィケーション、カテゴライズ、グルーピング
残高 履歴と残高の計算
状態遷移 状態遷移ルールの表現と演算 State
進捗 進捗状態(ビジネスマイルストーン)の表現と演算

business-logic-patterns's People

Contributors

masuda220 avatar abetd avatar wing3298 avatar baki504 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.