My take on spring integration is that it should only work if you use
the web page factory.  If you instantiate the pages directly using a
custom constructor, you should be expected to pass in the needed
service.  This follows the Good Citizen Pattern
(http://www.picocontainer.org/Good+Citizen) and reduces the "magic"
involved.

The spring integration should also handle serialization/deserialization...

On 10/26/05, Joni Suominen <[EMAIL PROTECTED]> wrote:
> On Tue, 2005-10-25 at 18:41 +0200, Stefan Arentz wrote:
> > Better idea! Add some AOP and annotation magic to the mix!
> >
> >   public class HelloWorldWebPage extends WebPage
> >   {
> >       @SpringBeanReference("dutchHelloWorldService")
> >       private transient HelloWorldService helloWorldService;
> >
> >       public void setHelloWorldService(HelloWorldService
> > helloWorldService)
> >       {
> >           this.helloWorldService = helloWorldService;
> >       }
> >
> >       public HelloWorldWebPage()
> >       {
> >           add(new Label("message", this.helloWorldService.getMessage
> > ()));
> >       }
> >   }
> >
> > I'm using all standard Wicket classes. No weird mixing of Spring
> > specific classes into the hierarchy.
>
> This is very cool stuff! This is IMO just the way how spring integration
> should be done (transient fields, IOC + reinjection at proper places). I
> have one question though. Is it still possible to instantiate these
> components normally so that there's no AOP magic behind? When writing
> unit tests there's normally no spring context available. The service
> mocks are manually wired instead.
>
> --
> Joni Suominen <[EMAIL PROTECTED]>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to