Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-20 Thread Stefan Arentz
On 6/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 no, there are no problems with wicket-spring poject other then some people
 dont think its a true way to integrate with spring. sigh.

I have some more concrete issues with the current spring integration code.

First, it is intrusive. Instead of using hooks or interceptors it
requires a new class hierarchy. This is generally not a big deal but
it makes it difficult to pick 'extensions' and put them together. As a
concrete example; we have two great extensions available:
wicket-spring-annot and wicket-auth-roles. However since these are
both implemented in the Spring class hierarchy as subclasses of
WebApplication there is no way to put these together in one project.
You end up copy/pasting code to merge them in your own implementation.
This is rather silly.

The second problem I have with the current Spring code is that it just
works in a subset of Wicket objects. For example, I have just merged
auth-roles and spring-annot together for my current app and I
discovered that the @SpringBean annotation does not work inside my
subclass of the AuthenticatedWebSession. This is of course rather
silly because that is *the* place to talk to Spring and retrieve user
info through a DAO of some sort. This is something that AOP could
solve pretty well without the need of a whole Injector infrastructure
in the Wicket code.

What I really hope is that 2.0 will include strong support for AOP and
some kind of interceptor chain in the right place so that we can add
functionality like Spring and Authentication annotations more easily.
As I understand it the 2.0 release will be JSE 5 only, so a lot more
interesting things will be possible then.

 S.


