강의

멘토링

로드맵

Inflearn brand logo image
BEST
Programming

/

Back-end

トビのクリーンスプリング - ドメインモデルパターンとヘキサゴナルアーキテクチャ Part 1

仮想のスタートアップ開発チームが段階的にクリーンコードとSpring開発原則に従って、迅速で安定かつ柔軟、そして保守性の高い開発を行う過程を実際の業務遂行と類似した方式で経験できるようにする講座シリーズである「クリーンSpring」の第1回目講座です。ドメインモデルパターンとヘキサゴナルアーキテクチャを活用して、ドメイン中心の初期開発段階で必要な技術と開発戦略を習得できます。

  • tobyilee
실습 중심
백엔드이해하기
클린코드
Java
Spring
Spring Boot
JPA
hexagonal-architecture

学習した受講者のレビュー

こんなことが学べます

  • ドメインモデルを中心とした設計と開発戦略

  • ドメイン駆動設計(DDD)のさまざまなパターンと実践法

  • ヘキサゴナルアーキテクチャの特徴と効果、簡単にこれを適用する方法

  • 多様なテスト技法とアーキテクチャテストツールの使用法

  • AIを活用してJPAエンティティを簡潔なドメインモデルにする方法

  • 最新スプリングウェブ例外処理の技法とテストツールの使用法

  • アグリゲートを用いたモジュール構成

トビーと一チームなる
スプリングサービスを完成させます。

<トビーのクリーンスプリング>は、仮想のオンライン教育サービス「スプラーン(Splearn)」を共に開発し、企画から設計、実装、リファクタリングまで、全体の過程を本番のように体験する講義です。

皆さんはトビーと一チームになり、一つのサービスを一緒に完成していきます。企画から実装、リファクタリングまで、各過程ごとに何を考慮し、どんな決定を下すべきかトビーとともに現実的な観点から悩んで判断していきます。このプロセスを通して、あなたはどの技術が「いつそしてなぜ必要なのか」、「なぜこのような構造を設計したのか」という文脈を理解する力を養います。

<トビーのクリーンスプリング>ロードマップ
クリーンコードとスプリング開発の原則を習得するシリーズ講義です。ドメインモデリングからMSA、観測性まで、Springアプリケーションの成長プロセスを7つのコースに収めました。 (ロードマップに行く>>)

336073_1

持続可能なコードの選択
クリーンスプリング

クリーンスプリングは、「クリーンコード」の原則をスプリング開発に適用する実践戦略です。単に見やすいコードではなく、チームの生産性と長期的なコード品質を一緒に引き上げることが目標です。ケント・ベックが語った「機能的でクリーンなコード」は、その重要な哲学をよく示しています。

保守性と生産性はお互いを前提とします。変更しやすいコードがメンテナンスを容易にし、素早く変えることができなければ生産性も上がります。この構造を作るためにはリファクタリングが必須であり、その前提はテストコードです。

このレッスンでは、機能を追加したり構造を整理したりするたびに、直接リファクタリングしてテストを作成するプロセスを繰り返し表示します。

これらの実践はまもなくクリーンスプリング戦略であり、あなたはこれによって変化に強いコードを生み出す事故の力を育てます。

(クリーンスプリング詳細な話はインフコン2024発表映像でご覧いただけます。👉 )

トビーのクリーンスプリングシリーズ、第一

ドメインモデルと
ヘキサゴナルアーキテクチャ

クリーンスプリング開発の始まりは、サービスが解決しようとしている問題(ドメイン)を深く理解することです。そしてこれをコードに反映し、機能が拡張されても安定的に発展できるように設計する核心戦略がドメインモデルパターンとヘキサゴナルアーキテクチャ(hexagonal-architecture)です。

講義では、最新のSpring、Web、JPA技術をもとにドメインモデルとヘキサゴナルアーキテクチャを実際に適用してみて、プロジェクト構造の把握、モジュール分離、コラボレーション方式、テスト戦略といった実務初期のコア悩みを一緒に解決していきます。このプロセスでは、ドメインモデルをリファクタリングして発展させる流れを体験することができます。

<ドメインモデルとヘキサゴナルアーキテクチャ>は、part1,2の2つの講義で構成されています。

