Learn how Spring Boot Model Mapper works Fast and Simple

  Рет қаралды 23,522

Fast and Simple Development

Fast and Simple Development

Жыл бұрын

Spring Boot allows you to create Entities that reflect your business model and database, external to your service logic you should not expose those unique properties. In the case of transferring information out to an API for example you should map the contents to a DTO (Data Transfer Object) that may not be exactly what your business entity shape looks like. For example elements like passwords should be excluded and computed properties may not be part of your entities but can be part of your DTO objects.
Learn how to use Mappers in Spring Boot and isolate and add a loosely coupled interfaces that does not break as code changes.
More can be found on my Udemy classes: www.udemy.com/user/tomjay2
Find this and more on my GitHub: github.com/ThomasJay
As well as my Web site: www.thomasjayconsulting.com
I want to help you learn and find an Amazing Job or just increase your Skills.
#Java #SpringBoot #software

Пікірлер: 27
@moisesvillalba6615
@moisesvillalba6615 23 күн бұрын
Thanks so much for the great explanation! Greetings from Paraguay, South America
@edsonjr.1381
@edsonjr.1381 Жыл бұрын
It’s amazing how easly you create these tutorials and I’m really enjoying and helping me out a lot. Please keep creating more videos like this.
@fatihdeniz3702
@fatihdeniz3702 Жыл бұрын
Great Job. Simple and usefull. Thanks
@johndoedoejohn
@johndoedoejohn Жыл бұрын
Great video, would love to see more materials on Spring. Personally using mapstruct mapper, quite easy to use and seems to have less boilerplate code. Thank you for this video
@NeverQuitOk
@NeverQuitOk 3 ай бұрын
What Xavier. Why are you here
@shahd07072
@shahd07072 6 ай бұрын
That was very good, tank you.
@namminh4336
@namminh4336 4 ай бұрын
Great lesson
@naushad30
@naushad30 7 ай бұрын
Great content
@user-ql1rg9mj9d
@user-ql1rg9mj9d Жыл бұрын
Is the reason you created the mapperconfig(modelmapper) to do it as a singleton?
@fastandsimpledevelopment
@fastandsimpledevelopment Жыл бұрын
Yes, Sprint Beans are Singletons by default so no overhead in creating each mapper objects at runtime after the initial bean creation
@user-ql1rg9mj9d
@user-ql1rg9mj9d Жыл бұрын
@@fastandsimpledevelopment thank you
@Wafacooking1
@Wafacooking1 Жыл бұрын
Hey
@duongphuba7216
@duongphuba7216 Жыл бұрын
Omg, why do not you use record UserDto, bro?
@fastandsimpledevelopment
@fastandsimpledevelopment Жыл бұрын
This is based on Java 8, records where introduced in Java 14. Java 8 is still used by 99% of the companies I work with.
@gasparcalix2095
@gasparcalix2095 Жыл бұрын
most of the companys are using java8 to java11.
@fastandsimpledevelopment
@fastandsimpledevelopment Жыл бұрын
@@gasparcalix2095 You can not move from Java 8 to anything else and get Oracle support without paying, Banks and Insurance companies do not want to pay for Java. Open JDK does not pass security standards yet. Same issue with Spring Boot 3, you really need a newer version of Java but no one is making the commitment yet and changing out of older dependencies is hard. We still have more years of Java 8 - End of Life March 2025!
@gasparcalix2095
@gasparcalix2095 Жыл бұрын
@@fastandsimpledevelopment and I totally agree!
@duongphuba7216
@duongphuba7216 Жыл бұрын
@@fastandsimpledevelopment fair enough!! thank you for the feedback, may be you should mention different option to do it with later version java :)
@alexhu01
@alexhu01 Жыл бұрын
some advice: I have to spend 18/20 minutes to watch you typing all basic spring stuff, and only 2 minutes to talk about modelmapper, which is also very basic.. I'd rather see you go deeper with this library and instead of watching your typing, just put those controller, service files there already and explain them instead..
@dezee2412
@dezee2412 11 ай бұрын
yes too slow to get focused on ModelMapper
@mit-zwiebel
@mit-zwiebel Жыл бұрын
Converter between User and UserDTO should do Controller layer, not Service layer :)
@MaxxAF
@MaxxAF Жыл бұрын
why should the convert be done in the Controller layer, not Service layer? I'm learning about and I don't know what the best practice is.
@fastandsimpledevelopment
@fastandsimpledevelopment Жыл бұрын
I think it is a bit of religion, I like it in the service so all the business type logic is 100% isolated from the Controller and any other part of the application that needs the processing can call it in the Service. If your creating Lambdas you may not have a Rest Controller but still need the Converter / Mapper logic to be used
@gasparcalix2095
@gasparcalix2095 Жыл бұрын
no! the contoller must be the simplest as possible
@youssefbouchara1179
@youssefbouchara1179 Жыл бұрын
nop, any logic should be out of the controller! The controller is only there to return a response back.
@johndoedoejohn
@johndoedoejohn Жыл бұрын
Controller layer needs to get the data and pass it to another layer without any logic involved.
@cesarbranco1889
@cesarbranco1889 Жыл бұрын
That's work just great. Thank you! Im wondering if you can go deep inside modelMapper and do relationships like @OneToMany, @ManyToMany. Im having some errors using model mapper with relationships. :(
SpringBoot Access Log filter for REST API calls
16:43
Fast and Simple Development
Рет қаралды 1,3 М.
Use DTO instead of Model and Entity objects
8:11
Java Master
Рет қаралды 21 М.
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 113 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 114 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 39 МЛН
Spring Annotations for Experienced Developers #springboot #java
10:51
the right way to organise your code
17:33
Amigoscode
Рет қаралды 195 М.
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 145 М.
Spring Boot Validation
11:58
Fast and Simple Development
Рет қаралды 18 М.
Front End System Design Fundamentals (All In One Comprehensive Guide)
37:50
📱магазин техники в 2014 vs 2024
0:41
djetics
Рет қаралды 520 М.
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,3 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 1,2 МЛН
Частая ошибка геймеров? 😐 Dareu A710X
1:00
Вэйми
Рет қаралды 4,6 МЛН