Re: the preferred way to inject to model objects

2009-06-28 Thread Igor Vaynberg
james was referring to salve.googlecode.com

-igor

On Sun, Jun 28, 2009 at 5:42 AM, Eyal Golan wrote:
> thanks for the response.
> I'm not sure I understood it completely :) but I'll use the SpringBean for
> now.
>
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
> On Thu, Jun 25, 2009 at 2:07 PM, James Carman
> wrote:
>
>> You could use Salve (beat you to it, Igor!).  Or, you can use AspectJ
>> along with @Configurable/@Autowired.  The reason we have to use
>> @SpringBean and not @Configurable in Wicket is that usually the
>> reference to the injected bean is "passed around" to other places.
>> Spring doesn't handle the deserialization of these passed-around beans
>> very well (it only instruments the @Configurable class with AspectJ
>> and they don't inject proxies that are smart enough to deserialize
>> themselves properly).  In the case of a domain entity, I would doubt
>> you'd be passing the reference around that much.
>>
>> On Thu, Jun 25, 2009 at 5:08 AM, Eyal Golan  wrote:
>> >
>> > Hi,
>> > Usually I inject to object models (Spring) with the Injector Holder
>> > facility:
>> >   �...@springbean
>> >    private ExtractionManager extractionManager;
>> >
>> > and in the constructor:
>> >    InjectorHolder.getInjector().inject(this);
>> >
>> > I saw in the book WIA (sorry, I don't remember where exactly. Even after
>> > looking), that the bean is passed in order to have less memory (pointers)
>> or
>> > something like this.
>> >
>> > So my question is:
>> > Suppose I have a POJO class that is the model and I need to use a bean
>> > service.
>> > Should I inject as above, or should I pass the bean as a parameter form
>> the
>> > component (that the bean was injected there).
>> >
>> > Thanks,
>> >
>> > Eyal Golan
>> > egola...@gmail.com
>> >
>> > Visit: http://jvdrums.sourceforge.net/
>> > LinkedIn: http://www.linkedin.com/in/egolan74
>> >
>> > P  Save a tree. Please don't print this e-mail unless it's really
>> necessary
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: the preferred way to inject to model objects

2009-06-28 Thread Eyal Golan
thanks for the response.
I'm not sure I understood it completely :) but I'll use the SpringBean for
now.


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Thu, Jun 25, 2009 at 2:07 PM, James Carman
wrote:

> You could use Salve (beat you to it, Igor!).  Or, you can use AspectJ
> along with @Configurable/@Autowired.  The reason we have to use
> @SpringBean and not @Configurable in Wicket is that usually the
> reference to the injected bean is "passed around" to other places.
> Spring doesn't handle the deserialization of these passed-around beans
> very well (it only instruments the @Configurable class with AspectJ
> and they don't inject proxies that are smart enough to deserialize
> themselves properly).  In the case of a domain entity, I would doubt
> you'd be passing the reference around that much.
>
> On Thu, Jun 25, 2009 at 5:08 AM, Eyal Golan  wrote:
> >
> > Hi,
> > Usually I inject to object models (Spring) with the Injector Holder
> > facility:
> >@SpringBean
> >private ExtractionManager extractionManager;
> >
> > and in the constructor:
> >InjectorHolder.getInjector().inject(this);
> >
> > I saw in the book WIA (sorry, I don't remember where exactly. Even after
> > looking), that the bean is passed in order to have less memory (pointers)
> or
> > something like this.
> >
> > So my question is:
> > Suppose I have a POJO class that is the model and I need to use a bean
> > service.
> > Should I inject as above, or should I pass the bean as a parameter form
> the
> > component (that the bean was injected there).
> >
> > Thanks,
> >
> > Eyal Golan
> > egola...@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: the preferred way to inject to model objects

2009-06-25 Thread Igor Vaynberg
pfft :)

-igor

On Thu, Jun 25, 2009 at 4:07 AM, James
Carman wrote:
> You could use Salve (beat you to it, Igor!).  Or, you can use AspectJ
> along with @Configurable/@Autowired.  The reason we have to use
> @SpringBean and not @Configurable in Wicket is that usually the
> reference to the injected bean is "passed around" to other places.
> Spring doesn't handle the deserialization of these passed-around beans
> very well (it only instruments the @Configurable class with AspectJ
> and they don't inject proxies that are smart enough to deserialize
> themselves properly).  In the case of a domain entity, I would doubt
> you'd be passing the reference around that much.
>
> On Thu, Jun 25, 2009 at 5:08 AM, Eyal Golan  wrote:
>>
>> Hi,
>> Usually I inject to object models (Spring) with the Injector Holder
>> facility:
>>   �...@springbean
>>    private ExtractionManager extractionManager;
>>
>> and in the constructor:
>>    InjectorHolder.getInjector().inject(this);
>>
>> I saw in the book WIA (sorry, I don't remember where exactly. Even after
>> looking), that the bean is passed in order to have less memory (pointers) or
>> something like this.
>>
>> So my question is:
>> Suppose I have a POJO class that is the model and I need to use a bean
>> service.
>> Should I inject as above, or should I pass the bean as a parameter form the
>> component (that the bean was injected there).
>>
>> Thanks,
>>
>> Eyal Golan
>> egola...@gmail.com
>>
>> Visit: http://jvdrums.sourceforge.net/
>> LinkedIn: http://www.linkedin.com/in/egolan74
>>
>> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: the preferred way to inject to model objects

2009-06-25 Thread James Carman
You could use Salve (beat you to it, Igor!).  Or, you can use AspectJ
along with @Configurable/@Autowired.  The reason we have to use
@SpringBean and not @Configurable in Wicket is that usually the
reference to the injected bean is "passed around" to other places.
Spring doesn't handle the deserialization of these passed-around beans
very well (it only instruments the @Configurable class with AspectJ
and they don't inject proxies that are smart enough to deserialize
themselves properly).  In the case of a domain entity, I would doubt
you'd be passing the reference around that much.

On Thu, Jun 25, 2009 at 5:08 AM, Eyal Golan  wrote:
>
> Hi,
> Usually I inject to object models (Spring) with the Injector Holder
> facility:
>   �...@springbean
>    private ExtractionManager extractionManager;
>
> and in the constructor:
>    InjectorHolder.getInjector().inject(this);
>
> I saw in the book WIA (sorry, I don't remember where exactly. Even after
> looking), that the bean is passed in order to have less memory (pointers) or
> something like this.
>
> So my question is:
> Suppose I have a POJO class that is the model and I need to use a bean
> service.
> Should I inject as above, or should I pass the bean as a parameter form the
> component (that the bean was injected there).
>
> Thanks,
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



the preferred way to inject to model objects

2009-06-25 Thread Eyal Golan
Hi,
Usually I inject to object models (Spring) with the Injector Holder
facility:
@SpringBean
private ExtractionManager extractionManager;

and in the constructor:
InjectorHolder.getInjector().inject(this);

I saw in the book WIA (sorry, I don't remember where exactly. Even after
looking), that the bean is passed in order to have less memory (pointers) or
something like this.

So my question is:
Suppose I have a POJO class that is the model and I need to use a bean
service.
Should I inject as above, or should I pass the bean as a parameter form the
component (that the bean was injected there).

Thanks,

Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary