rfc:horizontalreuse
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:horizontalreuse [2011/01/03 10:30] – fixed date of last update gron | rfc:horizontalreuse [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Request for Comments: Horizontal Reuse for PHP ====== | ====== Request for Comments: Horizontal Reuse for PHP ====== | ||
- | * Version: 2.0.1 | + | * Version: 2.1.1 |
- | * Date: 2008-10-12, last update | + | * Date: 2008-10-12, last update |
* Author: Stefan Marr < | * Author: Stefan Marr < | ||
- | * Status: | + | * Status: |
* First Patch: http:// | * First Patch: http:// | ||
* First Published at: http:// | * First Published at: http:// | ||
Line 350: | Line 350: | ||
==== Traits Composed from Traits ==== | ==== Traits Composed from Traits ==== | ||
- | Not explicitly mentioned | + | Not explicitly mentioned |
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, |
When a strong coherence/ | When a strong coherence/ | ||
- | and certain | + | 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. | ||
Line 551: | Line 551: | ||
+ | ===== Reflection ===== | ||
+ | |||
+ | Status: The Reflection API is not completely adapted for traits yet. | ||
+ | |||
+ | The following functions are added to match the existing class- or interface-specific functions. | ||
+ | * trait_exists() | ||
+ | * get_declared_traits() | ||
====== Grafts - Class Composition (not implemented) ====== | ====== Grafts - Class Composition (not implemented) ====== |
rfc/horizontalreuse.1294050605.txt.gz · Last modified: 2017/09/22 13:28 (external edit)