reposting...

igor.vaynberg wrote:
> this is nice.
>
> what i do like about it
> * you can inject anything anywhere
>
> what i dont like is
> * post constructor injection like youve mentioned - delegate or not 
 > it still sucks, a different pointcut is needed
yes .. that's ugly. I have posted a question on spring forum - have no
answer yet (will also try on aspectj lists)

> * you have to keep your variables transient - very easy mistake to make,
> otherwise big boo boo might happen if the dependency is serializable 
 > and you wont know until much later
Why would you want your services serializable?

> * you have to inject everything - ie i cant take an instance of injected
> service and pass it to some other component to use
Do you really need to pass the service if you could just inject it also
into target?

> * i dont like @Configure on the entire object, i like per-field 
 > annotations on the fields
that is probably the matter of taste. @Configurable gives you 2 work modes:

- the ability to autowire all setters by type or name:
@Configurable(autowire=Autowire.BY_NAME)

- injection configuration from a "prototype"
@Configurable
public class MyModel {
     private FooService fooService;

     //setter here
}

and in applicationContext :
<bean class="com.mycompany.MyModel" scope="prototype">
    <!-- do any injection types you like -->
</bean>

In the second mode you can mix different injection types so it doesn't
really matter the annotation is defined at class level.

I do not know if it is possible to configure AOP with field level
annotations.

> * you have to have access to the java runtime args to install the weaver
not really. You can weave your classes 3 different ways:

- LTW - Load-Time Weaving, the classes are weaved as they are loaded at
runtime. This is the only one that requires java agent configuration on
command line

- aspectj compiler - compile your classes with special compiler. As the
compiler extends standard JDT compiler you can use it on any classes
(not only those to be weaved). For those using maven there is a special
plugin utilising aspectj compiler.

- aspectj weaver - even if you have no access to java source you can
weave .class files or whole jars that you compiled with standard compiler.

> what is needed to fix this
> * a different aspect that wraps the bean in the wicket-proxy just 
 > like we do now - that should give you the ultimate freedom,
agreed, I will investigate the problem further

 > but then what worries me is
> if tomcat will let you cluster objects loaded through aspectj 
 > classloader.
I do not think this will be a problem when offline weaving is used. The
class is loaded just as an ordinary class. Needs testing though.

-- 
Leszek Gawron
[EMAIL PROTECTED]



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to