The core question is does this violate either principle? Am I repeating knowledge in the Person
vs PersonEntity
?
Would the removal of the Person
intermediate class result in violating the principal of orthogonality?
Answer: The knowledge of "what is a person" can be answered by the PersonEntity
, this is different from the knowledge of
"My screen needs to show Person.age
, Person.firstName
, and Person.lastName
. This means we are not repeating the knowledge of what a person is within the Person
data class, instead we are expressing the knowledge of what data (coincidentally obtained from a PersonEntity
) that X
screen needs.
We maintain Orthogonality because if we change the implementation of the database Entities
, Daos
, or the database itself then the UI depending on the PersonRepository
would not be affected.