강의

멘토링

로드맵

Inflearn brand logo image
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) 143 reviews

1,789 learners

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

Reviews from Early Learners

What you will learn!

  • 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

13,567

Learners

736

Reviews

341

Answers

5.0

Rating

7

Courses

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

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

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

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

 

 

Curriculum

All

43 lectures ∙ (14hr 31min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

All

143 reviews

5.0

143 reviews

  • Zin님의 프로필 이미지
    Zin

    Reviews 2

    Average Rating 5.0

    5

    29% enrolled

    처음 토비님과 개발을 함께 했을 때, 그 시간들을 동료 개발자 분들도 함께 경험해봤으면 했습니다. 그래서 <토비의 클린 스프링> 이라는 로드맵에 대한 아이디어를 드렸어요. 그 로드맵의 첫 강의가 시작되어서 설레네요! 본 강의로 비즈니스를 함께 고민하고, 개발에 적용하고, 배우고, 실무에 써보고.. 각자의 방식으로 재미있게 수강하셨으면 좋겠습니다. 저 또한 열심히 수강하며 아직 부족한 부분들을 차근차근 채워나가 보겠습니다. 함께하실 분~?🥰

    • 토비
      Instructor

      이번 강의는 짧은 시간이었지만 Zin 님과 함께 개발하고 공부했던 기억을 떠올리면서 준비했습니다. 그때 만들었던 간단한 예제와 목적을 가진 아키텍처 구조와 도메인 로직을 다루는 방법, 테스트 코드를 잘 작성하고 리팩터링을 했던 것들이 강의로 다시 만들어졌습니다. 현장에서 함께 개발할 때도, 또 이후에 강의를 기획하고 준비하고 공개하는 모든 순간에 많은 도움이 되어주셔서 감사합니다. 바쁘시지만 강의를 다시 살펴보시고 이번엔 어떤 느낌이었는지도 꼭 남겨주세요. 기다리겠습니다. 감사합니다.

  • 최재형님의 프로필 이미지
    최재형

    Reviews 2

    Average Rating 5.0

    Edited

    5

    100% enrolled

    강의가 출시되었다는 소식을 듣고 주말에 봐야겠다 다짐하고 방금 완강했습니다. 대한민국 스프링 대장의 업무 스타일과 노하우를 간접 체험할 수 있는 소중한 시간이었습니다. 난이도가 초급으로 분류되어 있지만, 난이도를 떠나 다른 개발자의 업무 스타일과 사고방식은 아무데서나 쉽게 들을 수 있는 것이 아니라고 생각합니다. 모델을 설계하며, 가져야하는 역할, 역할을 위해 필요로하는 상태 등 점진적으로 코드를 바꿔나가는 과정과, 간간히 인간미(오타, 누락)를 보여주시는데 테스트 코드로 식별해내는 정말 수도 없이 일상에서 발생할 수 있는 부분들이 테스트 코드의 가치를 더 보여준다 느꼈습니다. Fixture, Mock(Stub) 등의 활용, 검증해야할 대상, 행위, 목적 식별 등 단위, 통합 등의 구분이라던지, 테스트에 대한 노하우가 많이 있습니다.! junit-platform.properties 대박 MockMvcTester 대박 특히 "헥사고날 아키텍처의 사실과 오해" 섹션이 인상깊었습니다. 뜨문뜨문 알고있었던지라 에릭 에반스와 알리스타 코번 등 창시자가 어떻게 설파했는지, 말했었던 본질적인 부분을 잘 짚어주셔서 어렵게 느껴지는 부분들을 잘 정리해주신 것 같습니다. 이 강의는 다음 분들께 도움이 될 것 같습니다 설계를 주도해야 하는 시니어 개발자분들 헥사고날 아키텍처 프로젝트를 공부하고 경험했지만 깊은 이해가 부족하다고 느끼시는 분들 도메인 모델 패턴, 트랜잭션 스크립트 패턴, 헥사고날 아키텍처에 대해 제대로 배워보고 싶은분 스프링 대장은 어떻게 개발하는지 알고 싶은분 클린 스프링, 스프링과의 통합으로 많은 이득을 취한 구성 방식에 대해 배우게 되었습니다. 감사합니다. 스프링 없인 개발 안합니다. 스프링은 POJO 다!!!

    • 토비
      Instructor

      언제나 상세한 수강평을 남겨주시는 재형 님이군요. 패턴과 원칙 뿐만 아니라, 지금 시점의 스프링의 최신 기술도 사이사이 알려드리려고 노력했는데 그걸 잘 캐치해주셔서 감사합니다. 계속 좋은 개발자로 성장하시기를 기대합니다. 감사합니다.

  • 삼류진사님의 프로필 이미지
    삼류진사

    Reviews 1

    Average Rating 5.0

    5

    100% enrolled

    링크드인에 남겼던 완강 소감을 인프런에도 옮겨둡니다. 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 -- 이일민님의 강의는 이번에도 기대를 저버리지 않았습니다. 특유의 사려 깊고 친절한 설명은 물론, 라이브 코딩을 통해 사고의 흐름을 차분하게 풀어가는 방식이 특히 좋았습니다. 지금 어떤 생각을 하고 있는지, 어떤 의도로 코드를 작성하고 있는지를 조목조목 짚어주며 진행하는 모습은 감탄을 자아낼 정도였습니다. 강의를 따라가다 보면 마치 강사 본인이 되어 사고 과정을 그대로 체험하는 듯한 몰입감을 느낄 수 있었고, 이를 통해 자바와 스프링으로 애플리케이션을 개발할 때 도메인 모델 패턴과 헥사고날 아키텍처를 어떻게 적용할 수 있는지 자연스럽게 이해하게 됩니다. 기술적인 깊이도 뛰어났지만, 이번 강의에서 특히 인상 깊었던 점은 전문가로서 '기술을 대하는 태도'와 '학습 방법'을 몸소 보여준다는 점이었습니다. 첫째, 기술 학습에 대한 올바른 접근 방식을 명확하게 제시합니다. 헥사고날 아키텍처를 설명할 때는 이를 처음 제안한 앨리스터 코번의 원문과 핵심 주장을 기반으로 내용을 전개합니다. 이는 너무나 당연한 방식처럼 보이지만, 실제로 많은 이들이 1차 자료가 아닌 2차, 3차로 가공된 콘텐츠를 통해 기술을 접합니다. 가공된 자료는 이해를 돕는 데 유용할 수 있지만, 원저자의 의도가 희석되거나 왜곡될 위험도 존재합니다. 기술의 본질을 이해하려면 가능하면 원천 자료에 접근해야 한다는 점을 다시 한번 되새기게 했습니다. 둘째, 자신만의 논리를 갖춘 사고방식의 중요성을 실감할 수 있었습니다. 예를 들어 "Entity vs DTO" 수업에서는 프레젠테이션 계층에서 엔티티를 사용하는 것이 왜 문제가 되지 않는지에 대해 자신의 견해를 하나하나 논리적으로 증명해보여 주셨습니다. 개발자라면 어떤 기술적 결정을 내렸을 때, 그 이유를 외부 권위에 의존하지 않고 스스로의 논리로 설명할 수 있어야 합니다. 이는 당연하지만 실제로 실천하기는 쉽지 않은 부분인데, 이일민님은 그 당연한 것을 어떻게 구현할 수 있는지 직접 보여줍니다. 이 강의는 단순히 기술을 가르치는 데 그치지 않고, 개발자로서 갖춰야 할 사고방식과 태도까지 함께 전달하는 값진 경험이었습니다. 진지하게 개발을 대하고자 하는 분들께 적극 추천드립니다.

    • 토비
      Instructor

      강의를 통해서 전달하고 싶었던 것을 잘 정리해주셨네요. 감사합니다.

  • MASKUN님의 프로필 이미지
    MASKUN

    Reviews 2

    Average Rating 5.0

    5

    79% enrolled

    혼돈과 무질서가 가득한 곳에서 토비님이 빛이 있으리라 했더니 빛이 나타나 질서를 바로 잡았다. 제가 많은 고민을 해오고 있던 도메인 모델 패턴과 헥사고날 아키텍쳐에 대한 정론을 보고 있는 기분입니다. 추천드립니다.

    • 토비
      Instructor

      헉.. 제가 그런 대단한 능력을 가진 사람은 아닙니다. 다만 열심히 공부하고 확인했던 것들을 조금 혼란을 겪으시거나, 기술의 가치를 잘 얻지 못하시는 분들을 볼 때 안타까웠던 것들을 기억하면서 열심히 설명해보려고 노력했습니다. 그럼에도 저도 틀린 것도 있을 겁니다. 여러 분들이 의견을 주고 계시니 저도 더 배우고 준비해서 이어지는 강의에서 계속 전달해드릴게요.

  • zecongbi님의 프로필 이미지
    zecongbi

    Reviews 5

    Average Rating 5.0

    5

    30% enrolled

    아직 강의를 절반밖에 듣지 않았지만, 현업에서 일하며 잘못 알고 있던 부분들을 되짚어 보는 기회였습니다. 앞으로도 강의 이어서 들으면서 많은 지식 얻어가겠습니다. 좋은 강의 감사합니다.

    • 토비
      Instructor

      도움이 되는 내용이 많이 있었기를 기대해봅니다. 좋은 평가 남겨주셔서 감사합니다.

Limited time deal ends in 4 days

$90,750.00

25%

$93.50

tobyilee's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!