5 ms·
I don't understand his point on encapsulation of information versus implementation. If anyone can help me here, I would be grateful. * Should the user of your
by joske2 14y ago
I don't understand his point on encapsulation of information versus implementation. If anyone can help me here, I would be grateful.
* Should the user of your object/data have to make this distinction? Does he care if age is a piece of data or the result of a calculation?
* Should the user of your object/data know where a piece of information is? Suppose I start of with having a birthdate attribute in my person hash. I later read something about CQRS and decide to build my person as an event store. My birthdate is now in some event hash inside an events list in person. If I encapsulate this birthdate information, the users of my object/data don't have to change.
Encapsulating information/implementation might "complect" person, but doesn't it make it a lot more simple for the users/callers?