@Chintana

We have the concept of a ‘module’ in jiggery, even though we currently
don’t have an online repository for them. It seems Chan is suggesting to
implement this as a module not as a core part of jiggery. Hope this
addresses your concern.

@Chan, Nuwan, Sanjiva

We did have discussions about implementing this kind of functionality
within jaggery team as well as with carbon team. But not in the exact way
you have currently implemented [1].

   1.  This implementation is doing what URIMatcher is doing but with
   better syntax. Ideally it should have been using URIMatcher module
   underneath. I don’t see the reason for re-implement the URIMatcher module
   in JavaScript. But we should look into extending the URIMatcher class to
   support more features of the URI Template RFC [2].
   2. As Nuwan has pointed out, we have to register the mapping at init
   time (not just because it will reduce object creation but mainly because it
   will give the ability to map functions written in multiple files
   uniformly). But it if we do this by writing yet another module we have to
   create another configuration file, which isn’t ideal because we already
   have mappings in ‘jiggery.conf’. A Better solution might be to extend
   jiggery, so that existing configuration file can express this kind of
   mappings.

We should schedule a meeting to discuss about this.

[1] https://gist.github.com/dulichan/62f3d49d1fe40a11b4c7#file-router-jsa

[2] http://tools.ietf.org/html/rfc6570


On Sun, May 12, 2013 at 2:10 PM, Chintana Wilamuna <[email protected]>wrote:

