Practical example of extracting a Value Object using Java.
A value object is a reusable, immutable object that does not only encapsulate a primitive value, but also its behaviour. Identifying and extracting those value objects improve the cohesion in our code, and avoids duplication. Suppose i created a new component that consumed an already existing value object, i would be able to reuse the values methods instead of implementing duplicated code by accident.
Try it yourself!
The Code
github.com/gre...
Let me know what you think.
/ gregor_riegler
gregorriegler.com/
Негізгі бет Extract Value Object Refactoring
Пікірлер: 1