___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-20 Thread Martijn Dashorst
The application issue is known
(http://sourceforge.net/tracker/index.php?func=detailaid=1458736group_id=119783atid=684975)
and won't be fixed in 1.2 as it will break backwards compatibility.

Could you file a RFE for the Session injector?

Martijn

On 6/20/06, Stefan Arentz [EMAIL PROTECTED] wrote:
 On 6/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
  no, there are no problems with wicket-spring poject other then some people
  dont think its a true way to integrate with spring. sigh.

 I have some more concrete issues with the current spring integration code.

 First, it is intrusive. Instead of using hooks or interceptors it
 requires a new class hierarchy. This is generally not a big deal but
 it makes it difficult to pick 'extensions' and put them together. As a
 concrete example; we have two great extensions available:
 wicket-spring-annot and wicket-auth-roles. However since these are
 both implemented in the Spring class hierarchy as subclasses of
 WebApplication there is no way to put these together in one project.
 You end up copy/pasting code to merge them in your own implementation.
 This is rather silly.

 The second problem I have with the current Spring code is that it just
 works in a subset of Wicket objects. For example, I have just merged
 auth-roles and spring-annot together for my current app and I
 discovered that the @SpringBean annotation does not work inside my
 subclass of the AuthenticatedWebSession. This is of course rather
 silly because that is *the* place to talk to Spring and retrieve user
 info through a DAO of some sort. This is something that AOP could
 solve pretty well without the need of a whole Injector infrastructure
 in the Wicket code.

 What I really hope is that 2.0 will include strong support for AOP and
 some kind of interceptor chain in the right place so that we can add
 functionality like Spring and Authentication annotations more easily.
 As I understand it the 2.0 release will be JSE 5 only, so a lot more
 interesting things will be possible then.

  S.


 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org


___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-20 Thread Igor Vaynberg
so far we only targetted the components being injected because that is what users asked for. its trivial to inject any object you wantclass MySession extends WebSession() {@SpringBean Foo bar; MySession() {
 InjectorHolder.getInjector().inject(this); ... }}-IgorOn 6/20/06, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
The application issue is known(http://sourceforge.net/tracker/index.php?func=detailaid=1458736group_id=119783atid=684975
)and won't be fixed in 1.2 as it will break backwards compatibility.Could you file a RFE for the Session injector?MartijnOn 6/20/06, Stefan Arentz 
[EMAIL PROTECTED] wrote: On 6/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:  no, there are no problems with wicket-spring poject other then some people
  dont think its a true way to integrate with spring. sigh. I have some more concrete issues with the current spring integration code. First, it is intrusive. Instead of using hooks or interceptors it
 requires a new class hierarchy. This is generally not a big deal but it makes it difficult to pick 'extensions' and put them together. As a concrete example; we have two great extensions available:
 wicket-spring-annot and wicket-auth-roles. However since these are both implemented in the Spring class hierarchy as subclasses of WebApplication there is no way to put these together in one project.
 You end up copy/pasting code to merge them in your own implementation. This is rather silly. The second problem I have with the current Spring code is that it just works in a subset of Wicket objects. For example, I have just merged
 auth-roles and spring-annot together for my current app and I discovered that the @SpringBean annotation does not work inside my subclass of the AuthenticatedWebSession. This is of course rather
 silly because that is *the* place to talk to Spring and retrieve user info through a DAO of some sort. This is something that AOP could solve pretty well without the need of a whole Injector infrastructure
 in the Wicket code. What I really hope is that 2.0 will include strong support for AOP and some kind of interceptor chain in the right place so that we can add functionality like Spring and Authentication annotations more easily.
 As I understand it the 2.0 release will be JSE 5 only, so a lot more interesting things will be possible then.S. ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
--Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- http://wicketframework.org___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-20 Thread Igor Vaynberg
or since we do use a factory for creating application/session objects you can write a factory that pulls the session out of spring context where it is declared as a prototype bean.-Igor
On 6/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
so far we only targetted the components being injected because that is what users asked for. its trivial to inject any object you wantclass MySession extends WebSession() {@SpringBean Foo bar; MySession() {
 InjectorHolder.getInjector().inject(this); ... }}-Igor
On 6/20/06, Martijn Dashorst
 [EMAIL PROTECTED] wrote:

The application issue is known(
http://sourceforge.net/tracker/index.php?func=detailaid=1458736group_id=119783atid=684975
)and won't be fixed in 1.2 as it will break backwards compatibility.Could you file a RFE for the Session injector?MartijnOn 6/20/06, Stefan Arentz 

[EMAIL PROTECTED] wrote: On 6/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
  no, there are no problems with wicket-spring poject other then some people
  dont think its a true way to integrate with spring. sigh. I have some more concrete issues with the current spring integration code. First, it is intrusive. Instead of using hooks or interceptors it
 requires a new class hierarchy. This is generally not a big deal but it makes it difficult to pick 'extensions' and put them together. As a concrete example; we have two great extensions available:
 wicket-spring-annot and wicket-auth-roles. However since these are both implemented in the Spring class hierarchy as subclasses of WebApplication there is no way to put these together in one project.
 You end up copy/pasting code to merge them in your own implementation. This is rather silly. The second problem I have with the current Spring code is that it just works in a subset of Wicket objects. For example, I have just merged
 auth-roles and spring-annot together for my current app and I discovered that the @SpringBean annotation does not work inside my subclass of the AuthenticatedWebSession. This is of course rather

 silly because that is *the* place to talk to Spring and retrieve user info through a DAO of some sort. This is something that AOP could solve pretty well without the need of a whole Injector infrastructure
 in the Wicket code. What I really hope is that 2.0 will include strong support for AOP and some kind of interceptor chain in the right place so that we can add functionality like Spring and Authentication annotations more easily.
 As I understand it the 2.0 release will be JSE 5 only, so a lot more interesting things will be possible then.S. ___

 Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user
--Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org___
Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-19 Thread Ramnivas Laddad




Re deserialization:
You can use getter-based dependency injection to solve this problem.
Every time, a dependency-injected field is accessed (or corresponding
getter method is executed -- your choice), an advise can re-inject the
dependencies. See
http://www.ibm.com/developerworks/java/library/j-aopwork13.html for
more details.

Re configuring too many objects:
You can use annotations (such as @Configured available with Spring
2.0), and then you can just define a prototype configuration in the
bean configuration file. You can implement the same functionality with
classes implementing an interface, if you prefer it over annotations. 

For example, here are a few beans that need an emailer as an injected
dependency:
@Configurable("emailClient")
public class OrderProcessor {
  private Emailer  emailer;  // property with getter and setter

  ... use emailer
}

@Configurable("emailClient")
public class ShipmentProcessor {
  private Emailer  emailer;  // property with getter and setter

  ... use emailer
}

You need only the following prototype definition in XML:
bean id="emailClient" lazy-init="true"
    property name="emailer" ref="smtpEmailer"/
/bean

This works out of box for constructor-based DI; but it is not hard to
write a getter-based implementation either.

-Ramnivas
===
Ramnivas Laddad,
Author, AspectJ in Action
http://ramnivas.com



Igor Vaynberg wrote:
no it wont be the solution. havent you guys been following
any of the other spring threads? injecting a component is not enough
because you never want those dependencies serialized - thus the whole
thing about wicket proxying the dependencies it injects.
  
  
you inject a service into a page's member variable. that page gets
serialized, the service gets serialized, the hibernate dao the service
references gets serialized, the hibernate session factory the dao
references gets serialized - now you have a huge mess. or worse, the
service is not serializable - you get an exception - the page never
makes it into session - nothing on the page works.
  
  
besides, the way i see it you have to declare the dependencies inside
the application context just like you would for any other bean, this
will get tedios. in the project i work on now we probably have more
then 100 components that get injected, i wouldnt want to have 100 bean
definitions in my application context. and maintainin @SpringBean
wicket annotations is a lot simpler.
  
  
-Igor
  
  
  On 6/16/06, Tom van Zummeren [EMAIL PROTECTED] wrote:
  



Hey,
 
I was there
as well, and I agree with you.
This could be the solution to all wicket-spring integration problems.
Now for
someone to actually try it…
 
Tom
 



From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
On Behalf Of Michiel
Trimpe
Sent: Friday, June
16, 2006 3:00
PM
To: wicket-user@lists.sourceforge.net
Subject:
[Wicket-user] Spring 2.0
 Domain object dependency injection



 
Hey everybody,
 
I've followed a few
discussions here on dependency
injection and when I was visiting the Spring 2.0 presentation at
J-Spring in
the Netherlands
there was one new feature that really drew my attention.
 
Spring 2.0 offers support
for dependency injection into
domain objects using AspectJ, and when I read the description (http://static.springframework.org/spring/docs/2.0-m5/spring-reference.pdf

, section 7.7.1) it sounds like this would be the perfect way to
implement
dependency injection with Wicket.
 
I hope that solves all
our problems …
 
Kind regards,
 
Michiel Trimpe
 
Michiel
Trimpe
| Java Developer| TomTom | [EMAIL PROTECTED]
| +31
(0)6 41482341mobile
 



This e-mail message contains information
which is confidential and may
be privileged. It is intended for use by the addressee only. If you are
not the
intended addressee, we request that you notify the sender immediately
and
delete or destroy this e-mail message and any attachment(s), without
copying,
saving, forwarding, disclosing or using its contents in any other way.
TomTom
N.V., TomTom International BV
or any other company belonging to the TomTom group of companies will
not be
liable for damage relating to the communication by e-mail of data,
documents or
any other information. 




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 
  

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 




___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user


  
  
  
  

___
Wicket-user mailing list

Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-16 Thread Tom van Zummeren








Hey,



I was there as well, and I agree with you.
This could be the solution to all wicket-spring integration problems. Now for
someone to actually try it



Tom











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michiel Trimpe
Sent: Friday, June 16, 2006 3:00
PM
To: wicket-user@lists.sourceforge.net
Subject: [Wicket-user] Spring 2.0
 Domain object dependency injection





Hey everybody,



Ive followed a few discussions here on dependency
injection and when I was visiting the Spring 2.0 presentation at J-Spring in
the Netherlands
there was one new feature that really drew my attention.



Spring 2.0 offers support for dependency injection into
domain objects using AspectJ, and when I read the description (http://static.springframework.org/spring/docs/2.0-m5/spring-reference.pdf
, section 7.7.1) it sounds like this would be the perfect way to implement
dependency injection with Wicket.



I hope that solves all our problems 



Kind regards,



Michiel Trimpe



Michiel Trimpe|Java Developer| TomTom | [EMAIL PROTECTED] | +31
(0)6 41482341mobile











This e-mail message contains information which is confidential and may
be privileged. It is intended for use by the addressee only. If you are not the
intended addressee, we request that you notify the sender immediately and
delete or destroy this e-mail message and any attachment(s), without copying,
saving, forwarding, disclosing or using its contents in any other way. TomTom
N.V., TomTom International BV
or any other company belonging to the TomTom group of companies will not be
liable for damage relating to the communication by e-mail of data, documents or
any other information. 










--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-16 Thread Eelco Hillenius
Heh. Let's define 'problem' too. Many people are using Spring and Wicket together without any problems (and I'm being one of them)?Anyway, if it solves new problems, we're always happy to hear about new ideas/ get contributions.EelcoOn Jun 16, 2006, at 6:49 AM, Tom van Zummeren wrote:Hey, I was there as well, and I agree with you. This could be the solution to all wicket-spring integration problems. Now for someone to actually try it… Tom From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Michiel Trimpe Sent: Friday, June 16, 2006 3:00 PM To: wicket-user@lists.sourceforge.net Subject: [Wicket-user] Spring 2.0  Domain object dependency injection  Hey everybody, I’ve followed a few discussions here on dependency injection and when I was visiting the Spring 2.0 presentation at J-Spring in the Netherlands there was one new feature that really drew my attention. Spring 2.0 offers support for dependency injection into domain objects using AspectJ, and when I read the description (http://static.springframework.org/spring/docs/2.0-m5/spring-reference.pdf , section 7.7.1) it sounds like this would be the perfect way to implement dependency injection with Wicket. I hope that solves all our problems … Kind regards, Michiel Trimpe Michiel Trimpe| Java Developer| TomTom | [EMAIL PROTECTED] | +31 (0)6 41482341mobile This e-mail message contains information which is confidential and may be privileged. It is intended for use by the addressee only. If you are not the intended addressee, we request that you notify the sender immediately and delete or destroy this e-mail message and any attachment(s), without copying, saving, forwarding, disclosing or using its contents in any other way. TomTom N.V., TomTom International BV or any other company belonging to the TomTom group of companies will not be liable for damage relating to the communication by e-mail of data, documents or any other information.-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006  -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006  ___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user ___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-16 Thread Igor Vaynberg
no it wont be the solution. havent you guys been following any of the other spring threads? injecting a component is not enough because you never want those dependencies serialized - thus the whole thing about wicket proxying the dependencies it injects.
you inject a service into a page's member variable. that page gets serialized, the service gets serialized, the hibernate dao the service references gets serialized, the hibernate session factory the dao references gets serialized - now you have a huge mess. or worse, the service is not serializable - you get an exception - the page never makes it into session - nothing on the page works.
besides, the way i see it you have to declare the dependencies inside the application context just like you would for any other bean, this will get tedios. in the project i work on now we probably have more then 100 components that get injected, i wouldnt want to have 100 bean definitions in my application context. and maintainin @SpringBean wicket annotations is a lot simpler.
-IgorOn 6/16/06, Tom van Zummeren [EMAIL PROTECTED] wrote:




















