RE: Can @SpringBeans be optional?

2009-11-24 Thread Loritsch, Berin C.
Understood. Just introducing it as a possibility. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Monday, November 23, 2009 3:40 PM To: users@wicket.apache.org Subject: Re: Can @SpringBeans be optional? That's not a dependency injection thing. It's

Re: Can @SpringBeans be optional?

2009-11-24 Thread James Carman
at 7:59 AM, Loritsch, Berin C. berin.lorit...@gd-ais.com wrote: Understood.  Just introducing it as a possibility. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Monday, November 23, 2009 3:40 PM To: users@wicket.apache.org Subject: Re: Can

Re: Can @SpringBeans be optional?

2009-11-23 Thread Igor Vaynberg
not right now. you can always file an rfe to add something like @SpringBean(optional=true) -igor On Mon, Nov 23, 2009 at 3:46 AM, Anthony DePalma fatef...@gmail.com wrote: Often with spring I give some of my services extra features if they are configured in the xml for it, but otherwise if

Re: Can @SpringBeans be optional?

2009-11-23 Thread Martijn Dashorst
Define a getter for your service that returns null by default, and in your Spring enabled session return the injected bean. Martijn On Mon, Nov 23, 2009 at 12:46 PM, Anthony DePalma fatef...@gmail.com wrote: Often with spring I give some of my services extra features if they are configured in

RE: Can @SpringBeans be optional?

2009-11-23 Thread Loritsch, Berin C.
Technically speaking from the Dependency Injection koolaid doctrine, the best way to solve the problem is to have a null implementation of your service that does nothing. The code you are writing doesn't have to have complex if/else logic as it's able to assume the service is always there. The

Re: Can @SpringBeans be optional?

2009-11-23 Thread James Carman
That's not a dependency injection thing. It's a design pattern called the Null Object pattern. On Mon, Nov 23, 2009 at 12:38 PM, Loritsch, Berin C. berin.lorit...@gd-ais.com wrote: Technically speaking from the Dependency Injection koolaid doctrine, the best way to solve the problem is to have