Feature #3586

Assure that value objects are immutable

Added by Robert Lemke over 10 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Could have
Category:
Persistence
Start date:
2010-03-16
Due date:
% Done:

100%

Estimated time:
1.00 h
PHP Version:
Has patch:
Complexity:

Description

The concept of value objects is that they are solely identified by their value and that if two value objects have the same value, they are considered identical. This allows for sharing the same instance of a value object among other objects - but only if the value doesn't change afterwards.

Make sure that value objects are immutable. Properties of a value object should only be set through the constructor. To enforce that we could intercept any potential setters and throw an exception if they are called.


Related issues

Related to TYPO3.Flow - Major Feature #3585: Implement support for value objects New 2009-06-05

History

#1 Updated by Robert Lemke about 10 years ago

  • Target version changed from 1.0 alpha 2 to 283

#2 Updated by Robert Lemke about 10 years ago

  • Target version changed from 283 to 1.0 alpha 3

#3 Updated by Robert Lemke about 10 years ago

  • Target version changed from 1.0 alpha 3 to 1.0 alpha 4

#4 Updated by Robert Lemke about 10 years ago

  • Target version deleted (1.0 alpha 4)

#5 Updated by Karsten Dambekalns over 9 years ago

  • Status changed from New to Resolved
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 8
  • Start date changed from 2009-06-05 to 2010-03-16
  • % Done changed from 0 to 100
  • Estimated time set to 1.00 h

As of r3962 value objects are checked for setters when building class schemata, thus settings this to resolved.

Also available in: Atom PDF