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
{{ message }}
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
A mutable class that inherits from an immutable one does not respect the Liskov Substitution Principle, a.k.a. the L in SOLID. An immutable object and its responses to getters can be cached indefinitely whereas a mutable object does not allow this.
For example, AbstractPersistentArray inherits from AbstractPersistentImmutableArray, adding setters that render what should be immutable, per the contract of AbstractPersistentImmutableArray.
This may just be a naming issue. If a suitable replacement for the term Immutable were found that doesn't imply a specific contract, for instance Readable.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A mutable class that inherits from an immutable one does not respect the Liskov Substitution Principle, a.k.a. the L in SOLID. An immutable object and its responses to getters can be cached indefinitely whereas a mutable object does not allow this.
For example,
AbstractPersistentArray
inherits fromAbstractPersistentImmutableArray
, adding setters that render what should be immutable, per the contract ofAbstractPersistentImmutableArray
.This may just be a naming issue. If a suitable replacement for the term
Immutable
were found that doesn't imply a specific contract, for instanceReadable
.The text was updated successfully, but these errors were encountered: