It depends on the applications, users invoke Isuru.

If users invoke all the apps then we end up fetching all the apps by the
handler instances for the apps (synapse APIs). ( A handler instance only
fetched and stores only one app instance)

In the current implementation the fetch happens on demand.


On Thu, Aug 18, 2016 at 9:18 AM, Isuru Udana <[email protected]> wrote:

> Hi Rushmin,
>
> Do we need to fetch domain objects from the database for all the
> applications or is it only for a set of applications ?
>
>
>
> On Tue, Aug 16, 2016 at 1:35 PM, Rushmin Fernando <[email protected]>
> wrote:
>
>>
>> In App Manager we use carbon mediation engine as the gateway. Thus the
>> business logic is implemented in few handlers.
>>
>> In order to code business logic, we need to fetch domain objects from the
>> database via a service. The primary domain object the "webapp' object.
>>
>> (Please see the attached image)
>>
>> In the current implementation, we have made the webapp object, an
>> instance variable of the handlers. Since the handlers are instantiated per
>> API (represents an app in our case), this works fine.
>>
>> Upon the first call to the app, we fetch the relevant webapp object and
>> store it as the aforementioned instance variable.
>>
>> Since there are more than one handlers which need to deal with the webapp
>> object we need to do above step in each of those handlers.
>>
>> We are thinking of having an init handler which does the service call and
>> fetch the domain object and share it with the other handlers in the chain.
>> The purspose of evaluating this is to, increase the code maintainability
>> and improve the performance to some extent.
>>
>> In order to do that we need to have the domain object in the message
>> context. But then again consume a lot of memory when there is a high load.
>>
>> One solution to above issue to create a new thin domain object with only
>> the necessary fields for the gateway.
>>
>> Thoughts please ?
>>
>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc. <http://wso2.com/> - Lean . Enterprise . Middleware
>>
>> mobile : +94772891266
>>
>>
>>
>
>
> --
> *Isuru Udana*
> Technical Lead
> WSO2 Inc.; http://wso2.com
> email: [email protected] cell: +94 77 3791887
> blog: http://mytecheye.blogspot.com/
>



-- 
*Best Regards*

*Rushmin Fernando*
*Technical Lead*

WSO2 Inc. <http://wso2.com/> - Lean . Enterprise . Middleware

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

Reply via email to