It might help if you can come up with a more specific use case. What does
LoggerAspect actually do? And what does SecurityAspect actually do? And
how is it dependent on LoggerAspect?
So in type 3 form,
public class LoggerAspectImpl implements LoggerAspect {
public LoggerAspectImpl(Logger logger) {
//whatever...
}
//whatever...
}
public class SecurityAspectImpl implements SecurityAspect {
public SecurityAspectImpl(Logger logger) {
//whatever...
}
//whatever...
}
I'm just trying to understand the issue. LoggerAspect and SecurityAspect
want to use the same Logger service? Is this it?
----- Original Message -----
From: "Hamilton Verissimo de Oliveira (Engenharia - SPO)"
<[EMAIL PROTECTED]>
To: "Avalon Developers List" <[EMAIL PROTECTED]>
Sent: Monday, March 08, 2004 12:33 PM
Subject: Re: State of the Aspect
> > So I'm close to just disallowing any explicit dependencies.
>
> Do you see any possiblity of dependencies that aren't loggers?
>
> So, instead of
>
> LoggerAspect loggerAspect = new LoggerAspectImpl( something );
> kernel.addAspect( loggerAspect );
>
> SecurityAspect secAspect = new SecurityAspectImpl( loggerAspect );
> kernel.addAspect( secAspect );
>
> We can have:
>
> LoggerAspect loggerAspect = new LoggerAspectImpl( something );
> kernel.addAspect( loggerAspect );
>
> SecurityAspect secAspect = new SecurityAspectImpl(
> loggerAspect.getRootLogger() );
> kernel.addAspect( secAspect );
>
> ...
>
> public class SecurityAspectImpl implements SecurityAspect
> {
> public SecurityAspectImpl()
> {
> this( new NullLogger() );
> }
>
> public SecurityAspectImpl( Logger logger )
> {
> m_logger = logger;
> }
> }
>
> *or*
>
>
> public class SecurityAspectImpl extends AbstractLogEnabled implements
> SecurityAspect
> {
> public SecurityAspectImpl()
> {
> this( new NullLogger() );
> }
>
> public SecurityAspectImpl( Logger logger )
> {
> enableLogging( logger );
> }
> }
>
>
> --
> hammett
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]