11,370 reputation
1533
bio website
location Brno, Czech Republic
age
visits member for 2 years, 4 months
seen 3 hours ago

13h
comment Model relationships with DDD (or with sense)?
@igor "In other words, your developer may see an AnswerRepo;" No, he won't because there won't be any AnswerRepo. Repositories are per aggregate-root and Answer is part of Question aggregate, so it is not root. ONLY way to save Answer into DB is for it to be inside Question's Answers collection.
13h
comment Model relationships with DDD (or with sense)?
@igor Thats not what I meant. I meant that in E, Answers are tied to Questions simply because, to persist an Answer, it needs to be assigned to Question. There should be no way to persist an Answer without it being assigned to a Question. It has nothing to do with repository. Also, Repositories are integral part of your domain. And if lifetime and existence of Answer is so closely tied to Question, then it makes sense to have Question maintain it's life time. There is also question of removing answers from questions and moving answers between questions.
13h
comment Model relationships with DDD (or with sense)?
@igor Also, if you want to tie creation of Answer with Question, then A would be better, because if you go with C, then it hides when the answer is assigned to question. Also, reading your text in A, you should differentiate "model behavior" and who initiates this behavior. Question could be responsible for creating answers, when it needs to initialize the answer in some way. It has nothing to do with "user creating answers".
13h
comment Model relationships with DDD (or with sense)?
@igor E already communicates that Answer is part of Question by making it mandatory to assign Answer to question for it to be saved is repository. If there was a way to save just Answer without loading it's question, then C would be better. But that is not a obvious from what you written.
1d
answered Model relationships with DDD (or with sense)?
1d
answered Generate unique integer from two integers with algorithm
1d
comment Generate unique integer from two integers with algorithm
@gnat Actually, that "suggested formula" of his is most probably from that exact answer.
1d
comment Generate unique integer from two integers with algorithm
It would be easy if he "concatenated" the bits. Two 32bit numbers would give you one 64bit number. No need to play around with strings.
2d
comment How to save entities relations using unit of work pattern
@michaelbn Yeah. That could work.
Oct
19
answered How to save entities relations using unit of work pattern
Oct
19
answered Decide the type of an object during runtime
Oct
18
answered Tell, Don't Ask and Immutability in a non-directional network
Oct
17
comment How can I mock this architecture?
Do you want to ensure the material is only one of few predefined values, or do you want it to be possible to define your own material? Both pieces of your code conflict in those ideas. You have to make up your mind.
Oct
17
comment How can I mock this architecture?
Why do you have string in Container constructor? dic = d; shouldn't be compilable with the types you have.
Oct
17
comment Software desing suggestion - In case we need to set a property of a class within a scope and dispose it when the parent scopes completes
I agree with @Telastyn, that this is most probably case of incorrect design showing it's incorrectness though weird secondary behavior. I would recommend reengineering of MyClassA and ABC.
Sep
23
comment IOC Containers break OOP Principles
@Den Your project was not obviously designed with Dependency inversion in mind. And nowhere I said that using IoC is trivial.
Sep
19
comment IOC Containers break OOP Principles
@Telastyn First, simplistic examples never describe the whole problem. They are more dangerous than useful. Second, there is major difference between explicit interface and generic Action. If you would change your example to use some programmer-created interface, it would be obvious that the example is wrong.
Sep
19
comment IOC Containers break OOP Principles
@Telastyn Your example doesn't make sense, because it is not a case where IoC should be used. It is same as using a tool incorrectly and then complaining the tool is is broken. IoC should be used on much more specific interface than simple Action.
Sep
19
comment IOC Containers break OOP Principles
@Suamere I'm not that experienced with IoC, but I never heard of IoC changing compiled code. Would you please provide information about what platforms/languages/frameworks are you talking about.
Sep
19
answered IOC Containers break OOP Principles