Clean Architecture with Spring Boot and Java | Geekific

preview_player
Показать описание

In the previous videos of this series, we started by creating our first SpringBoot project and mentioned that if we’re developing a long-term application, our environment might change. Clean Architecture by Uncle Bob defines a set of guidelines that combines many code designs and principles which lead to a maintainable and testable code that takes into consideration all the uncertainties surrounding our project. In this video, we bring back that SpringBoot project and attempt to apply these guidelines on it.

Timestamps:
00:00 Introduction
00:07 SpringBoot and DDD Reminder
01:57 JPA and Domain Entities
03:07 Repositories, Services, Mappers and Controllers
04:30 Put Everything Together
05:48 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #SpringBoot #CleanArchitecture #DDD #Java
Рекомендации по теме
Комментарии
Автор

My education left so many gaps in my knowledge, and every little bit helps. I appreciate your videos and your hard work so much

UninspiredFilm
Автор

I have learned a lot with your design pattern videos..please do a series on clean architecture if possible..it will be very helpful..

srinivaschaitanya
Автор

Great video! Could you please share the repo link that has the structure shown in the video?

AsherEveren
Автор

why didn't you use modules instead of packages?

tquery
Автор

Great video! Could you please share the repo that has the structure shown in the video?

AsherEveren
Автор

What is the name of the project playlist ?

amr
Автор

can i use different modules for this 3 'layers' - api, core, infrastructure - so i can 100% separate them from each other and choose bonds that i need? Where should be the main class then? In the top(over these three) module?

OJIeLLlka
Автор

I have a question regarding the models. You said that we should have separate domain model "Video" decoupled from the persistence model "VideoEntity".
The domain model should be like the persistence model minus some fields which rises the following question:
What do we do when one entity(persistence model) depends on another. Lets say that we introduce CommentEntity(persistence model) that depends on the VideoEntity.

public class CommentEntity { private VideoEntity vedio; //getters, setters, etc.. }.

Now in our CommentServcie when we want to create new comment we would need the reference to the video that the comment is related to. But how do we resolve this issue.

// 1. Pass the id of the video then in the CommentService make a query to to VideoRepository/VideoService
Comment createComment(long videoId, String commentText);

// 2.Pass the VideoEntity directly
Comment createComment(VideoEntity video, String commentText);

// 3. Pass the Video`s domain model then map then map it in the CommentService.
// This approach is highly recomended however you said that domain model and persistence model are not one-to-one copies. I mean if the Video does not have all the fields
// like the VideoEntity then when the CommentService tries to map the domain model back to persistence model there will be data loss.
Comment createComment(Video video, String commentText);


So my main point is when a model depends on another model how should we resolve the dependency?
For a "CommentEnntity" to be created it must have a reference to existing "VideoEntity". As far as i see it there are only 3 possible solutions.
1. Inject VideoEntity directly
2. Create one-to-one copy of the VideoEntity that has all the fields like the VideoEntity and use it as DTO to transfer the data.
3. Passing only the ID of the video then the CommentService would either use a service or repository to fetch the VideoEntity.

Please if someone could answer the question i would be very happy.

ИвелинъСтояновъ
Автор

Please make a video on ML/AI libraries in Java. Everyone is going on Python for this but Java has such huge potential that is not being directed and taught!

Terracotta-warriors_Sea
Автор

Why we are not making multi - module layers for each presentation, domain and infra layer.

PraveenKumar-bsff
Автор

Hi, I did not find this project in GitHub repo :(

mertcakmak