On Oct 9, 2011, at 00:52 , Fabian Spillner wrote:

> First, I want to understand why we need the solution with multiple
> resources per route (1).
> 
> Your approach:
> 
> rest:
>  resources: [foo_v1.rest.controller, foo_v2.rest.controller]
>  type:      rest
> 
> … is in fact the same to:
> 
> rest_v1:
>  resource: foo_v1.rest.controller
>  type:     rest
> 
> rest_v2:
>  resource:  foo_v2.rest.controller
>  type:      rest
> 
> Please, can you explain me the reasons?

>From my reading it is not, as the YamlFileLoader will parse the file and then 
>iteratively call the Rest loaders one at a time. Therefore if I want to 
>realize that there is a relationship, I would have to look into the collection 
>before adding a new route to determine if for the same patterns there already 
>is a route written (just with a different version). Otherwise I would just 
>override the previous routes.

Now I am not sure yet, but it might even be ok if we continuously overwrite 
previous routes since all we really need to make sure is that for each action 
in all of the controllers there is a route that matches them. So lets assume we 
do as you suggest above.

Then I am back at the issue I mentioned in my original email:
Once I match a given pattern, how do I easily find _all_ controllers that match 
the given pattern, given that based on format AND version preferences I might 
need to first look at controller A, then at controller B and then at controller 
A again. Given this need I do not see how the current "iterate and forget about 
previous routes" is the right approach. Note I do not know the routing layer 
all that well yet, so maybe I am overlooking something here.

Note:
The current code only works with Annotations and these Annotations are not 
cached. I will later probably move this code back into the route loader some 
how. But I did not quickly see a way to add additional data into the routes 
that would be returned when calling the match() method.

So in summary, I am still trying to learn the Routing component to understand 
how I can best leverage it for the task at hand.

> Additionally, we should not forget to keep the hypermedia (HATEOAS) in
> mind (FOSRestBundle could provide ways for easy generation of links
> (href, rel and media type)).

Yes, there is another ticket for this already. The plan here is to have a 
Response listener that can add this sort of stuff.

regards,
Lukas Kahwe Smith
[email protected]



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to