On 9/10/07, Matthijs Wensveen <[EMAIL PROTECTED]> wrote:
>
> Okay, I get the whole conversion is validation thingy. Not entirely
> convinced whether validation is the only place where conversion should
> take place, but I'll leave this subject for now. It's already a lot
> clearer to me now.
it is done this way because conversion might be expensive so we only want to
do it once and cache the result. there is no sense performing conversion
once to see if it works, and then another time to update the model on the
exact same input.
-igor
>
> >> We have this also because it preserves memory, If you have to make an
> >>
> >>> (inner)class instance
> >>> and a link instance and attach those 2 each other that can consume
> much
> >>>
> >> more
> >>
> >>> memory
> >>> then when just making a new class and have there one instance.
> >>>
> >>>
> >> I'm not sure I see what you mean, but doesn't the (inner) class also
> >> need instantiation, consuming just as much memory?
> >>
> >
> >
> >
> > Yes but only 1 instance.. for example:
> >
> > Link link = new Link()
> > {
> > onClick()
> > {
> > // do your thing
> > }
> > }
> >
> > or
> >
> > Link link = new Link();
> > link.add(new LinkClickListener()
> > {
> > onClick()
> > {
> > // do you thing.
> > }
> > });
> >
> > the second approach makes 2 instances and link has now also a special
> extra
> > map to hold the listener.
> >
> > johan
> >
> >
>
> The extra memory for the ClickListener is negligible and does give you
> more flexibility because now you can have more than one interested party
> for the link click. My use case (fetch nested component, add listener)
> was already answered sufficiently by Martijn (bad OO, components should
> publish own events that make sense in the problem domain), but I still
> an eventlistener-based design could have merit (see the move towards
> Delegation Event Model in AWT:
> http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html).
> While wicket is not swing or awt, it's an interesting read.
>
> Matthijs
>
> --
> Matthijs Wensveen
> Func. Internet Integration
> W http://www.func.nl
> T +31 20 4230000
> F +31 20 4223500
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>