Feature #3586

Assure that value objects are immutable

Added by Robert Lemke about 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-03-16
Priority:Could have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 8 Estimated time:1.00 hour
PHP Version: Complexity:
Has patch:

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 6 years ago

  • Target version changed from 1.0 alpha 2 to 283

#2 Updated by Robert Lemke about 6 years ago

  • Target version changed from 283 to 1.0 alpha 3

#3 Updated by Robert Lemke about 6 years ago

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

#4 Updated by Robert Lemke almost 6 years ago

  • Target version deleted (1.0 alpha 4)

#5 Updated by Karsten Dambekalns over 5 years ago

  • Status changed from New to Resolved
  • Assigned To 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

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

Also available in: Atom PDF