[Cache] ArrayAccess for Collection

130 views
Skip to first unread message

Phil Sturgeon

unread,
Mar 27, 2014, 11:05:32 PM3/27/14
to php...@googlegroups.com
This thread started to balloon as they always do, so we're back to one-thread one-topic. 

Paul Dragoonis suggests we strip ArrayAccess out of the Collection interface. (I know some of you don't want a collection, but if it stays then I want ArrayAccess gone).

Generally speaking, stuff like ArrayAccess is in this instance implementation-level sugar and not something we need to be defining in our interfaces. Folks can implement it if they like, or they can... not. We also removed it from the HTTP Message PSR, and removed it from Poolnterface

Jeremy Lindblom

unread,
Mar 28, 2014, 2:42:07 PM3/28/14
to php...@googlegroups.com
If we end up keeping Collection, let's only make it an iterator and nothing else. There's probably a better name for it then too. How about just:

> ItemIteratorInterface extends \Traversable {}

Robert Hafner

unread,
Mar 28, 2014, 3:43:46 PM3/28/14
to php...@googlegroups.com

Originally the getItems function *did* return a Traversable. If we only make ItemIteratorInterface a Traversable and nothing else, it's the equivalent of not keeping the Collection stuff.


--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/dd82710d-be0e-4a7d-8796-fed74a18ac96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Phil Sturgeon

unread,
Mar 28, 2014, 7:46:37 PM3/28/14
to php...@googlegroups.com
Another reason to kill collections then it seems.

Paul Dragoonis

unread,
Mar 30, 2014, 4:48:51 PM3/30/14
to php...@googlegroups.com
On Fri, Mar 28, 2014 at 6:42 PM, Jeremy Lindblom <jerem...@gmail.com> wrote:
If we end up keeping Collection, let's only make it an iterator and nothing else. There's probably a better name for it then too. How about just:

> ItemIteratorInterface extends \Traversable {}

This is exactly what I said (in case you haven't realised :)
 


On Thursday, March 27, 2014 8:05:32 PM UTC-7, Phil Sturgeon wrote:
This thread started to balloon as they always do, so we're back to one-thread one-topic. 

Paul Dragoonis suggests we strip ArrayAccess out of the Collection interface. (I know some of you don't want a collection, but if it stays then I want ArrayAccess gone).

Generally speaking, stuff like ArrayAccess is in this instance implementation-level sugar and not something we need to be defining in our interfaces. Folks can implement it if they like, or they can... not. We also removed it from the HTTP Message PSR, and removed it from Poolnterface

Phil Sturgeon

unread,
Apr 3, 2014, 3:56:19 PM4/3/14
to php...@googlegroups.com
Seems like a consensus on  ItemIteratorInterface extends \Traversable {} ?

Robert Hafner

unread,
Apr 3, 2014, 4:02:03 PM4/3/14
to php...@googlegroups.com

That simply brings us back to the pre-Collection code, which is all the more reason to remove it.

Robert


On Apr 3, 2014, at 12:56 PM, Phil Sturgeon <em...@philsturgeon.co.uk> wrote:

Seems like a consensus on  ItemIteratorInterface extends \Traversable {} ?

--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.

Paul Dragoonis

unread,
Apr 6, 2014, 6:46:03 AM4/6/14
to php...@googlegroups.com
bye bye ArrayAccess!


Larry Garfield

unread,
Apr 6, 2014, 7:41:52 PM4/6/14
to php...@googlegroups.com
How would we do multi-set with just Traversable?  Is that robust enough to allow compatible multi-set implementations to actually have multiple parallel set operations?

We added it to support multi-set, so that's the important part to address.  (Just traversable is sufficient for multi-get, but we want to include multi-set, too.)

--Larry Garfield

Robert Hafner

unread,
Apr 6, 2014, 10:49:37 PM4/6/14
to php...@googlegroups.com

Lets remove it like the group wants and then come up with a working proposal. My thoughts are that it should be moved into a new branch (cache-multi) with a PR issued against the main proposal, and as we work through these issues and get them resolved we merge the changes back in.

Robert


Paul Dragoonis

unread,
Apr 13, 2014, 6:55:16 AM4/13/14
to php...@googlegroups.com
On Mon, Apr 7, 2014 at 12:41 AM, Larry Garfield <la...@garfieldtech.com> wrote:
How would we do multi-set with just Traversable?  Is that robust enough to allow compatible multi-set implementations to actually have multiple parallel set operations?

We added it to support multi-set, so that's the important part to address.  (Just traversable is sufficient for multi-get, but we want to include multi-set, too.)

If it's traversable then you can iterate and set individually, or compile a new list of items to be set in a single transaction.
 
Reply all
Reply to author
Forward
0 new messages