Domain-Driven Refactoring - Jimmy Bogard - NDC London 2022

  Рет қаралды 47,484

NDC Conferences

NDC Conferences

Күн бұрын

Пікірлер: 58
@r0shav
@r0shav 2 жыл бұрын
This was so good that it made me want to go back to work :D
@kevinlloyd9507
@kevinlloyd9507 6 ай бұрын
Love this talk. I rewatch it at least once a year!
@Erril_Ferndal
@Erril_Ferndal 2 жыл бұрын
Amazing talk!! Every Developer should see this!
@NotARealPerson12345
@NotARealPerson12345 2 жыл бұрын
I think the Calculator can be moved to application layer. In my mind, a clean domain model interface should not have dependencies outside domain model. The domain model could require a calculated offer value to be passed to it, which can be provided by higher level logic. You could argue that both application layer and domain layer are just DOMAIN layer though. In the end, the whole DDD (not in microservice world, just talking about a single project here) is just about proper OO programming, which should be the way to go in the first place.
@wokker2
@wokker2 2 жыл бұрын
Learned some new Rider/Resharper tricks :)
@montassarkefi4064
@montassarkefi4064 Жыл бұрын
Thank you for your explanation, great to hear
@Dimestel
@Dimestel Жыл бұрын
Amazing example how to cook it!
@marna_li
@marna_li 2 жыл бұрын
This is such a great talk in all its iterations! A couple of months ago, I was working on a project in which I wanted to put some domain logic with its Domain Object. In my scenario it was about a "Document" being signed. So I come up with creating a SigningService and pass in into the Document.Sign(signingService, signer). At first I felt uncomfortable, but the more I looked at it the more it made sense in OOP. Semantically: the Document is being signed by a Signer using a specified SigningService.
@Weexow
@Weexow 2 жыл бұрын
Wouldn’t that be signer.Sign(document, service)
@marna_li
@marna_li 2 жыл бұрын
@@Weexow Good point! I guess that it depends on how you view it. What is the center of your model. But I would consider your solution if there were a Person/User concept. Because the Person signs the Document using the SigningService.
@NaaneVinu
@NaaneVinu 2 жыл бұрын
​@@marna_li I feel that, in that sense still it could have been like, the service/class that is responsible to create the document, uses the signing Service to sign the document the document.
@mahdimollaeian8840
@mahdimollaeian8840 2 жыл бұрын
where can i download project source code?
@vin2629
@vin2629 2 жыл бұрын
This is awesome. The way he explains is so clear. I think we can design our domain classes in our own way as long as its properly encapsulated and follows the single responsibility principle in SOLID.
@LDdrums20
@LDdrums20 2 жыл бұрын
That was awesome!
@botyironcastle
@botyironcastle 7 ай бұрын
what if you have huge data like 100000000comments in Post object. I don't think you can init a domain object with that much... looks useless to me when dealing with large chunks of data. Thoughts?
@ahmedameen2
@ahmedameen2 4 ай бұрын
Who's using vs white theme nowadays?
@aaronmcadam
@aaronmcadam 2 жыл бұрын
I really enjoyed this talk, but how do we stop domain models getting too big if we should try to move behaviour to them?
@aaronmcadam
@aaronmcadam 2 жыл бұрын
How can we avoid God Classes if we want to avoid anaemic domain models?
@ioanadobos2840
@ioanadobos2840 2 жыл бұрын
@@aaronmcadam maybe value objects and constant reiteration over the model I'm guessing... also when a model gets too big it's a sign it does too much and maybe we should think about spliting it. If anyone thinks about something extra I'm really curious too about other solutions
@aaronmcadam
@aaronmcadam 2 жыл бұрын
@@ioanadobos2840 yeah I think delegating to other classes might help keep the complexity down, but it’s still tricky to balance these things 😅
@finch9668
@finch9668 2 жыл бұрын
Amazing!
@krccmsitp2884
@krccmsitp2884 2 жыл бұрын
Simply great and inspiring!
@iorch82
@iorch82 Жыл бұрын
For the average developer DDD is just a glorified set of basic OOP principles that got lost along the way because of the service layer pattern getting wild in the 00's. The other part, contex mapping, bounded contexts, etc is mostly work for very expensive western consultants that rarely gets into production systems. There is a huge industry and cargo cult around that three letter word and the machine should not be stopped
10 ай бұрын
What do you do to organize microservices and modular monoliths if not in Bounded Contexts?
@ZdobywcaTitanQuestIT
@ZdobywcaTitanQuestIT 2 ай бұрын
call it however you want, but the idea of separating concerns and modularization of components (whether they are microservices/classes/packages/apps/scripts/...) has been around forever
@arthurchia2828
@arthurchia2828 3 ай бұрын
Interesting, good talk. Got another reason not liking global usings 😂
@osten_petersson
@osten_petersson 2 жыл бұрын
zebras are closer related to donkeys actually :)
@ChrisAthanas
@ChrisAthanas Жыл бұрын
This is still all imperative and will always be brittle and hard to maintain I Like Yegor Bugayenko approach to true AK OOP style
@khanfaizan05
@khanfaizan05 7 ай бұрын
I don't know.. keep it simple. He over complicated things
@TristanBailey
@TristanBailey Жыл бұрын
Horrible refactor for the sake of possible, it was only about 20lines and could be understood. Now it’s all abstract and pulled in multiple locations. The ideas he seemed to want to convey could be good. There was no justification apart from a small % to be in own objects as there was no redundancy or over complexity that was improved. And didn’t add any tests to prove at least more testable. Just did 10 more steps than needed and could have had better example.
10 ай бұрын
Would love to see you doing an hour-long live demo covering all these topics on a non-contrived, fully-tested codebase
@maciejmeissner2574
@maciejmeissner2574 3 ай бұрын
It’s just 20 line of code. But what he have done is to move the Domain logic code to the right places. To the domain layer. Why should be the code in an application layer. Should the the application layer should all know the domain things? When should we refactor code? After 21 lines of code, or 244 lines? The amount of lines isn’t really a good indicator.
@tehklevster
@tehklevster 2 жыл бұрын
This is the worst example of code refactoring I've ever seen. Don't think about this unless you have a concern about re-use. Sorry Jimmy.
@ChrisAthanas
@ChrisAthanas Жыл бұрын
Accurate Imperative code masquerading as OOP is inherently unsustainable and un-maintainable mess I prefer Yegor Bugayenko approach
@TristanBailey
@TristanBailey Жыл бұрын
Exactly. And never even ran the code or tests to prove any of this helped and didn’t break the use of the methods!
@nickbarton3191
@nickbarton3191 Жыл бұрын
​​@@ChrisAthanasQuite ! I'm following Zoran Horvat, rich domain models. I'd like to find an example of turning imperative legacy code into a rich domain model, stepwise not to break stuff.
@cd1131
@cd1131 Жыл бұрын
Strongly disagree. This helps big time to correctly represent the business domain and avoid unmaintainable spaghetti code. It produces very comprehensible unit tests making it easy to get the logic right. Always consider this unless you are working on hello world projects or just CRUD API’s.
@bayobizzle
@bayobizzle 9 ай бұрын
​@@ChrisAthanasany link to the Bugayenko approach you mentioned?
@deyanvp
@deyanvp 2 жыл бұрын
I would have gotten excited about this talk ... 20 years ago ... My recommendation to current/new generation developers: - switch to microservices, focus more on the API/contract than internals (and of course avoid sync calls between microservices, try to do as much as possible event-driven etc etc). Consider seriously how to create behavior/capability-focused microservices vs. entity/technical ones (to avoid sync calls as much as possible - no, 100% is not possible) - switch to immutable data (go functional) separate from logic (forget anemic domain model). And yes, most if not all of the time when you feel it does not feel natural that an entity does something to itself (e.g expires, signs itself), it is really not natural ;) - keep domain logic well structured and making sure that every function is returning a valid (invariants enforced!) aggregate root - domain model has no dependency on anything, also not on service interfaces. Forget about double (saw in the code even triple-dispatch with XxxType.CalcuteXxx) - this does not make your code simpler To add (based on some of the questions below): - use NoSQL db with 1:1 aggregate root : document mapping (no ORM!, no need for db transactions) for the Write model - use columnstore index database for the Read model (much faster for complicated queries, you can still use the Write model for simple "get by id" queries) - to be able to scale differently and have different SLAs: technically seggregate your microservices inside a bounded context as per technical aspects/similar to CQRS, e.g. IdentityVerification-QueryHandling IdentityVerification-CommandHandling IdentityVerification-EventHandling (sub interservice events) IdentityVerification-EventPublishing (pub interservice events) IdentityVerification-ChangeHandling (includes Auditing) and even IdentityVerification-ExternalEventPublishing (for webhooks)
@arunnair7584
@arunnair7584 2 жыл бұрын
I found microservices drastically reduces the app's performance (when used with kafka). Also unless you have multiple teams working in multiple languages, do you see any significant benefits?
@namewastaken360
@namewastaken360 2 жыл бұрын
A very good talk that ties together a lot of these ideas is Scott Havens talk at DOES19. Here's a recording kzbin.info/www/bejne/fKTOepVviMaln6s
@RealMathewAdams
@RealMathewAdams 2 жыл бұрын
@@arunnair7584 No, the team structure is one that is the deciding factor of when to use microservices. It solves a problem of developer velocity (delivery) among very large and coordinated teams. People prescribe microservices and gloss over the many, many, problems they introduce.
@deyanvp
@deyanvp 2 жыл бұрын
​@@RealMathewAdams I beg to differ. In my context every individual developer can develop a microservice by himself (and every deveper owns more than 1 microservice for sure). And even if I was developing the whole solution by myself, I would still go for microservices, as the possibility of deploying small pieces of the whole is an extremely precious capability when it comes to CD and deploying small changes all the time. Note that my recommendation is not only to split your solution into services, but also to split every service into microservices as per CQRS, which I have briefly touched upon at the end of this article: dev.to/deyanp/tbd-current-state-last-event-as-an-alternative-to-event-sourcing-5gm5. But of course, for microservice architecture one has to learn new tricks (already mentioned sync calls vs. event-driven), which are not necessarily what was taught in the past 20 years ...
@arunnair7584
@arunnair7584 2 жыл бұрын
@@deyanvp Do you implement transactions across microservices?
@mahdimollaeian8840
@mahdimollaeian8840 2 жыл бұрын
That was awesome!
Domain Driven Design: The Good Parts - Jimmy Bogard
58:39
NDC Conferences
Рет қаралды 221 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Domain-Driven Refactoring - Jimmy Bogard - NDC Porto 2022
1:01:29
NDC Conferences
Рет қаралды 20 М.
Domain-Driven Refactoring - Jimmy Bogard - NDC Oslo 2020
1:02:24
NDC Conferences
Рет қаралды 56 М.
DDD By Example - Paul Rayner - DDD Europe 2020
54:58
Domain-Driven Design Europe
Рет қаралды 52 М.
Back to Basics: Efficient Async and Await - Filip Ekberg - NDC London 2022
1:01:59
Don’t Build a Distributed Monolith - Jonathan "J." Tower - NDC London 2023
1:04:02
How To Use Domain-Driven Design In Clean Architecture
30:27
Milan Jovanović
Рет қаралды 113 М.
Goodbye controllers, hello Minimal APIs - Nick Chapsas - NDC London 2022
52:02
Introduction to Context Mapping - Michael Plöd - DDD Europe 2022
59:15
Domain-Driven Design Europe
Рет қаралды 23 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН