rfc:horizontalreuse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:horizontalreuse [2011/04/06 10:59]
127.0.0.1 external edit
rfc:horizontalreuse [2017/09/22 13:28] (current)
Line 3: Line 3:
   * Date: 2008-10-12, last update 2011-01-09   * Date: 2008-10-12, last update 2011-01-09
   * Author: Stefan Marr <​php.at.stefan-marr.de>​   * Author: Stefan Marr <​php.at.stefan-marr.de>​
-  * Status: ​Committed to trunk (traits only)+  * Status: ​Implemented in PHP 5.4 (traits only)
   * First Patch: http://​www.stefan-marr.de/​2009/​09/​traits-patch-updated-backported-and-available-on-github/​   * First Patch: http://​www.stefan-marr.de/​2009/​09/​traits-patch-updated-backported-and-available-on-github/​
   * First Published at: http://​www.stefan-marr.de/​artikel/​rfc-horizontal-reuse-for-php.html   * First Published at: http://​www.stefan-marr.de/​artikel/​rfc-horizontal-reuse-for-php.html
Line 350: Line 350:
 ==== Traits Composed from Traits ==== ==== Traits Composed from Traits ====
  
-Not explicitly mentioned ​jet, but implied by the flattening property is the+Not explicitly mentioned ​yet, but implied by the flattening property is the
 composition of Traits from Traits. composition of Traits from Traits.
 Since Traits are fully flattened away at compile time it is possible to use Since Traits are fully flattened away at compile time it is possible to use
Line 519: Line 519:
 Traits do not provide any provisioning for handling state. Traits do not provide any provisioning for handling state.
 They are meant to provide a light-weight mechanism for flexible code reuse, They are meant to provide a light-weight mechanism for flexible code reuse,
-with the mean goal being to avoid code duplication. +with the main goal being to avoid code duplication. 
-Moreover, should not be confused with typical use cases of classes.+Moreover, ​traits ​should not be confused with typical use cases of classes.
 When a strong coherence/​coupling between methods and state is required, When a strong coherence/​coupling between methods and state is required,
-and certain ​invariants have to be maintained on the state, this is a good +and invariants have to be maintained on the state, this is a good 
 indication that a class is the right abstraction to implement that problem ​ indication that a class is the right abstraction to implement that problem ​
 with. with.
rfc/horizontalreuse.1302087566.txt.gz · Last modified: 2017/09/22 13:28 (external edit)