Part1.メンバー機能を中心に、ドメインモデルとアーキテクチャのスケルトンを構築し、コアロジック設計、構造化、テストコードベースの開発方法を実践します。 *本講義

Part2.複雑な要件をカバーし、モデルをリデザインし、実践に必要な深い設計、さまざまなリファクタリング技術、テストサポートツールを適用します。

ドメインモデルとヘキサゴナルアーキテクチャ part1。

学習内容

ドメインモデルを中心とした開発戦略

ドメインの概念と関係を正確に反映するには、それを抽象化したドメインモデルが必要です。ドメイン主導設計(DDD)は、ドメイン専門家と開発チームが一緒にモデルを確立し発展させ、複雑な問題を効果的に解決するアプローチです。

講義では、複雑なドメインではなくても、DDDの重要な原則とパターンを実際のサービス開発に適用します。また、ドメインモデルをコードに自然に溶かし、継続的な統合を通じて発展させる方法も一緒に練習します。

コミュニケーションのためのドメインモデル文書の作成方法

ドメインモデル中心の開発が効果的になるためには、すべての開発チームのメンバーがドメインの専門家と一緒にモデルを作成してコミュニケーションできる必要があります。

そのためには、文書、コード、会議など、あらゆるコミュニケーションで単一の語彙システム、つまりユニバーサル言語(Ubiquitous Language)を一貫して使用することが重要です。

レッスンでは、この普遍的な言語とドメインモデルをマークダウン文書としてプロジェクトに書き込む方法を紹介し、コードの変更とともにモデルがどのように進化していくのかをまとめていきます。

ヘキサゴナルアーキテクチャの事実と誤解

ヘキサゴナルアーキテクチャはよく誤解されますが、Springの基本原則に従う開発者であれば、すでにその価値をある程度活用している可能性があります。

レッスンでは、ヘキサゴナルアーキテクチャの重要な概念、階層、インターフェイスの構成方法を調べ、アーキテクチャが提供する利点を効果的に得る方法を学びます。

簡単な原則だけを守ってもドメインロジックに集中することができます。

階層間依存関係ルールの適用

ヘキサゴナールアーキテクチャとドメインモデルパターンを一緒に適用すると、凝集度が高くメンテナンス性に優れた構造を作ることができます。ただし、これらの構造の価値を適切に活用するには、階層アーキテクチャの依存関係規則をよく守る必要があります。

講義では、各階層の責任に応じて機能をどのように配置するか、コード構成をどのようにすべきかを中心に、階層設計でよく見逃しやすい部分を深く扱います。

アグリガートを用いたモジュール構造設計

ドメイン主導設計で導入されたアグリゲートは、データ変更の単位を設計し、変更の一貫性を維持します。

アグリゲート内で満たさなければならない不変式をどのように見つけて扱うか、アグリゲートルートをどのように使用するのか、それをサポートするSpring Dataプロジェクトのリポジトリパターンはどのように使用するのかを見て、アグリゲートパターンを適用します。

アグリゲットとヘキサゴナールアーキテクチャを組み合わせて詳細モジュールを設定する方法も説明します。

JPAエンティティによるきちんとしたドメインオブジェクトの作成

JPA技術の特徴と目的を見て、JPAエンティティをドメインオブジェクトを効果的にする技術として活用する方法を紹介します。

過度のJPAアノテーションがドメインロジックと混在している問題を解決するための標準的なアプローチもお知らせします。この時、AI技術を活用してみます。

JPAエンティティをドメインと区別して使用する特別なケースについても話します。

アーキテクチャテストとコード検証、テスト戦略

作成したアプリケーションコードが外部に提供する機能が正しく作成されていることを確認するテストコードを作成します。テストでは直接確認が難しいが、運用環境で問題になる可能性がある、静的分析ツールを活用したコード検証方式も併せて適用し、コードの安定性と一貫性を高める方法を習得します。

こんな方に
おすすめです

学習対象は
誰でしょう?

  • WebとDBを使うSpring技術での実務開発がどう進むか知りたい方

  • クリーンコード原則を適用して保守性に優れ生産性の高いシステム開発をご希望の方

  • サービス開発をリードする中級以上の開発者に成長したいジュニア開発者

  • 最新アーキテクチャと開発技法を学び、多大な期待を胸に働き始める新人、ジュニア開発者をリードしたいシニア開発者

