Hi Igor, I see your points. Here's what I think about them.

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


Yes, you need one prototype bean definition for each injected page and/or
component. That's the spring way after all. You get all the power of
XmlApplicationContext (with which you can do more that vanilla injection) at
the expense of dealing with xmls.

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


But I have to be aware of the serializable nature of components anyway, so
it's not that bad to flag as transient the heavy dependencies or
collaborators that would interfere with effective session management. This
observation doesn't exclusively apply to injected dependencies but to any
serialization-reluctant associate of your component, although admittedly
spring-managed services and repositories will probably be the only ones in
this category.

Regarding freely passing references, I recognize I don't understand your
point. If your component exposes a property for a dependency it will get it
injected at instantiation-time and deserialization-time, so it won't need
the dependency to be handled down to it later. And if instead the component
get the dependency as an argument, it can safely use it in the context of
method execution.

Anyway I'm still not sure whether my proposal is technically correct or not.


just my 2c, at the end its whatever works best for you




Ditto :).

Cheers,
Carlos



-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


-------------------------------------------------------------------------
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

Reply via email to