All Projects → crossroad0201 → Ddd On Scala

crossroad0201 / Ddd On Scala

Licence: mit
DDD sample implementation by Scala.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Ddd On Scala

Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+5395.58%)
Mutual labels:  clean-architecture, ddd
Cleanarchitecture
Clean Architecture Solution Template: A starting point for Clean Architecture with ASP.NET Core
Stars: ✭ 8,945 (+7815.93%)
Mutual labels:  clean-architecture, ddd
Cp Ddd Framework
A lightweight flexible development framework for complex business architecture with full ecosystem!轻量级业务中台开发框架,中台架构的顶层设计和完整解决方案!
Stars: ✭ 566 (+400.88%)
Mutual labels:  clean-architecture, ddd
Android Cleanarchitecture Kotlin
This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
Stars: ✭ 3,646 (+3126.55%)
Mutual labels:  clean-architecture, functional-programming
Monolith Microservice Shop
Source code for https://threedots.tech/post/microservices-or-monolith-its-detail/ article.
Stars: ✭ 83 (-26.55%)
Mutual labels:  clean-architecture, ddd
Go Realworld Clean
a clean architecture implementation of the realworldapp : https://github.com/gothinkster/realworld
Stars: ✭ 301 (+166.37%)
Mutual labels:  clean-architecture, ddd
Wild Workouts Go Ddd Example
Complete application to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring of a Go project.
Stars: ✭ 756 (+569.03%)
Mutual labels:  clean-architecture, ddd
app-from-scratch
Book about Clean Architecture and Clojure
Stars: ✭ 83 (-26.55%)
Mutual labels:  ddd, clean-architecture
Dotnet Template Onion
Onion Architecture with .NET 5/.NET Core and CQRS/Event Sourcing following a DDD approach
Stars: ✭ 70 (-38.05%)
Mutual labels:  clean-architecture, ddd
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (-39.82%)
Mutual labels:  clean-architecture, ddd
Jivejdon
Jivejdon is a Domain Driven Design appication with CQRS/ES/Clean/Hexagonal architecture
Stars: ✭ 287 (+153.98%)
Mutual labels:  clean-architecture, ddd
Clean Architecture
A (work-in-progress) guide to the methodology behind Made Tech Flavoured Clean Architecture
Stars: ✭ 101 (-10.62%)
Mutual labels:  clean-architecture, ddd
Kotlinjetpackinaction
🔥🔥 Kotlin Jetpack zero to hero. 新手到高手
Stars: ✭ 264 (+133.63%)
Mutual labels:  clean-architecture, functional-programming
Blog Core
Modular blog using Blazor with clean domain-driven design patterns
Stars: ✭ 345 (+205.31%)
Mutual labels:  clean-architecture, ddd
buchu
Use Cases - Uniform, auditable and secure use case library
Stars: ✭ 23 (-79.65%)
Mutual labels:  ddd, clean-architecture
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (+533.63%)
Mutual labels:  object-oriented, functional-programming
React-CleanArchitecture-Example
Sample frontend project with Clean Architecture using React.js and jest.
Stars: ✭ 73 (-35.4%)
Mutual labels:  ddd, clean-architecture
clean-ddd-php-poc-contacts
A simple contact manager API to demonstrate the concepts of Clean Architecture and DDD with PHP 7.4+.
Stars: ✭ 31 (-72.57%)
Mutual labels:  ddd, clean-architecture
Practical Clean Ddd
A simplified and effortless approach to get started with Domain-driven Design, Clean Architecture, CQRS, and Microservices patterns
Stars: ✭ 28 (-75.22%)
Mutual labels:  clean-architecture, ddd
Sample Dotnet Core Cqrs Api
Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
Stars: ✭ 1,273 (+1026.55%)
Mutual labels:  clean-architecture, ddd

:toc:

= DDD on Scala

== はじめに

https://www.scala-lang.org[Scala] による https://www.amazon.co.jp/dp/4798121967[DDD(ドメイン駆動設計)] の実装サンプルです。

Scalaの関数型言語の特徴を活かして、 イミュータブル副作用のない(副作用を局所化した) DDDの実装を目指しています。

当サンプルの解説は、 https://speakerdeck.com/crossroad0201/scala-on-ddd[こちらのスライド] を参照してください。

[NOTE]

実装上のポイントを、コード中に NOTE: でコメントしています。 + https://github.com/crossroad0201/ddd-on-scala/search?utf8=%E2%9C%93&q=NOTE%3A&type=[NOTE: で テキスト検索] するなどして参照してください。

== セットアップ

=== 前提

=== DBの準備

このサンプルでは、一部で http://www.h2database.com/html/main.html[組み込みのH2データベース] を使用したコード例があります。

サンプルの実行前にDBを作成します。

  • sbt でDBにテーブルを作成します。 ====

$ sbt "project rdb" flywayMigrate ====

== ビルドと実行

このサンプルはアプリケーションとしてのエンドポイントはありません。 + 動作は sbt からユニットテストを実行して確認してください。

====

$ sbt test ====

== 構成

=== レイヤ・モジュール構成

このサンプルでは、 http://jeffreypalermo.com/blog/the-onion-architecture-part-1/[オニオンアーキテクチャ] をもとにした レイヤ・モジュール構成を採用しています。

image:doc/Layer.png[レイヤ構成図]

[format="csv",options=["header"]] |=== レイヤ,責務,依存するレイヤ ドメイン,ドメイン(業務)の関心事と仕様をモデル化します。,なし アプリケーション,ドメインを使用して、ユースケースを実現します。,ドメイン クエリ,CQRS のクエリモデルです。ドメインの読み取り専用ビューを提供します。,なし インフラストラクチャ,アプリケーションの実行結果を永続化します。,アプリケーション / ドメイン / クエリ インターフェース,利用者へのユーザーインターフェースを提供します。,インフラストラクチャ / アプリケーション / ドメイン / クエリ |===

  • ドメインレイヤアプリケーションレイヤ は特定のインフラストラクチャに依存しないので、 インフラストラクチャの変更が容易になります。 + また、インフラストラクチャをモック化することも容易なので、ユニットテストを簡単かつ軽量に実施することができます。

  • インフラストラクチャレイヤ は、採用するミドルウェア・サービスごとにモジュールを分割します。 + こうすることで、インターフェースレイヤ でインフラストラクチャモジュールを実行に必要なものだけに限定することができ、 使用しないライブラリ(JDBCドライバやクライアントライブラリなど)のために実行モジュールが肥大化することを回避できます + 特に AWS Lambda などのサーバレスプラットフォームでは、実行モジュールが大きくなると実行時のスピンアップ時間が長くなるため、 実行モジュールを小さくすることに価値があります。

  • インターフェースレイヤ は、提供するインターフェース(Web画面、REST API、CLIなど)ごとにモジュールを分割します。 +

=== コンポーネント構成

このサンプルのコンポーネント構成は下図の通りです。

link:modules/application/src/main/scala/crossroad0201/dddonscala/application/task/TaskService.scala[アプリケーションサービス] からコードを追っていくと、全体が把握しやすいと思います。

image:doc/Components.png[コンポーネント図]

=== 概念モデル

このサンプルのドメインでは、シンプルなタスク管理を扱います。 + ドメインの概念モデルは下図の通りです。

image:doc/DomainModel.png[概念モデル図]

== 参考文献

=== Scala

=== DDD(ドメイン駆動設計)

=== アーキテクチャ

=== その他

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].