> IMHO, this stuff should not be part of Jaggery. URI mappers are part of an
> application, a developer writes for ease of use. Ditto for other stuff like
> ORM.
>
> What we need for Jaggery is a module system where you can have a
> repository of these addon libs. Like NPM for Node. GEM for Ruby etc... Then
> it becomes a matter of making things as libraries and give the developers a
> choice of selecting a library that feels natural.
>
>     -Chintana
>
>
> On Sun, May 12, 2013 at 12:38 PM, Chan <[email protected]> wrote:
>
>> Hi all,
>>
>> *the subject of the mail is misleading. Its about better URL Mapping
>> support for code** *
>> *
>> *
>> +1. Sorry everyone about the misleading title [?]. My initial requirement
>> was to support REST that's the reason why I stick it in the subject.
>>
>> Also we can improve the Router more by using descriptive method naming -
>>  jbj.route('users/{userid}|GET',function(ctx){});
>>  It should be better if it was like
>>  jbj.get('users/{userid}',function(ctx){});
>>
>>
>> On Sun, May 12, 2013 at 8:42 AM, Nuwan Bandara <[email protected]> wrote:
>>
>>> Hi Sanjiva
>>>
>>>
>>> On Sun, May 12, 2013 at 7:54 AM, Sanjiva Weerawarana 
>>> <[email protected]>wrote:
>>>
>>>> Nuwan lets please not use "rest" as a name .. this is not about the
>>>> REST architectural pattern at all but rather about routing requests to a
>>>> piece of code.
>>>>
>>>
>>> +1, the subject of the mail is misleading. Its about better URL Mapping
>>> support for code
>>>
>>>
>>>>
>>>> Please let me know when u guys are having the discussion .. I'd like to
>>>> listen in.
>>>>
>>>
>>> Will do :)
>>>
>>> Regards,
>>> /Nuwan
>>>
>>>
>>>>
>>>> Sanjiva.
>>>>
>>>>
>>>> On Sat, May 11, 2013 at 11:24 PM, Nuwan Bandara <[email protected]> wrote:
>>>>
>>>>> Hi Sanjeewa,
>>>>>
>>>>> We are at the service composition level, we need some way of mapping
>>>>> functionality to URL Patters, so it has to be at the development framework
>>>>> level, bot at the integration layer level. So Jaggery need to come up with
>>>>> some combination with URLMatcher module to give JAX-RS like features.
>>>>>
>>>>> @Chan, compared to V8, yes Rhino is slow, but we are expecting
>>>>> improvements with JDK 8. however regarding load it can handle enough. we
>>>>> have done perf tests for APIM and UES with jaggery.
>>>>>
>>>>> Regards,
>>>>> /Nuwan
>>>>>
>>>>>
>>>>> On Sat, May 11, 2013 at 11:09 PM, Chan <[email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> *Just to clarify, why we cant achieve this by using synapse rest
>>>>>> support and uri template module?*
>>>>>>
>>>>>> I looked into Apache Synapse REST support via this 
>>>>>> sample<http://synapse.apache.org/userguide/samples/sample800.html>.
>>>>>> One of the problems I see is that it's not very straight-forward. The
>>>>>> module should be more developer friendly like Sinatra where routes can be
>>>>>> easily matched.
>>>>>>
>>>>>> Sinatra example -
>>>>>>
>>>>>> get '/users' do
>>>>>>   # get a listing of all the users
>>>>>> end
>>>>>>
>>>>>> *Just to clarify, why we cant achieve this by using synapse rest
>>>>>> support and uri template module?*
>>>>>>
>>>>>> I believe URIMatcher module should be self contained in regarding
>>>>>> mapping utility functions and it should remain separated from the Router.
>>>>>> Router is an Object that will store the routes (Will be using URIMatcher
>>>>>> underneath as a helper) and process them when a request takes place.
>>>>>>
>>>>>> *but we need to register these at app deployment level like in JAX-RS
>>>>>> *
>>>>>> *
>>>>>> *
>>>>>> +1. We need to register it at app deployment level since otherwise we
>>>>>> will be creating new objects every time a request turns up. But it should
>>>>>> be made transparent to the developer (Without too much complexity (XML,
>>>>>> config files)).
>>>>>>
>>>>>> By the way, have you guys tried out load testing on jaggery? (This is
>>>>>> regarding the limitations of 
>>>>>> Rhino<http://chandventure.tumblr.com/post/48709679314/v8-and-the-fascination>
>>>>>> ).
>>>>>>
>>>>>> PS: I'll try to drop by 59 on Monday :D but I am not certain since we
>>>>>> are having an internal demo on Monday.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Sat, May 11, 2013 at 10:21 PM, Sanjeewa Malalgoda <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> On Sat, May 11, 2013 at 9:05 PM, Chan <[email protected]>wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> While developing the REST- API for the MDM backend we faced with a
>>>>>>>> dilemma of mapping URLs.
>>>>>>>>
>>>>>>>> We have a module call 
>>>>>>>> Router<https://gist.github.com/dulichan/62f3d49d1fe40a11b4c7#file-router-jsa>that
>>>>>>>>  will take the request object and traverse through a set of routes to
>>>>>>>> match the give REST API call. Seamless mapping of URL, method and data
>>>>>>>> occurs underneath the module.
>>>>>>>>
>>>>>>> Just to clarify, why we cant achieve this by using synapse rest
>>>>>>> support and uri template module?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sanjeewa.
>>>>>>>
>>>>>>>>
>>>>>>>> Compared to the previous style (used in the Coffeeshop 
>>>>>>>> example<https://gist.github.com/dulichan/62f3d49d1fe40a11b4c7#file-previousstyle-js>)
>>>>>>>> the new 
>>>>>>>> style<https://gist.github.com/dulichan/62f3d49d1fe40a11b4c7#file-gistfile1-js>using
>>>>>>>>  the Router module is much cleaner and easier to use.
>>>>>>>>
>>>>>>>> Using the Router module - a route mapped would look like below -
>>>>>>>>  jbj.route('users/{userid}|GET',function(ctx){});
>>>>>>>>
>>>>>>>> Later improvement were done according to Gayan where we need to
>>>>>>>> handle three types of data -POST raw data, GET parameter data and POST 
>>>>>>>> JSON
>>>>>>>> data. The initial idea to develop the component is from 
>>>>>>>> sinatra<http://www.sinatrarb.com/intro.html>
>>>>>>>> .
>>>>>>>>
>>>>>>>> What are your thoughts about this routing module for jaggery?
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>> --
>>>>>>>> Chan (Dulitha Wijewantha)
>>>>>>>> Software Engineer - Mobile Development
>>>>>>>> WSO2Mobile
>>>>>>>> Lean.Enterprise.Mobileware
>>>>>>>>  * ~Email       [email protected]*
>>>>>>>> *  ~Mobile     +94712112165*
>>>>>>>> *  ~Website   dulithawijewantha.com
>>>>>>>> *
>>>>>>>> *  ~Blog         blog.dulithawijewantha.com
>>>>>>>> *
>>>>>>>> *  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Architecture mailing list
>>>>>>>> [email protected]
>>>>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Sanjeewa Malalgoda*
>>>>>>> WSO2 Inc.
>>>>>>> Mobile : +14084122175 | +94713068779
>>>>>>>
>>>>>>>  <http://sanjeewamalalgoda.blogspot.com/>blog
>>>>>>> :http://sanjeewamalalgoda.blogspot.com/<http://sanjeewamalalgoda.blogspot.com/>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Architecture mailing list
>>>>>>> [email protected]
>>>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Chan (Dulitha Wijewantha)
>>>>>> Software Engineer - Mobile Development
>>>>>> WSO2Mobile
>>>>>> Lean.Enterprise.Mobileware
>>>>>>  * ~Email       [email protected]*
>>>>>> *  ~Mobile     +94712112165*
>>>>>> *  ~Website   dulithawijewantha.com
>>>>>> *
>>>>>> *  ~Blog         blog.dulithawijewantha.com
>>>>>> *
>>>>>> *  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
>>>>>>
>>>>>> _______________________________________________
>>>>>> Architecture mailing list
>>>>>> [email protected]
>>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Thanks & Regards,
>>>>>
>>>>> Nuwan Bandara
>>>>> Associate Technical Lead & Member, MC, Development Technologies
>>>>> WSO2 Inc. - lean . enterprise . middleware |  http://wso2.com
>>>>> blog : http://nuwanbando.com; email: [email protected]; phone: +94 11
>>>>> 763 9629
>>>>> *
>>>>> <http://www.nuwanbando.com/>
>>>>>
>>>>> _______________________________________________
>>>>> Architecture mailing list
>>>>> [email protected]
>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Sanjiva Weerawarana, Ph.D.
>>>> Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
>>>> email: [email protected]; phone: +94 11 763 9614; cell: +94 77 787 6880| +1
>>>> 650 265 8311
>>>> blog: http://sanjiva.weerawarana.org/
>>>>
>>>> Lean . Enterprise . Middleware
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> [email protected]
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards,
>>>
>>> Nuwan Bandara
>>> Associate Technical Lead & Member, MC, Development Technologies
>>> WSO2 Inc. - lean . enterprise . middleware |  http://wso2.com
>>> blog : http://nuwanbando.com; email: [email protected]; phone: +94 11 763
>>> 9629
>>> *
>>> <http://www.nuwanbando.com/>
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Chan (Dulitha Wijewantha)
>> Software Engineer - Mobile Development
>> WSO2Mobile
>> Lean.Enterprise.Mobileware
>>  * ~Email       [email protected]*
>> *  ~Mobile     +94712112165*
>> *  ~Website   dulithawijewantha.com
>> *
>> *  ~Blog         blog.dulithawijewantha.com
>> *
>> *  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Chintana Wilamuna
> Senior Technical Lead
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> phone: +94 72 145 4545
> blog: http://engwar.com/
> photos: http://flickr.com/photos/chintana
> linkedin: http://www.linkedin.com/in/engwar
> twitter: twitter.com/std_err
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>

<<33A.gif>>

_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to