rfc:functional-elements

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:functional-elements [2008/03/06 02:28] – Adding work in progress notice lstrojnyrfc:functional-elements [2008/03/16 14:09] – Adding use case titles lstrojny
Line 1: Line 1:
-This RFC is still work in progress +This RFC is still in progress 
----- +====== Functional elements to work with aggregations ======
-====== Functional elements for object lists ======+
 ==== Abstract ==== ==== Abstract ====
-A common pattern in PHP is iterating through a list of objects and executing certain methods of the function. This is especially common when it comes to 1:n-relations (e.g. one object, n adapters). This proposal is meant to abstract those iterations in convenient functional constructs.+A common pattern in PHP is iterating through a list of objects and executing certain methods of the objects. This is especially common when it comes to 1:n-relations (e.g. one object, n adapters). This proposal is meant to abstract those iterations in convenient functional constructs by adding method call iterators and iterator functions.
  
 ==== Current usage patterns ==== ==== Current usage patterns ====
-=== UC-1 ===+=== UC-1: Iterating over an aggregation of objects ===
 <code php> <code php>
 foreach ($list as $element) { foreach ($list as $element) {
     $element->method();     $element->method();
-    array $params = array(), 
-    array $condition_params = array(), 
-    bool $collect = true, 
-    bool $finite = true 
 } }
 </code> </code>
  
-=== UC-2 ===+=== UC-2: Iterating over an aggregation of objects and keeping the results ===
 <code php> <code php>
 $result = array(); $result = array();
Line 25: Line 20:
 </code> </code>
  
-=== UC-3 ===+=== UC-3: Iterating over an aggregtion of objects and conditionally executing a method ===
 <code php> <code php>
 foreach ($list as $element) { foreach ($list as $element) {
Line 34: Line 29:
 </code> </code>
  
-=== UC-4 ===+=== UC-4: Iterating over an aggregation of objects and conditionally executing a method while keeping the results ===
 <code php> <code php>
 $result = array(); $result = array();
rfc/functional-elements.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1