using IOC in panels?
Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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: using IOC in panels?
I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Nino, Can you just @SpringBean or @Inject? Don't know if this is the pretties way as this might be a matter of personal taste;-) Enresto On Thu, Sep 23, 2010 at 10:14 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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: using IOC in panels?
You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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: using IOC in panels?
Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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: using IOC in panels?
but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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: using IOC in panels?
Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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: using IOC in panels?
ahh cool :) And thanks.. I know im spamming alot currently.. 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component *the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - 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: using IOC in panels?
Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
You don't need to have Wicket instantiate anything for you. The listener knows when you instantiate any component (Component's constructor does the magic). Just use @SpringBean in your panel and it will work. On Thu, Sep 23, 2010 at 6:07 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
I'd be curious to hear for what other classes you have in mind. You'll always need to call the instantiation listener at some point to invoke the injector. So simply implementing IInstantiable will not be enough to have injection magically work. I think the reason it's currently implemented the way it is, is that all components have a Component base class which can abstract behavior like this. In case you want dependency injection anywhere, you should take a look at something like Salve (http://code.google.com/p/salve/) Sebastian - Original Message - From: Ernesto Reinaldo Barreiro reier...@gmail.com To: users@wicket.apache.org Sent: Thursday, September 23, 2010 12:07 PM Subject: Re: using IOC in panels? Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - 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
Re: using IOC in panels?
On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
James, I think know how it works: I was just wondering if it can be extended for other types of objects and how useful it could be. Ernesto On Thu, Sep 23, 2010 at 12:09 PM, James Carman ja...@carmanconsulting.com wrote: You don't need to have Wicket instantiate anything for you. The listener knows when you instantiate any component (Component's constructor does the magic). Just use @SpringBean in your panel and it will work. On Thu, Sep 23, 2010 at 6:07 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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 - 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: using IOC in panels?
Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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: using IOC in panels?
So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
what about custom IModel impls ? it will work automatically for all IModel impls provided by Wicket, but will not work for custom ones. And then the users will start creating tickets ... On Thu, Sep 23, 2010 at 12:16 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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: using IOC in panels?
Some Models maybe? Right now I have a few of them where I have InjectorHolder.getInjector().inject(this); But maybe you are right and this out of Wicket's scope. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, Bas Gooren b...@iswd.nl wrote: I'd be curious to hear for what other classes you have in mind. You'll always need to call the instantiation listener at some point to invoke the injector. So simply implementing IInstantiable will not be enough to have injection magically work. I think the reason it's currently implemented the way it is, is that all components have a Component base class which can abstract behavior like this. In case you want dependency injection anywhere, you should take a look at something like Salve (http://code.google.com/p/salve/) Sebastian - Original Message - From: Ernesto Reinaldo Barreiro reier...@gmail.com To: users@wicket.apache.org Sent: Thursday, September 23, 2010 12:07 PM Subject: Re: using IOC in panels? Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov mgrigo...@apache.org wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: There is a component instantiation listener that takes care of that: you just use new as always. Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov mgrigo...@apache.org: Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi martin.maku...@koodaripalvelut.com: What is your need exactly? ** Martin 2010/9/23 nino martinez wael nino.martinez.w...@gmail.com: Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - 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 - 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 - 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: using IOC in panels?
The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component *the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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: using IOC in panels?
I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman ja...@carmanconsulting.com wrote: I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - 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: using IOC in panels?
Again, how would merely putting a marker interface on some random class allow Wicket to be notified about when it is instantiated? Now, if you bring AspectJ into the mix, you might have something. Or, as someone else already suggested, use Salve. On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman ja...@carmanconsulting.com wrote: I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Doing getApplication().notifyComponentInstantiationListeners(this); as component does? On Thu, Sep 23, 2010 at 12:39 PM, James Carman ja...@carmanconsulting.com wrote: Again, how would merely putting a marker interface on some random class allow Wicket to be notified about when it is instantiated? Now, if you bring AspectJ into the mix, you might have something. Or, as someone else already suggested, use Salve. On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman ja...@carmanconsulting.com wrote: I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - 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 - 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: using IOC in panels?
I meant automatically. Why introduce an interface if you're going to just do this anyway? On Thu, Sep 23, 2010 at 6:42 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Doing getApplication().notifyComponentInstantiationListeners(this); as component does? On Thu, Sep 23, 2010 at 12:39 PM, James Carman ja...@carmanconsulting.com wrote: Again, how would merely putting a marker interface on some random class allow Wicket to be notified about when it is instantiated? Now, if you bring AspectJ into the mix, you might have something. Or, as someone else already suggested, use Salve. On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman ja...@carmanconsulting.com wrote: I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Good point. On Thu, Sep 23, 2010 at 12:45 PM, James Carman ja...@carmanconsulting.com wrote: I meant automatically. Why introduce an interface if you're going to just do this anyway? On Thu, Sep 23, 2010 at 6:42 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Doing getApplication().notifyComponentInstantiationListeners(this); as component does? On Thu, Sep 23, 2010 at 12:39 PM, James Carman ja...@carmanconsulting.com wrote: Again, how would merely putting a marker interface on some random class allow Wicket to be notified about when it is instantiated? Now, if you bring AspectJ into the mix, you might have something. Or, as someone else already suggested, use Salve. On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman ja...@carmanconsulting.com wrote: I meant the Instantiatable interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * strongduring/strong construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman ja...@carmanconsulting.com wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman ja...@carmanconsulting.com wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: So that other classes could use the same trick by implementing IInstantiable ? How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 - 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 - 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 - 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 - 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