The Evil Power of Mutants
29 July, 2022
3
3
1
Contributors
Returning to the essential
The essence of an entity of reality is that which makes it be itself and not another.
Objects should know how to defend themselves against invalid representations. They are the powers against mutants.
Is data ok?
Times are changing
Is it crystal clear for everybody that a date should not mutate?
Possible solutions
Conclusions
If an object is complete since its creation, it will always be able to answer messages. An object must correctly represent the entity since its inception. If we work in a concurrent environment it is essential that the objects are always valid. An object must be immutable if the entity it represents is immutable Most entities are immutable.
Objects must be complete since their creation.
Setters and getters must not exist.
Getters should not exist (unless they exist in the real world and then the bijection is valid). It is not the responsibility of any real entity to reply to a getXXX() message.