241 reputation
24
bio website github.com/zafarkhaja
location Limassol, Cyprus
age
visits member for 2 years, 6 months
seen 20 hours ago

A passionate and yet pragmatic programmer who specializes in Java, PHP, OOP, SOLID Principles, Design Patterns, DDD, Unit Testing (TDD), Web Services (SOAP, (XML|JSON)-RPC, REST), Clean Code, Code Review, Refactoring and Git. A big fan of open source software. Interested in development of Enterprise level applications and/or complex web systems. Enjoys being involved in the R&D activities. Keen to learn new and fancy technologies.


Nov
18
awarded  Enthusiast
Oct
31
comment Model relationships with DDD (or with sense)?
@lawpert the Answer (not Choice) I referred to was the one from the above answer. The rule of thumb is to store aggregate as a whole to preserve its consistency. So if your "Answer (aka Choice)" is not an aggregate root you don't store it directly, even if it's an entity.
Oct
31
comment Model relationships with DDD (or with sense)?
@lawpert Answer is a value object, it's going to be stored with an aggregate root of its aggregate. You don't store value objects directly, nor do you save entities if they are not roots of their aggregates.
Oct
31
comment DDD: service/repo operations on IDs or instances?
Still think you should make it a value object whether it's natural or not. Referencing a domain entity by a number of type long doesn't make sense. What would you answer if I ask what this number is and what validation rules it has? A primary key in the DB, 8 bytes? I don't think so. You'd probably say it's a global unique identifier and it should be a positive number. This sounds more like a domain concept and business logic, so why not model it as a domain object and encapsulating the validation logic. Also read this.
Oct
30
revised DDD: service/repo operations on IDs or instances?
edited body
Oct
30
answered DDD: service/repo operations on IDs or instances?
Oct
29
revised DDD: How to refer/select a value object inside aggregate?
deleted 249 characters in body
Oct
29
comment DDD: How to refer/select a value object inside aggregate?
@AlexanderLanger I found that part about the wheels. It says "To know which tire is which, the tires must be identified ENTITIES also. But it is very unlikely that we care about the identity of those tires outside of the context of that particular car.". What I proposed, however, was not identifying the Choices but rather differentiating them using aliases (ordinals) while differentiating them using values would be more than sufficient. Nevertheless, in the light of recent clarifications on the intended use, it seems reasonable to model the Choices as entities. Thanks for tipping me off.
Oct
29
comment DDD: How to refer/select a value object inside aggregate?
@AlexanderLanger, sorry don't have access to it. Mind providing a quote, please?
Oct
29
comment DDD: How to refer/select a value object inside aggregate?
@AlexanderLanger, I removed the confusing statement. Other than that, I think "local" ID doesn't necessarily make it an entity because it's not a clear identity but just a way to differentiate between different Choices in the aggregate boundary. Think of it as an alias for its value.
Oct
29
revised DDD: How to refer/select a value object inside aggregate?
Removed confusing statement
Oct
29
revised DDD: How to refer/select a value object inside aggregate?
Update from comments
Oct
29
awarded  Commentator
Oct
29
comment DDD: How to refer/select a value object inside aggregate?
Right. All depends on how you wish to model it. Besides the fact that value objects don't have clear identity, they also don't have state and life-cycle. So if you want a Choice to have a state and a life-cycle you'd probably consider implementing it as an entity. Use this link as a reference.
Oct
29
revised DDD: How to refer/select a value object inside aggregate?
added 26 characters in body
Oct
29
comment DDD: How to refer/select a value object inside aggregate?
Yes, that's correct. But beware that true value objects are interchangeable. You should be able to use the same instance of Choice for different Polls because it's not the identity that matters, but the value.
Oct
29
revised DDD: How to refer/select a value object inside aggregate?
deleted 1 character in body
Oct
29
awarded  Yearling
Oct
29
answered DDD: How to refer/select a value object inside aggregate?
Oct
23
revised Model relationships with DDD (or with sense)?
Elaborate on my answer in the comments