前提知識、
必要でしょうか?

  • Java 言語

  • スプリングの基本原理の理解

  • ウェブAPIとJPAを使用するスプリングアプリケーション開発経験

こんにちは
です。

13,568

受講生

737

受講レビュー

341

回答

5.0

講座評価

7

講座

호주에 살고 있는 소프트웨어 개발자입니다. 30년간 다양한 분야의 시스템과 서비스를 개발해본 경험이 있습니다. 

스프링 프레임워크와 관련 기술을 좋아하고 JVM 기반 언어를 주로 사용합니다.

한국스프링사용자모임(KSUG)을 설립하고 활동했고, 토비의 스프링이라는 책을 쓰기도 했습니다.

개발과 관련된 다양한 주제에 관해 이야기하는 것을 좋아합니다. 

 

 

カリキュラム

全体

43件 ∙ (14時間 31分)

講座資料(こうぎしりょう):

授業資料
講座掲載日: 
最終更新日: 

受講レビュー

全体

144件

5.0

144件の受講レビュー

  • zin님의 프로필 이미지
    zin

    受講レビュー 2

    平均評価 5.0

    5

    29% 受講後に作成

    When I first developed with Toby, I hoped fellow developers could also experience those times. So, I suggested the idea for a roadmap called <토비의 클린 스프링>. The first lecture of that roadmap has started, making me excited! With this lecture, discuss business together, apply to development, learn, try in practice... I hope you enjoy taking it in your own way. I'll also diligently attend and gradually fill in where I'm still lacking. Anyone who wants to join~?🥰

    • tobyilee
      知識共有者

      Although this lecture was short, I prepared it while recalling the memories of developing and studying with Zin. The simple examples we created then, the architectural structures with specific purposes, methods for handling domain logic, and our good practices in writing and refactoring test code have all been reimagined into this lecture. Thank you for being a great help during all moments, from developing together in the field to planning, preparing, and releasing the lecture afterward. Although you're busy, please revisit the lecture and leave your thoughts on how it felt this time. I'll be waiting. Thank you.

  • choicore님의 프로필 이미지
    choicore

    受講レビュー 2

    平均評価 5.0

    修正済み

    5

    100% 受講後に作成

    Hearing that the lecture was released, I decided to watch it over the weekend and just finished it. It was a valuable time where I could indirectly experience the work style and know-how of Korea's Spring Commander. Although the difficulty is classified as beginner, I believe that regardless of difficulty, another developer's work style and way of thinking are not something you can easily hear just anywhere. The process of incrementally changing code while designing models, considering roles that should be held, and states required for those roles, along with occasional glimpses of humanity (typos, omissions) that were identified by test code, truly highlighted the value of test code, as these are countless situations that can occur in daily life. There's a lot of testing know-how, such as the use of Fixture, Mock (Stub), identifying what to verify, actions, and purposes, and distinctions like unit and integration testing! junit-platform.properties amazing MockMvcTester amazing Especially the section "Facts and Misconceptions of Hexagonal Architecture" was impressive. Since I only had patchy knowledge, it felt like the difficult parts were well-organized, as it clearly pointed out how founders like Eric Evans and Alistair Cockburn expounded and what essential aspects they spoke about. This lecture would be helpful for the following people: Senior developers who need to lead design Those who have studied and experienced Hexagonal Architecture projects but feel they lack deep understanding Those who want to properly learn about Domain Model Pattern, Transaction Script Pattern, and Hexagonal Architecture Those who want to know how Spring Commander develops I learned about a composition method that gained many benefits through Clean Spring and integration with Spring. Thank you. I don't develop without Spring. Spring is POJO!!!

    • tobyilee
      知識共有者

      It's Jaeyeong, always providing detailed course reviews. Beyond patterns and principles, I strove to share Spring's latest tech, and I thank you for grasping it well. I look forward to your continued growth as a great developer. Thank you.

  • arawn님의 프로필 이미지
    arawn

    受講レビュー 1

    平均評価 5.0

    5

    100% 受講後に作成

    I'm transferring the course completion review I left on LinkedIn to Inflearn as well. https://www.linkedin.com/posts/arawn_%EA%B8%B0%EB%8B%A4%EB%A6%AC%EB%8D%98-%EC%9D%B4%EC%9D%BC%EB%AF%BC%EB%8B%98%EC%9D%98-%EC%8B%9C%EB%A6%AC%EC%A6%88-%EA%B0%95%EC%9D%98-%EB%A1%9C%EB%93%9C%EB%A7%B5-%ED%86%A0%EB%B9%84%EC%9D%98-%ED%81%B4%EB%A6%B0-%EC%8A%A4%ED%94%84%EB%A7%81%EC%9D%98-%EC%B2%AB-%EC%A3%BC%EC%A0%9C%EC%9D%B8-activity-7352614457123987456-pleA?utm_source=share&utm_medium=member_desktop&rcm=ACoAABvezLwBBEWVnGUkIY_xxm2aE3-sGtVHt0g -- Lee Il-min's lecture once again did not disappoint. His characteristically thoughtful and kind explanations, as well as the way he calmly unfolds his thought process through live coding, were particularly excellent. The way he proceeds by pointing out what he's thinking and with what intention he's writing code was truly admirable. Following the lecture, I could feel an immersive experience as if I had become the instructor myself, experiencing his thought process firsthand, and through this, I naturally came to understand how to apply domain model patterns and hexagonal architecture when developing applications with Java and Spring. While the technical depth was outstanding, what particularly impressed me about this lecture was how it demonstrated the 'attitude toward technology' and 'learning methods' of a professional. First, it clearly presents the correct approach to technology learning. When explaining hexagonal architecture, the content is developed based on the original text and core arguments of Alistair Cockburn, who first proposed it. This seems like an obvious approach, but in reality, many people encounter technology through secondary or tertiary processed content rather than primary sources. While processed materials can be useful for understanding, there's also a risk that the original author's intent may be diluted or distorted. It reminded me once again that to understand the essence of technology, we should access original sources whenever possible. Second, I could truly appreciate the importance of having a thinking approach equipped with one's own logic. For example, in the "Entity vs DTO" class, he logically demonstrated his views on why using entities in the presentation layer is not problematic. As developers, when we make any technical decision, we should be able to explain the reasons with our own logic rather than relying on external authority. This is obvious but not easy to practice in reality, and Lee Il-min directly shows how to implement this obvious principle. This lecture was a valuable experience that didn't just teach technology but also conveyed the mindset and attitude that developers should have. I highly recommend it to those who want to approach development seriously.

    • tobyilee
      知識共有者

      You've summarized well what I wanted to convey through the lecture. Thank you.

  • maskunflower23707님의 프로필 이미지
    maskunflower23707

    受講レビュー 2

    平均評価 5.0

    5

    79% 受講後に作成

    In a place full of chaos and disorder, Toby said, "Let there be light," and light appeared, setting things in order. I feel like I'm seeing the definitive argument regarding the domain model pattern and hexagonal architecture, which I've been pondering deeply. Highly recommended.

    • tobyilee
      知識共有者

      Oh... I'm not a person with such great abilities. I merely tried to explain diligently, recalling my regrets when seeing those confused or not fully grasping the tech's value, based on what I'd diligently studied and confirmed. Nonetheless, I'm sure I've made mistakes too. Since many of you are offering opinions, I will learn and prepare even more, and continue to deliver in the following lectures.

  • zecongbi님의 프로필 이미지
    zecongbi

    受講レビュー 5

    平均評価 5.0

    5

    30% 受講後に作成

    Although I've only listened to half of the lecture, it was an opportunity to re-examine parts I had misunderstood while working in the field. Going forward, I will gain a lot of knowledge as I continue listening to the lectures. Thank you for the great lecture.

    • tobyilee
      知識共有者

      Hope you found much of the content useful. Thanks for the good review.

期間限定セール、あと3日日で終了

¥70

24%

¥14,283

tobyileeの他の講座

知識共有者の他の講座を見てみましょう!

似ている講座

同じ分野の他の講座を見てみましょう!