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.
@@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.
@@user-tk2jy8xr8b When people want DUs that badly, why not use a functional first language? It is also possible to create an F# library to hold models (and DUs) and access it from your C# projects.
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 ❤
@@AH-wk1id I am working on a few videos that will show that. In the meanwhile, you can refer to my recent videos about EF Core which are operating on the fixed version of this same object model.
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
@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!
@@Разни-н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.
thanks for all tutorials may i to ask something playlist isn't numbered and i don't know the proper sequence of videos can you number them please and thanks again
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.
@@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.
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.
@@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.
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
@@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.
@@stevejohnny1111 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.
@@zoran-horvat The way you speak is like a riddle. It makes very little sense. I can usually follow the code to some degree but it's not made any easier by your commentary. You introduce a lot of terms that people won't know, in a strange way. I think you're a great programmer but could work on your teaching methods.
@@stevejohnny1111 This channel is advanced, to begin with. It makes certain assumptions about its viewers. If you don't see sense in what I say that doesn't necessarily mean there is no sense. Connected issue is the programming terms you complain about. I never introduced a single programming term. Can you pinpoint the problem you observe starting from that?
@@zoran-horvat Yeah but the concepts you describe aren't overly complicated. Your language and strange delivery make it seem more complicated. You seem to think that you are telling some sort of story and that'll somehow make it easier to follow, however it has the opposite effect. It's not easy to pinpoint but I do think there is an issue with the language barrier as well because you are obviously not a native English speaker. This is evident in your written comments as well - you miss out key words. Whilst my brain will put them back in automatically, it's distracting. Example: " If you don't see sense in what I say that doesn't necessarily mean there is no sense. Connected issue is the programming terms you complain about" - you missed "A" before "Connected". You could have just said this: "Just because you couldn't make sense of what I said, it doesn't mean there is no value to it. This also applies to any programming terms you mentioned". My comment was not necessarily directed just at this video, but most of your videos. It's a shame because you have some really interesting thoughts, but your whimsical little stories and not very funny jokes do not add anything to your delivery. Oh and perhaps explain what the fuck an "anemic domain model" is. Anemia is to do with blood, not code.
@@zoran-horvat Of course, I think the anemic domain model violates SRP. Your variance with diferentiated classes is a better one, and makes a good separation of data, which is in accordance with SRP. Each single unit (class) is showing just that portion of data or type or class, thus making it cohesive within it's own concern.
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.
@@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.
@@zoran-horvat How are you defining Anemic Doman Model? You mention Fowler who defines it as data without behavior. In that case, there is nothing about an Anemic Domain Model that necessitates these nullable or boolean status-type properties. One could argue that these problems are actually a function of the OOP mindset of encapsulated (mutable) state. Looking forward to your refactoring, as always.
Learn more at Brilliant brilliant.org/ZoranHorvat/
This link gives you a 30-day free trial and 20% off of an annual premium subscription.
An eye-opening for many. I would to love see your magic turning this anemic model to rich domain model
@@TayyabMughalDIK I'm working on that. There will be a couple of videos covering that process, step by step.
@@zoran-horvat I agree that there's great value in learning how to tame such an anemic model.
@@zoran-horvat I'll definitely take a look at that. Thank you for sharing your knowledge with us
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.
@@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.
This reminds me of “Make illegal state unrepresentable.”
Excellent video. Thank you.
Too bad there are still no DUs in C#
@@user-tk2jy8xr8b When people want DUs that badly, why not use a functional first language?
It is also possible to create an F# library to hold models (and DUs) and access it from your C# projects.
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 ❤
Feel a bit criminal for this video to be released without a solution straight away. 🙂
Falling in love with your content. ❤
@@robertmrobo8954 It will take a few more weeks to unfold the entire series.
Does anyone know a particular video or set of videos that shows how to fix the combinatorial explosion problem?
@@AH-wk1id I am working on a few videos that will show that. In the meanwhile, you can refer to my recent videos about EF Core which are operating on the fixed version of this same object model.
¡Gracias!
Thank you! 🎉
I giggled all the way through this video.
Awesome analysis.
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
@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!
@@Разни-н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.
thanks for all tutorials may i to ask something playlist isn't numbered and i don't know the proper sequence of videos can you number them please and thanks again
I will make a playlist after I complete recording the series.
@@zoran-horvat thanks
Thanks!
Thank you!
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.
@@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.
That slapps in its own way, great job
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.
@@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.
Love your content!
Awesome video .... but im sad because i make every mistake in video on regular basis. Do you have spyware in my computer?
@@elraito Are you signed in to Google right now? :)
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
@@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.
Awesome video
insane as always
Just one look at that initial Book class has my blood pressure rising 😩
@@sVieira151 Yes, and it should.
I wish I had more of a clue wtf you are talking about sometimes, Zoran.
@@stevejohnny1111 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.
@@zoran-horvat The way you speak is like a riddle. It makes very little sense. I can usually follow the code to some degree but it's not made any easier by your commentary. You introduce a lot of terms that people won't know, in a strange way. I think you're a great programmer but could work on your teaching methods.
@@stevejohnny1111 This channel is advanced, to begin with. It makes certain assumptions about its viewers. If you don't see sense in what I say that doesn't necessarily mean there is no sense.
Connected issue is the programming terms you complain about. I never introduced a single programming term. Can you pinpoint the problem you observe starting from that?
@@zoran-horvat Yeah but the concepts you describe aren't overly complicated. Your language and strange delivery make it seem more complicated. You seem to think that you are telling some sort of story and that'll somehow make it easier to follow, however it has the opposite effect. It's not easy to pinpoint but I do think there is an issue with the language barrier as well because you are obviously not a native English speaker. This is evident in your written comments as well - you miss out key words. Whilst my brain will put them back in automatically, it's distracting. Example: " If you don't see sense in what I say that doesn't necessarily mean there is no sense. Connected issue is the programming terms you complain about" - you missed "A" before "Connected". You could have just said this: "Just because you couldn't make sense of what I said, it doesn't mean there is no value to it. This also applies to any programming terms you mentioned". My comment was not necessarily directed just at this video, but most of your videos. It's a shame because you have some really interesting thoughts, but your whimsical little stories and not very funny jokes do not add anything to your delivery. Oh and perhaps explain what the fuck an "anemic domain model" is. Anemia is to do with blood, not code.
@@stevejohnny1111 No need to curse. You could have visited the Wikipedia page titled... let me check... "Anemic domain model." Well that is funny.
This way of coding could be also recognized as violation of SRP principle, from the traditional view point
The coding at the beginning or at the end of the demo?
@@zoran-horvat Of course, I think the anemic domain model violates SRP. Your variance with diferentiated classes is a better one, and makes a good separation of data, which is in accordance with SRP. Each single unit (class) is showing just that portion of data or type or class, thus making it cohesive within it's own concern.
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.
@@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.
@@zoran-horvat How are you defining Anemic Doman Model? You mention Fowler who defines it as data without behavior. In that case, there is nothing about an Anemic Domain Model that necessitates these nullable or boolean status-type properties.
One could argue that these problems are actually a function of the OOP mindset of encapsulated (mutable) state.
Looking forward to your refactoring, as always.
Duša me je zabolela dok sam ovo gledao 🤣
@@kantagara Dešava se.