What would the use case for that be? I've never seen a system that worked
that way.

Here is how I would define the interfaces:
https://gist.github.com/shadowhand/543e4e507bf90feffd6bc63427c7e53b

See comment at the end for implied usage.

--
Woody Gilk
http://about.me/shadowhand

On Thu, Nov 17, 2016 at 5:24 PM, Damiano Petrungaro <
damianopetrung...@gmail.com> wrote:

> I didn't realize that you meant only the naming, my fault.
>
> Anyway i imagine the RouterMatcherInterface as an object that will
> contains one or more RouterInterface, and handle the matching of the uri
> with a Route and will invoke the callable.
>
> Example having different RouterInterfaces, the RouterMatcherInterface
> could prefer to use one of many.
>
> So the routing system will be able to handle different RouterInterfaces
> implementation.
>
> Maybe i am just over engeneering the moment of dispatching.
>
> On Friday, November 18, 2016 at 12:09:14 AM UTC+1, Woody Gilk wrote:
>>
>> I wasn't implying it should be static, just stating naming. I think I
>> agree with you about the first two interfaces. What is the purpose of
>> RouteMatcherInterface?
>>
>> On Thu, Nov 17, 2016, 17:03 Damiano Petrungaro <damianop...@gmail.com>
>> wrote:
>>
>>> I would like to avoid static methods, they are harder to test.
>>> I prefer something (very basic example) like this
>>>
>>> https://gist.github.com/damianopetrungaro/d3da280e20bd5b22c0
>>> 9c64174114ac2a
>>>
>>> We should also discuss if is better to call the "add" method or "map".
>>> I don't know which one is the most diffused.
>>>
>>> I imagine like some interfaces like:
>>> RouteInterface as representation of the single route,
>>> RouterInterface as collector of Routes,
>>> RouteMatcherInterface as object that can contains more RouterInterface
>>> that will match and dispatch the action.
>>>
>>> On Thursday, November 17, 2016 at 11:34:46 PM UTC+1, Woody Gilk wrote:
>>>
>>>> To me, the expressive implementation goes way beyond what a router
>>>> does, which is:
>>>>
>>>> Map an http method and a URI expression to a callable:
>>>>
>>>> Router::add(method, urix, callable)
>>>> Router::get(urix, callable)
>>>> Router::post(...)
>>>> // etc for http methods
>>>>
>>>> And then match a URI to a registered route:
>>>>
>>>> Router::match(uri) : Route
>>>>
>>>> Middleware is a totally separate thing and I think it's weird to put it
>>>> here. Especially since middleware can do routing for you, no need for a
>>>> separate step.
>>>>
>>>>
>>>> On Thu, Nov 17, 2016, 16:08 Matthew Weier O'Phinney <
>>>> mweiero...@gmail.com> wrote:
>>>>
>>> On Thu, Nov 17, 2016 at 3:12 PM, Damiano Petrungaro
>>>>>
>>>> <damianop...@gmail.com> wrote:
>>>>> > I'm doing a microframework (for educational purposes), with the goal
>>>>> of use
>>>>> > in the core only methods derived from the PSR interfaces, so as to
>>>>> give
>>>>> > maximum flexibility and not be bound to an implementation rather than
>>>>> > another.
>>>>> >
>>>>> > Now i'm thinking about a routing system, and i'm wondered, how a so
>>>>> crucial
>>>>> > component to web applications (used by all the frameworks) haven't a
>>>>> > standard.
>>>>> >
>>>>> > What do you think to propose it as a possible PSR?
>>>>>
>>>>> With Expressive, we've actually started down this direction already,
>>>>> and Michael has been urging me to submit our ideas around this as well
>>>>> as templating as potential recommendations.
>>>>>
>>>>> Maybe take a look at zend-expressive-router and its RouterInterface,
>>>>> Route class, and RouteResult as a place to start?
>>>>> (https://github.com/zendframework/zend-expressive-router)
>>>>>
>>>>> I'm certainly willing to discuss!
>>>>>
>>>>>
>>>>> --
>>>>> Matthew Weier O'Phinney
>>>>>
>>>> mweiero...@gmail.com
>>>>
>>>>
>>>>> https://mwop.net/
>>>>>
>>>>> --
>>>>> 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/CAJp_myW7zjLEFRhaN
>>>>> g4Qtz9gLFf4JWpfXwZcK2wszLCuiKS3Rw%40mail.gmail.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>>>
>>>> Woody Gilk
>>>> http://about.me/shadowhand
>>>>
>>> --
>>> 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/ms
>>> gid/php-fig/2d837646-e3bd-4735-b8ce-ac269bbca9a1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/php-fig/2d837646-e3bd-4735-b8ce-ac269bbca9a1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>>
>> Woody Gilk
>> http://about.me/shadowhand
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/php-fig/f4d330d6-d864-44a7-8409-d0ae2739b3c4%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/f4d330d6-d864-44a7-8409-d0ae2739b3c4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAGOJM6JVUJifuoq0cxto4egfLk2txe1MJWB83Kv66MC4fqA4JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to