강의

멘토링

커뮤니티

BEST
Programming

/

Back-end

Toby's Clean Spring - Domain Model Pattern and Hexagonal Architecture Part 1

This is the first lecture of Clean Spring, a lecture series designed to allow a hypothetical startup development team to experience, in a manner similar to actual work processes, the process of developing quickly, stably, flexibly, and with good maintainability by incrementally following Clean Code and Spring development principles. By utilizing Domain Model Pattern and Hexagonal Architecture, you can acquire necessary skills and development strategies in the domain-centric initial development phase.

(5.0) 238 reviews

2,122 learners

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

Reviews from Early Learners

What you will gain after the course

  • Domain model-centric design and development strategy

  • Various Patterns and Practices of Domain-Driven Design (DDD)

  • Characteristics and Effects of Hexagonal Architecture, and Easy and Simple Ways to Apply It

  • Various Test Techniques and Architecture Test Tool Usage

  • AI-driven clean domain modeling for JPA entities

  • Latest Spring Web Exception Handling Techniques and Test Tool Usage

  • Module Composition using Aggregate

Become a team with Toby
Complete the spring service.

<Toby's Clean Spring> is a course where you can experience the entire process, from planning to design, implementation, and refactoring, as if it were real-life, while developing the virtual online education service 'Splearn'.

You will team up with Toby and work together to complete a single service . From planning to implementation and refactoring , you'll work with Toby to realistically consider what needs to be considered and what decisions need to be made at each stage. Through this process, you'll develop the ability to understand the context of "when and why" a technology is needed and "why a particular architecture was designed."

Toby's Clean Spring Roadmap
This series of lectures will teach you clean code and Spring development principles. It covers the growth process of Spring applications, from domain modeling to MSA and observability, in seven courses. ( See the roadmap >>)

336073_1

Choices for Sustainable Code
Clean Spring

Clean Spring is a practical strategy that applies the principles of "clean code" to Spring development . Its goal goes beyond simply creating visually appealing code, but also improves team productivity and long-term code quality. Kent Beck's phrase, "Clean Code That Works," exemplifies this core philosophy.

Maintainability and productivity are mutually reinforcing. Code that's easy to change facilitates maintenance, and rapid changes also increase productivity. Refactoring is essential to achieving this structure, and test code is a prerequisite.

This lecture will walk you through the process of refactoring and writing tests repeatedly as you add features or restructure your code.

These practices are what we call the Clean Spring strategy , and they will empower you to think in a way that creates code that is resilient to change.

(You can watch the detailed story about Clean Spring in the Infocon 2024 presentation video. 👉 )

Toby's Clean Spring Series, the first

Domain model and
Hexagonal architecture

Clean Spring development begins with a deep understanding of the problem (domain) the service is trying to solve. This understanding is then reflected in the code, and the core strategies for designing for stable development even as functionality expands are the domain model pattern and hexagonal architecture.

This course will explore the practical application of domain models and hexagonal architectures, leveraging the latest Spring, web, and JPA technologies . We'll also address key early-stage challenges, such as project structure, module separation, collaboration methods, and testing strategies. Through this process, you'll experience the process of refactoring and evolving a domain model .

<Domain Model and Hexagonal Architecture> consists of two lectures, Part 1 and Part 2.

Part 1. Focusing on member functions, we'll build a domain model and architecture framework, and practice core logic design, structuring, and test code-based development. *This course

Part 2. Redesign models to address complex requirements, applying in-depth design, various refactoring techniques, and test support tools required for practical use.

Domain Model and Hexagonal Architecture Part 1.

Learning Content

Development strategy centered on the domain model

To accurately reflect the concepts and relationships within a domain, an abstract domain model is required. Domain-Driven Design (DDD) is an approach that effectively solves complex problems by collaborating with domain experts and the development team to establish and evolve the model.

In this course, we'll apply the core principles and patterns of DDD to real-world service development, even in less complex domains. We'll also learn how to seamlessly integrate domain models into code and evolve them through continuous integration.

How to Write a Domain Model Document for Communication

For domain model-driven development to be effective, all development team members must be able to create and communicate models with domain experts.

To achieve this, it is important to consistently use a single vocabulary, or ubiquitous language, across all communications, including documents, code, and meetings.

In this lecture, we'll introduce how to document this universal language and domain model in a project as a Markdown document, and we'll also explore how the model evolves as code changes.

Facts and Misconceptions about Hexagonal Architecture

Hexagonal architecture is often misunderstood, but developers who follow Spring's core principles may already be reaping some of its value.

In this lecture, you will explore the core concepts of hexagonal architecture, its hierarchy, and how to structure interfaces, and learn how to effectively leverage the benefits it offers.

