Hi Godwin,

IMO keeping the business logic separate from the services will be more
appropriate. So that you can change the business logic later without
breaking the service contract.

Thanks,

Lakshitha Harshan
Software Engineer
Mobile: *+94724423048*
Email: hars...@wso2.com
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com <http://wso2.com/>*
lean.enterprise.middleware.

On Fri, Nov 14, 2014 at 11:29 AM, Godwin Amila Shrimal <god...@wso2.com>
wrote:

> Hi All,
>
> Thanks for the feedback, I think I described it wrongly, I didn't
> mentioned 3 options to do this, I mentioned 3 steps to overcome the issue.
> Sorry for my bad.
>
> @Sameera : As you have mentioned we'll be have issues when admin services
> use axis2 context hierarchy e.g. MessageContext, properties set in
> Handlers etc, In that case what is the best way to implement, Do we have to
> keep separate business logic implementations for OSGIService and
> AdminService ?
>
>
> Thanks
> Godwin
>
>
>
>
> On Fri, Nov 14, 2014 at 11:22 AM, Sameera Jayasoma <same...@wso2.com>
> wrote:
>
>> Hi Godwin,
>>
>> We tried the approach sometime back, but had to drop this coz of some
>> complexities.
>> *  Some admin services needs to access the axis2 context hierarchy e.g.
>> MessageContext, properties set in Handlers etc.   So you cannot put all
>> business logic to a OSGi Service.
>> * Admin services can define permissions required to access them and the
>> Security handlers checks whether the user is allowed access admin
>> services.  OSGi services which gives the same functionality as admin
>> services allows components to use them freely without and security
>> restrictions. AFAIR we faced such issues sometime back.
>>
>> This approach is okay for some OSGi services/admin services, but not for
>> all. So we need to carefully think before exposing an Admin service as an
>> OSGi service.
>>
>> Thanks,
>> Sameera.
>>
>> On Thu, Nov 13, 2014 at 10:36 PM, Godwin Amila Shrimal <god...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> We have Admin Services in carbon products which are needed to access as
>>> OSGI Services in the carbon context. Most of the time in Admin Services, it
>>> check weather user is authorized in the method, So we cannot register same
>>> Admin Service as a OSGI Service and access it. Since there are cases user
>>> is not authorized when we access as a OSGI Service. What is the best way to
>>> reuse the code and create OSGI Service and Admin Service.
>>>
>>> After discussing with some folks, i thought following mechanism to
>>> implement it.
>>>
>>> 1. Create an interface for the Service
>>> 2. Create an Implementation as OSGI Service
>>> 3. Create Admin Service which reuse the OSGI Service and apply
>>> additional security. (Here there will be no business logic and additional
>>> security will only applied.)
>>>
>>>
>>> Please give feedback on this.
>>>
>>>
>>> Thanks
>>> Godwin
>>>
>>>
>>>
>>> --
>>> *Godwin Amila Shrimal*
>>> Senior Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: *+94772264165*
>>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>>> twitter: https://twitter.com/godwinamila
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Sameera Jayasoma,
>> Software Architect,
>>
>> WSO2, Inc. (http://wso2.com)
>> email: same...@wso2.com
>> blog: http://sameera.adahas.org
>> twitter: https://twitter.com/sameerajayasoma
>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>> Mobile: 0094776364456
>>
>> Lean . Enterprise . Middleware
>>
>>
>> _______________________________________________
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> *Godwin Amila Shrimal*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
> twitter: https://twitter.com/godwinamila
>
> _______________________________________________
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to