Hey,



I was there as well, and I agree with you.
This could be the solution to all wicket-spring integration problems. Now for
someone to actually try it…



Tom











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
On Behalf Of Michiel Trimpe
Sent: Friday, June 16, 2006 3:00
PM
To: wicket-user@lists.sourceforge.net
Subject: [Wicket-user] Spring 2.0
 Domain object dependency injection





Hey everybody,



I've followed a few discussions here on dependency
injection and when I was visiting the Spring 2.0 presentation at J-Spring in
the Netherlands
there was one new feature that really drew my attention.



Spring 2.0 offers support for dependency injection into
domain objects using AspectJ, and when I read the description (http://static.springframework.org/spring/docs/2.0-m5/spring-reference.pdf

, section 7.7.1) it sounds like this would be the perfect way to implement
dependency injection with Wicket.



I hope that solves all our problems …



Kind regards,



Michiel Trimpe



Michiel Trimpe
|Java Developer| TomTom | [EMAIL PROTECTED] | +31
(0)6 41482341mobile











This e-mail message contains information which is confidential and may
be privileged. It is intended for use by the addressee only. If you are not the
intended addressee, we request that you notify the sender immediately and
delete or destroy this e-mail message and any attachment(s), without copying,
saving, forwarding, disclosing or using its contents in any other way. TomTom
N.V., TomTom International BV
or any other company belonging to the TomTom group of companies will not be
liable for damage relating to the communication by e-mail of data, documents or
any other information. 










--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/366 - Release Date: 6/15/2006
 

___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-16 Thread karthik Guru
 This could be the solution to all wicket-spring integration problems. Now for
someone to actually try it…May be I haven't been actively reading the list and missed some relevant posts. Has someone found a problem with current wicket-spring integration?. 
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Spring 2.0 Domain object dependency injection

2006-06-16 Thread Igor Vaynberg
no, there are no problems with wicket-spring poject other then some people dont think its a true way to integrate with spring. sigh.what the quote below shouldve read was
 This could be the solution to all wicket - spring integration problems. Now for
someone to actually try it…-IgorOn 6/16/06, karthik Guru
 [EMAIL PROTECTED] wrote:
 This could be the solution to all wicket-spring integration problems. Now for
someone to actually try it…May be I haven't been actively reading the list and missed some relevant posts. Has someone found a problem with current wicket-spring integration?. 


___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user