I am +1 to even removing the resource aspect from jaggery conf routing. We
need to encourage people to write the routes with in the app rather than
outside of the app (kinda of how node works). This method is much more
preferable compared to JSP way of routing (web.xml).


On Mon, Feb 10, 2014 at 10:23 AM, Madhuka Udantha <[email protected]> wrote:

> Hi,
>
>
>
> We will have default mode(current way) and it want violate "resource"
> aspect as it was.
>
> With proposed architecture routing can be taken out from jaggery core.
>
> When you define your routing module in the application.serve() It will not
> violate "resource" aspect.
>
>
>
> Thanks
>
>
> On Fri, Feb 7, 2014 at 6:03 PM, Samisa Abeysinghe <[email protected]> wrote:
>
>> Does this not violate "resource" aspect?
>>
>>  Thanks,
>> Samisa...
>>
>>
>> Samisa Abeysinghe
>>
>> Vice President Developer Evangelism
>>
>> WSO2 Inc.
>> http://wso2.com
>>
>>
>>
>> On Fri, Feb 7, 2014 at 5:49 PM, Madhuka Udantha <[email protected]> wrote:
>>
>>> In jaggery web request can be served by from .jag/.js (File). We have
>>> noticed It is important to serve web request from the JS function rather
>>> resource file such as (*.jag).
>>>
>>>
>>>
>>> *Use case*
>>>
>>>
>>>
>>> - User go to (send web request to) http://10.100.1.112:9763/testapp/
>>>
>>> - Jaggery will check URL mapping that is define in jaggery.conf[2] in
>>> 'testapp' and get resource path (jaggery file) to server.
>>>
>>> eg: Here is sample url mapping configuration in current jaggery.
>>>
>>>
>>>
>>> *"urlMappings" : [*
>>>
>>> *                          {*
>>>
>>> *                                "url" : "/foo/*",*
>>>
>>> *                                "path" : "foo/index.jag"*
>>>
>>> *                          },*
>>>
>>> *                          {*
>>>
>>> *                                 "url" : "/bar/test/",*
>>>
>>> *                                 "path" : "/private.jag"*
>>>
>>> *                          }*
>>>
>>> *                ],*
>>>
>>>
>>>
>>>
>>> *Problem*
>>>
>>>
>>>    - If jaggery application developer need to serve his/her user web
>>>    request from function rather from file.
>>>    - (With currently jaggery is not possible achieve this)
>>>
>>>
>>>
>>> *Solution*
>>>
>>>
>>>    - We will introduce new function for global scope of the
>>>    application, such as called application.serve(Function function)
>>>    - If application.serve defined in 'initScripts' for jaggery
>>>    application all the request that coming to that application will be 
>>> served
>>>    by that function.
>>>    - If application.serve is not defined in 'initScripts'. It will work
>>>    as current way by looking on "urlMappings"
>>>    - Therefore this change will not effect for existing jaggery
>>>    application/application deployment also.
>>>    - Routing logic (Can be used 3rd party) can be implemented in this
>>>    function and this will be much user friendly for jaggery developers.
>>>
>>>
>>>
>>> *[NOTE]*
>>>
>>>
>>>    - Since this solution used application[1](Global scope). We will
>>>    have to fixed thread safety[3] in jaggery for global scope.
>>>    - This solution will help full for front end controller concept and
>>>    improving REST service APIS in jaggery.
>>>
>>> [1] http://jaggeryjs.org/apidocs/application.jag
>>>
>>> [2] http://jaggeryjs.org/apidocs/jagconf.jag
>>>
>>> [3]
>>> http://madhukaudantha.blogspot.com/2014/02/introducing-sync-for-jaggery-javascript.html
>>>
>>> --
>>> *Madhuka* Udantha
>>> Senior Software Engineer
>>> Development Technologies
>>> WSO2 Inc. : http://wso2.com
>>>
>>> *Mobile*: +94774066336
>>> *Blog*: http://madhukaudantha.blogspot.com/
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> *Madhuka* Udantha
> Senior Software Engineer
> Development Technologies
> WSO2 Inc. : http://wso2.com
>
> *Mobile*: +94774066336
> *Blog*: http://madhukaudantha.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] <[email protected]>*
*  ~Mobile     +94712112165*

*  ~Website   dulithawijewantha.com <http://dulithawijewantha.com/>*

*  ~Blog         blog.dulithawijewantha.com
<http://dulichan.github.io/chan/>*
*  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to