symfony-cmf / Routing

Routing component building on the Symfony Routing component
Other
288 stars 69 forks source link

better getRouteCollection implementation #97

Closed dbu closed 2 years ago

dbu commented 10 years ago

drupal has a LazyLoadingRouteCollection which does load routes by batches.

we could generalize this by adding a PagingProviderInterface that route providers implement to support paging. it would need something like getAllRoutes(offset, limit) and a count method. then DynamicRouter::getRouteCollection could detect the interface on the provider and use the LazyCollection (or PagingCollection?).

that would encapsulate the logic in the right places.

dbu commented 10 years ago

@dawehner @Crell would any of you be up to port this into the component? we are in quite a hurry if we want to get it into 1.2, as we do the RC1 on april 1st.

dawehner commented 10 years ago

We do have a week long sprint before april 1st, so I am really optimistic to find some time, and if it is on the airport.

dbu commented 10 years ago

sounds great!

dawehner commented 10 years ago

Tried to work a bit on that issue though the fact that the current lazy collection implements IteratorAggregate and not Iterator seems to make impossible to not break BC

dbu commented 10 years ago

if we can merge that today we would not need to worry about BC as this code was never released. otherwise it should be simple to keep BC, just have function getIterator() {return $this;} no?

dawehner commented 10 years ago

OH, I wasn't aware that this is possible. Hopefully I will find time this evening

On Mon, Mar 31, 2014 at 1:24 PM, David Buchmann notifications@github.comwrote:

if we can merge that today we would not need to worry about BC as this code was never released. otherwise it should be simple to keep BC, just have function getIterator() {return $this;} no?

Reply to this email directly or view it on GitHubhttps://github.com/symfony-cmf/Routing/issues/97#issuecomment-39077735 .

dbu commented 10 years ago

@dawehner seems this was the original issue. i guess the getRouteCollection would be where we hook the factory into the DynamicRouter. and seems like the right place to configure things, and make it extensible through composition rather than class hierarchy.