You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by is_maximum <mn...@gmail.com> on 2009/03/17 12:49:33 UTC

need suggestion on designing business interfaces

Hi
before I start let me tell you that our problem is the interceptors
Think of a bunch of business interfaces and lots of business methods. Each
method may call a dozen methods from other services.
In the other hand because of some policy we have to put some interceptors on
our methods, one example is an interceptor which is responsible for log all
the incoming parameters. (sadly we need to log everything) 

Now the problem is when method M1 from interface S1 calls methods M2 and M3
and M4 from S2, S3, S4 respectively because each method may be called
directly by the client so all the methods have the same interceptor C1 (say
to log the parameter), now we want no interceptor being invoked from other
services when they are called locally from another business method unless
they are called directly from the client

One solution is to define a local method and a remote method and the later
marked with required interceptors and also remote methods calls local
methods.

Another solution is using Facade pattern but we are reluctant to use this
pattern since we have implemented services and no time for further task.

I am eager to hear your idea and know your experience on this problem

thanks



-----
--
Regards

Mohammad Norouzi

Help each other to reach the future faster

http://pixelshot.wordpress.com Pixelshot Photoblog 

http://brainable.blogspot.com Brainable Blog 


-- 
View this message in context: http://www.nabble.com/need-suggestion-on-designing-business-interfaces-tp22557484p22557484.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: need suggestion on designing business interfaces

Posted by David Blevins <da...@visi.com>.
On Mar 17, 2009, at 4:49 AM, is_maximum wrote:

>
> Hi
> before I start let me tell you that our problem is the interceptors
> Think of a bunch of business interfaces and lots of business  
> methods. Each
> method may call a dozen methods from other services.
> In the other hand because of some policy we have to put some  
> interceptors on
> our methods, one example is an interceptor which is responsible for  
> log all
> the incoming parameters. (sadly we need to log everything)
>
> Now the problem is when method M1 from interface S1 calls methods M2  
> and M3
> and M4 from S2, S3, S4 respectively because each method may be called
> directly by the client so all the methods have the same interceptor  
> C1 (say
> to log the parameter), now we want no interceptor being invoked from  
> other
> services when they are called locally from another business method  
> unless
> they are called directly from the client
>
> One solution is to define a local method and a remote method and the  
> later
> marked with required interceptors and also remote methods calls local
> methods.
>
> Another solution is using Facade pattern but we are reluctant to use  
> this
> pattern since we have implemented services and no time for further  
> task.
>
> I am eager to hear your idea and know your experience on this problem

Not sure I have any thoughts other than you could have the  
SessionContext injected (via @Resource) into the interceptor and then  
call the sessionContext.getInvokedBusinessInterface() method to see  
which interface was used by the client.

-David