You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take Route entity for example. It has something called internalIdentity and yet it is used in application layer, infrastructure layer and domain layer.
If Route is an Entity then it should have an identity. It wouldn't be internal I think and it shouldn't be named as such.
If it's really internal and used solely for the purpose of persistence, then it shouldn't be leaking to other layers at all.
I know that using ORM with DDD is a pain and it is acceptable (or rather unavoidable) to lose some of the domain purity for the sake of saving things, but such a technical ID should sit quietly and wait to be used for persistence, not for relations in your domain.
Also, is Leg really an Entity here? I mean from domain point of view, not from data-relations point of view. If you drop DB and think in-memory only, would your app behave any different if you got rid of internalIdentity from Leg? You are already comparing legs through dates, so it's a perfect candidate to be a value object. It may be persisted in separate table and have a technical ID, but that does not make it automatically an entity in domain layer.
Great project though, and I realize it passed 4 years since the last commit, so you probably would have done things a little different now, when Doctrine supports value objects, so this issue is more like information for those who are coming here now, as did I :)
The text was updated successfully, but these errors were encountered:
Let's take Route entity for example. It has something called
internalIdentity
and yet it is used in application layer, infrastructure layer and domain layer.If Route is an Entity then it should have an identity. It wouldn't be internal I think and it shouldn't be named as such.
If it's really internal and used solely for the purpose of persistence, then it shouldn't be leaking to other layers at all.
I know that using ORM with DDD is a pain and it is acceptable (or rather unavoidable) to lose some of the domain purity for the sake of saving things, but such a technical ID should sit quietly and wait to be used for persistence, not for relations in your domain.
Also, is Leg really an Entity here? I mean from domain point of view, not from data-relations point of view. If you drop DB and think in-memory only, would your app behave any different if you got rid of
internalIdentity
from Leg? You are already comparing legs through dates, so it's a perfect candidate to be a value object. It may be persisted in separate table and have a technical ID, but that does not make it automatically an entity in domain layer.Great project though, and I realize it passed 4 years since the last commit, so you probably would have done things a little different now, when Doctrine supports value objects, so this issue is more like information for those who are coming here now, as did I :)
The text was updated successfully, but these errors were encountered: