You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Per Newgro <pe...@gmx.ch> on 2016/09/28 06:04:35 UTC

Find a component corresponding to entity

Hello *,

I'm looking for an elegant solution to determine a component for an entity.

Example:
There is a person and two sub-types of it - Manager and Sportsman.
The Manager can be listed in a listview by using a ManagerViewItem
and the Sportsman by using a SportsmanViewItem.

Currently I'm using a factory producing the appropriate viewitems. But this factory is injected by using spring.
I would like to reduce the coupling to spring within my component classes (e.g. Page).

So i'm looking for a "wicket way" to determine which component is required to list all persons.

Thanks for your ideas.
Per

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


Aw: Re: Find a component corresponding to entity

Posted by Per Newgro <pe...@gmx.ch>.
Thank you both for your statement.
Per

> Gesendet: Mittwoch, 28. September 2016 um 08:34 Uhr
> Von: "Ernesto Reinaldo Barreiro" <re...@gmail.com>
> An: "users@wicket.apache.org" <us...@wicket.apache.org>
> Betreff: Re: Find a component corresponding to entity
>
> Per,
> 
> I normally do it the static factory way.. but Spring might give you the
> advantage for testing (e.g in some situation just pass something that
> creates an empty panels, or anything else). As Martin said, this is not
> something Wicket cares about.
> 
> On Wed, Sep 28, 2016 at 8:04 AM, Per Newgro <pe...@gmx.ch> wrote:
> 
> > Hello *,
> >
> > I'm looking for an elegant solution to determine a component for an entity.
> >
> > Example:
> > There is a person and two sub-types of it - Manager and Sportsman.
> > The Manager can be listed in a listview by using a ManagerViewItem
> > and the Sportsman by using a SportsmanViewItem.
> >
> > Currently I'm using a factory producing the appropriate viewitems. But
> > this factory is injected by using spring.
> > I would like to reduce the coupling to spring within my component classes
> > (e.g. Page).
> >
> > So i'm looking for a "wicket way" to determine which component is required
> > to list all persons.
> >
> > Thanks for your ideas.
> > Per
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro
> 

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


Re: Find a component corresponding to entity

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Per,

I normally do it the static factory way.. but Spring might give you the
advantage for testing (e.g in some situation just pass something that
creates an empty panels, or anything else). As Martin said, this is not
something Wicket cares about.

On Wed, Sep 28, 2016 at 8:04 AM, Per Newgro <pe...@gmx.ch> wrote:

> Hello *,
>
> I'm looking for an elegant solution to determine a component for an entity.
>
> Example:
> There is a person and two sub-types of it - Manager and Sportsman.
> The Manager can be listed in a listview by using a ManagerViewItem
> and the Sportsman by using a SportsmanViewItem.
>
> Currently I'm using a factory producing the appropriate viewitems. But
> this factory is injected by using spring.
> I would like to reduce the coupling to spring within my component classes
> (e.g. Page).
>
> So i'm looking for a "wicket way" to determine which component is required
> to list all persons.
>
> Thanks for your ideas.
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: Find a component corresponding to entity

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Wicket doesn't prescribe any way for this.
You could use Spring, ServiceLoader, OSGi, static factory, ... Anything
that makes sense in your application.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Sep 28, 2016 at 8:04 AM, Per Newgro <pe...@gmx.ch> wrote:

> Hello *,
>
> I'm looking for an elegant solution to determine a component for an entity.
>
> Example:
> There is a person and two sub-types of it - Manager and Sportsman.
> The Manager can be listed in a listview by using a ManagerViewItem
> and the Sportsman by using a SportsmanViewItem.
>
> Currently I'm using a factory producing the appropriate viewitems. But
> this factory is injected by using spring.
> I would like to reduce the coupling to spring within my component classes
> (e.g. Page).
>
> So i'm looking for a "wicket way" to determine which component is required
> to list all persons.
>
> Thanks for your ideas.
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>