there are a couple of things i personally dont like about it
1) @Configurable is a type-level annotation. so if you want any control over
what is injected you have to declare it in the applicationcontext. i have a
ton of pages and components that get injected and i would really hate to
have to maintain that in xml if i dont have to. relying on autowiring doesnt
always work because you often have two things of the same type in the
context or the fieldname doesnt match the bean name for readability
purposes.
2) you have to make the deps transient. the nice thing about wicket-spring
proxies is that you can pass injected services as if they were regular java
objects, so other components/objects can safely keep a reference to them in
any way possible. eg you can have constructs like this:
class UsersDataProvider extends SortableDataProvider {
private UserService us;
public UsersDataProvider(UserService us) { this.us=us;}
public int count() { return us.countusers(); }
...
}
just my 2c, at the end its whatever works best for you
-igor
On 3/23/07, Carlos Pita <[EMAIL PROTECTED]> wrote:
Hi all,
I'm very new to Wicket (with no more than a few hours of fly). I would
like to integrate it with the spring AplicationContext/BeanFactory so I've
been reading the solutions described in
http://www.wicket-wiki.org.uk/wiki/index.php/Spring. I've nothing to
object to them but I think it would be possible to get the integration by
means of the @Configurable annotation that spring 2 offers too. This
annotation injects dependencies upon bean instantiation (ie. with new) based
on a prototype scope bean definition. Also from version 2.0.3 onwards this
annotation would inject dependencies after deserialization as described in
this jira: http://opensource.atlassian.com/projects/spring/browse/SPR-2896
. So you can declare your dependencies as transient and expect them to be
injected at instantiation-time and at deserialization-time. Weaving can be
done at compile-time and at loading-time. If you are already using aspectj
with spring, for example for domain object dependency injection, you won't
need extra stuff to make it inject Wicket pages' properties. I have written
a toy example of this approach and it seems to work fine. What do you think?
Maybe I'm missing something.
Cheers,
Carlos
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user