By following simple principles, you can focus on your domain logic, and in particular, you will practice and apply how to structure environment-independent tests.

Applying inter-layer dependency rules

Applying the hexagonal architecture and the domain model pattern together creates a highly cohesive and maintainable structure. However, to fully leverage this structure, you must adhere to the dependency rules of a hierarchical architecture.

This lecture delves into the often overlooked aspects of hierarchical design, focusing on how to arrange functions and structure code according to the responsibilities of each layer.

Modular structure design using aggregates

Aggregate, introduced in domain-driven design, helps maintain consistency of changes by designing the unit of data change.

We'll explore how to discover and handle invariants that must be satisfied within an aggregate, how to use aggregate roots, and how to use the repository pattern in Spring Data projects that support it, all while applying the aggregate pattern.

We also explain how to use aggregate and hexagonal architectures together to construct detailed modules.

Create clean domain objects with JPA entities

We will examine the features and purpose of JPA technology and introduce how to use JPA entities as a technology to effectively create domain objects.

We also present a standard approach to addressing the problem of excessive JPA annotations intermingling with domain logic, utilizing AI technology.

We also discuss a special case where JPA entities are used separately from the domain.

Architecture testing, code verification, and test strategies

We create test code to verify that the functions provided to external parties in the written application code are correctly written. We also apply code verification methods utilizing static analysis tools, which are difficult to verify directly through tests but can potentially cause problems in production environments. We also learn how to improve code stability and consistency.

Recommended for
these people

Who is this course right for?

  • For those who want to know how practical development using Spring technology, which utilizes web and DB, proceeds.

  • Seeking highly maintainable and productive system development through Clean Code principles.

  • Junior developer who wants to grow into a mid-level or higher developer leading service development

  • A senior developer who wants to lead new and junior developers starting work with great expectations, having learned the latest architectures and development techniques.

Need to know before starting?

  • Java language

  • Understanding Spring's Fundamentals

  • Spring application development experience using Web API and JPA

Hello
This is

15,489

Learners

962

Reviews

410

Answers

5.0

Rating

8

Courses

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

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

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

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

 

 

Curriculum

All

43 lectures ∙ (14hr 31min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

All

238 reviews

5.0

238 reviews

  • zin님의 프로필 이미지
    zin

    Reviews 2

    Average Rating 5.0

    5

    29% enrolled

    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
      Instructor

      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

    Reviews 2

    Average Rating 5.0

    Edited

    5

    100% enrolled

    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
      Instructor

      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

    Reviews 1

    Average Rating 5.0

    5

    100% enrolled

    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
      Instructor

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

  • maskunflower23707님의 프로필 이미지
    maskunflower23707

    Reviews 2

    Average Rating 5.0

    5

    79% enrolled

    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
      Instructor

      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.

  • sooragenius6352님의 프로필 이미지
    sooragenius6352

    Reviews 3

    Average Rating 5.0

    5

    98% enrolled

    I wanted to watch the course right away after purchasing it and write a review quickly, but time has passed and I'm only now leaving my feedback. Tears.. 😢 Once again, I could feel that the saying "Toby's lectures you can trust and listen to" didn't come about for nothing!!! Recently, many developers have shown increased interest in hexagonal architecture, and various discussions are taking place. However, it seems that misconceptions about the concept are also growing. But in this course, to clear up such misunderstandings, you carefully went through the definition of architecture from the beginning and logically explained why such structures are necessary, which was very impressive. Especially, it wasn't just limited to theory, but you explained it with actual examples, which made it much easier to understand. Also, many people have questions and sometimes feel confused about JPA annotations like @Entity and @Column invading domain models. What was really great about this course was that you shared deep thoughts on that part and presented realistic solutions. The way you faced the concerns frequently encountered in practice head-on and addressed them one by one, along with explaining appropriate trade-offs, was impressive! It was the best. And when developing, complexity gradually increases, and often we end up losing track of the flow of the systems we created ourselves. But in the course, you systematically showed how to handle such complexity and how important the process of organizing complexity is, and the approach of continuing development based on that was really impressive. These parts contained practical content that's hard to see in other courses. The immersion was so high that it felt like being on the same team as Toby and working on an actual project together. And what I liked most was the flow of gradually improving while thinking together without hastily presenting answers. This approach was so similar to real development environments that I could naturally learn not just receiving knowledge, but what perspective to view problems from in practice. It was a really enjoyable course experience. While watching the course, those days when I developed in the past flashed by, generating dopamine, and I missed those times. I really want to look forward to the next course! It was really so so so so fun! Thank you so much for providing such a precious course!

    $93.50

    tobyilee's other courses

    Check out other courses by the instructor!

    Similar courses

    Explore other courses in the same field!