Hi,

*Just to clarify, why we cant achieve this by using synapse rest
supportand 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

Reply via email to