I think Christian's idea is nice, and I saw at least three comments against it:

1. It is necessary to call injectDependencies on deserialization (Igor)

If a component implements "protected Object readResolve() throws
ObjectStreamException", as specified in Serializable class, I think
this could be handled, what do you think?

2. The component itself would do lookups (Alexandru).

Yes, but it would be a base class, and as a user you would never see
as your component doing the lookup. Otherwise, as said in a previous
thread, there could be a phase in the RequestCycle responsible for
injecting things, and that would also solve the issue (1).

3. You should never ever call a overridable method in a constructor (Eelco).

Make it final?

2005/10/27, Christian Essl <[EMAIL PROTECTED]>:
> On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius
> <[EMAIL PROTECTED]> wrote:
>
> > Furthermore, you should never ever call a overridable method in a
> > constructor.
>
> You are right. It must be commented to not be dependent on any state set
> of the constructors below this magic helper class. Apart of this
> overriding is generaly a bit dangerous if you don't read the comment well
> and don't know when it is called.
>
> Anyway it was just an idea. I like this 'injection' thing just not AOP.
>
> Christian
>
> >
> > Eelco
> >
> > On 10/27/05, Alexandru Popescu <[EMAIL PROTECTED]>
> > wrote:
> >> #: Christian Essl changed the world a bit at a time by saying on
> >> 10/28/2005 12:54 AM :#
> >> > Is AOP realy needed for that?
> >> >
> >> > Propably I do not understand the problem but why can't you just write
> >> a
> >> > special Panel, Page etc which calls an overrideable
> >> injectDependencies()
> >> > method in the constructor. The default implementation of
> >> > injectDependencies() does basicly read the annotations, lookup the
> >> > services and inject them?
> >>
> >> Because in this case the component itself does the lookup. And this is
> >> not what you really want.
> >>
> >> ./alex
> >> --
> >> .w( the_mindstorm )p.
> >>
> >> I think this way you could on an instance by
> >> > instance basis fine-grain control what gets injected. And during
> >> testing
> >> > you just inject the mocks in this overriden method.
> >> >
> >> > Just my two cents.
> >> >
> >> > Thanks,
> >> > Christian
> >> >
> >> > On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
> >> > <[EMAIL PROTECTED]> wrote:
> >> >
> >> >>
> >> >> On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
> >> >>>
> >> >>> BTW rather than letting panels pull service from the page, I'd
> >> prefer
> >> >>> the page to push services into its panels (i.e. the page  injects
> >> >>> dependencies into its panels).
> >> >>> I don't want my panels to be dependent on the containing page.
> >> >>
> >> >> Yup. That is exactly what I do.
> >> >>
> >> >> But. I just moved the aspect from WebPage to Component and guess
> >> what,
> >> >> the annotation and bean resolving works fine in Panels and
> >> >> WebComponents too now :-)
> >> >>
> >> >> It is still to hackerish to use btw. There are some really nasty
> >> delays
> >> >> for example. I need to find some time to polish this.
> >> >>
> >> >>   S.
> >> >>
> >> >>
> >> >>
> >> >> -------------------------------------------------------
> >> >> 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
> >>
> >
> >
> > -------------------------------------------------------
> > 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
>
>
>
> --
> Christian Essl
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: 
> http://mail.yahoo.de
>
>
>
> -------------------------------------------------------
> 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
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to