Learn more at Brilliant brilliant.org/ZoranHorvat/ This link gives you a 30-day free trial and 20% off of an annual premium subscription.
@TayyabMughalDIK
Күн бұрын
An eye-opening for many. I would to love see your magic turning this anemic model to rich domain model
@zoran-horvat
Күн бұрын
@@TayyabMughalDIK I'm working on that. There will be a couple of videos covering that process, step by step.
@marklord7614
Күн бұрын
@@zoran-horvat I agree that there's great value in learning how to tame such an anemic model.
@JonathanPeel
Күн бұрын
This reminds me of “Make illegal state unrepresentable.” Excellent video. Thank you.
@robertmrobo8954
Күн бұрын
Feel a bit criminal for this video to be released without a solution straight away. 🙂 Falling in love with your content. ❤
@zoran-horvat
Күн бұрын
@@robertmrobo8954 It will take a few more weeks to unfold the entire series.
@pl4gueis
Күн бұрын
I've never seen this kind of explosion in the C# models because most legacy code I worked with have that combinational explosion at the database level. Usually hidden behind "status id" columns. Really glad you made some videos about how to properly design the models and persist them afterwards. I love that you show both sides. The bad design and how it evolves into the ball of muds they are and how to fix it or prevent it. Thank you for the videos.
@zoran-horvat
Күн бұрын
@@pl4gueis It is true that we never actually see the combinatorial explosion in code. It is because programmers never make that step. However, the explosion remains in the state, hence long argument lists and thousands of failure modes per method, often not even covered by appropriate guard clauses. The overall result is an unstable application, which many programmers tolerate and consider "normal" in our profession.
@lettuceturnipthebeets790
Күн бұрын
9:36 "not the meaning of life you were looking for, I presume" 😂 good one! love those bits of humor you throw into the educational stuff, makes it easier to digest, thank you ❤
@Разни-н9л
17 сағат бұрын
@zoran-horvat, I really appreciate the simplicity with which you explain complex concepts. Please consider creating a course on Domain-Driven Design and Clean Architecture. I’ve recently purchased a few courses, but after watching them, Clean Architecture and DDD seemed unnecessarily complicated and full of pointless abstractions. However, when I watch your videos, DDD feels logical and like something that truly improves our code significantly. Keep up the great work!
@zoran-horvat
13 сағат бұрын
@@Разни-н9л That's because before I apply DDD or Clean Architecture, I first strip them off of all the layers that don't add to simplicity and whose purpose is either not self evident or is evidently religious, and only then start with what was left. That is also why I am not making courses on either one of those. Many would say it is not DDD and it is not Clean Architecture to begin with.
@nickbarton3191
Күн бұрын
I giggled all the way through this video. Awesome analysis.
@ibnfpv
22 сағат бұрын
Love this approach use it a lot with result objects not allow creating it by ctor only by a dedicated method that tells already the return state of that object this way it is guarded and readable
@ghevisartor6005
9 сағат бұрын
How would you model something like xml elements read from a file? I feel like the Linq.Xml objects are too much for me, plus i might have to do this in typescript. In my case I don't have persistance, I only need to display them. For displaying it's easy with dynamics components. But based on them having certain attributes i have to do additional processing and then also on mouse events show or hide additional elements. Records would be great since I can have an immutable model, but would you have them like this? - abstract record Element(String Name); - record Element1(String Name, Attribute RequiredAttribute) : Element(Name) - record Element2(String Name, Attribute RequiredAttribute, Attribute OptionalAttribute) : Element(Name) Sorry i know it might be too much to ask in a youtube comments, I would like to know if you see some obvious flaws in this. I'm not sure if I would also suffer from combinatorial explosion without a proper model.
@ShowoffFantasy
Күн бұрын
That slapps in its own way, great job
@guillermomazzari8320
5 сағат бұрын
I truly enjoy your videos, they teach so much in such a short time and in a simple way, thank you very much for sharing your knowledge, I have a question, would a proper way to treat domain models be to consider them as database tables? Following the Normal Forms principal
@zoran-horvat
4 сағат бұрын
@@guillermomazzari8320 It depends on the project. If you are modeling a domain with a lot of business rules, then the data-centric approach is not good. You would probably need a solution where domain rules are central and dara are only the consequence. That explains the rise of higher-order languages and, especially, functional languages. They are simply better suited to business applications.
@elraito
Күн бұрын
Awesome video .... but im sad because i make every mistake in video on regular basis. Do you have spyware in my computer?
@zoran-horvat
Күн бұрын
@@elraito Are you signed in to Google right now? :)
@Joey-m8w
Күн бұрын
Love your content!
@alanis4AL
Күн бұрын
Awesome video
@JanVerny
Күн бұрын
The example here is great. And I genuinely agree that this is not a good way to model your data. But I think in most software you would never see this kind of combinatorial explosion. The reasons are A) most domain models are usually kind of small. And suffer from death by a thousand cuts rather than having one class with 10,000 lines. And B) in the bigger models people just give up on the guard rails. I worked on a huge corporate warehouse automation software and the lead developers basically solved this by making almost every column nullable and treating every combination as valid.
@zoran-horvat
Күн бұрын
@@JanVerny I know what you're talking about. On the other hand, I think that the fact that programmers do not design proper models stems from them not being aware of what they are losing with that. There is very little truly powerful software over there, and it is nothing but a lost opportunity for everyone else.
@nikkollai
15 сағат бұрын
Well! Ok, I see the issue, but it would be cool to see the solution to the anemic class issue. Looks like Zoran is recommending his other DDD videos to figure this out. Which other videos shed the light on the mechanisms to combat anemic class design.
@zoran-horvat
13 сағат бұрын
@@nikkollai There will be more videos in this series that will cover the solutions, one at a time. On the other hand, most videos I made in the last several months are working on this same object model, and each is explaining one aspect of its design.
@sVieira151
Күн бұрын
Just one look at that initial Book class has my blood pressure rising 😩
@zoran-horvat
Күн бұрын
@@sVieira151 Yes, and it should.
@kristianaranda
Күн бұрын
¡Gracias!
@zoran-horvat
Күн бұрын
Thank you! 🎉
@cristiz-vf4ww
Күн бұрын
Thanks!
@zoran-horvat
Күн бұрын
Thank you!
@aleksandarnaumovic3405
13 сағат бұрын
This way of coding could be also recognized as violation of SRP principle, from the traditional view point
@jspesh
Күн бұрын
I wish I had more of a clue wtf you are talking about sometimes, Zoran.
@zoran-horvat
23 сағат бұрын
@@jspesh Now what is that? But don't worry. This video is a part of a series. There will be more on this same topic and that should help you clarify it before end.
@ShawnShaddock
8 сағат бұрын
The issues in this video are side effects of poor design choices and lack of language features like discriminated unions. It's wrong to blame an anemic domain model for these.
@zoran-horvat
7 сағат бұрын
@@ShawnShaddock But you can use record types for discriminated unions now, so it's not the lack of a language feature I would use as an excuse. It is rather a lack of will to do something with the model. It is also preposterous to say that discriminated unions are THE solution, and then mention they are not supported out of the box, where the same effect is at hand's distance with a few interfaces and classes as well.
@kantagara
Күн бұрын
Duša me je zabolela dok sam ovo gledao 🤣
@zoran-horvat
Күн бұрын
@@kantagara Dešava se.
@iuhshwth1634
17 сағат бұрын
Aside from the voice, you sound exactly like G-man from Half Life 😂
Пікірлер: 40