You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by Anatole Tresch <at...@gmail.com> on 2014/12/31 19:02:07 UTC

Configurstioncontext

Hi Mark/all

I started today with the implementation of the ConfigurationContext. Doing so I saw that only the full fledged map of property converters can be accessed. 
The problem I have with it are as follows:
1) i dont see the use case for returning the full map. During runtime I am normally only intersted in the converters for one type.
2) it is not efficient. Since I typically only use single lists, i have to create a new map instance on each call, since without that locking/synchronization gets ugly. Locking on list level is ok.

Summary I would like to replace this method with or add the following method:
<T> List<PropertyConverter<T>> getPropertyConverter(Class<T> targetType);
We could similarly add a method returning the currently registered types...

Wdyt?

Anatole

-
Anatole Tresch
Glärnischweg 10
8620 Wetzikon
Tel +41 (43) 317 05 30
-
Send from Mobile

Re: Configurstioncontext

Posted by Anatole Tresch <at...@gmail.com>.
Good, i will add the sdditional method ;)
Mark Struberg <st...@yahoo.de> schrieb am Mi., 31. Dez. 2014 um 19:29:

> The Map was just a first idea. Happy to find something better.
> Seeing the full map could be nice for admin views or JMX.
> Of course the Configuration class itself only needs the list per type.
>
> All of them of course should be immutable, thus I see no problem with
> concurrency in any case.
> Converters, etc of course must be implemented reentrant! We should add
> this to the javadoc.
>
>
> LieGrue,
> strub
>
>
>
>
>
> > On Wednesday, 31 December 2014, 19:09, Anatole Tresch <
> atsticks@gmail.com> wrote:
> > > Hi Mark/all
> >
> > I started today with the implementation of the ConfigurationContext.
> Doing so I
> > saw that only the full fledged map of property converters can be
> accessed.
> > The problem I have with it are as follows:
> > 1) i dont see the use case for returning the full map. During runtime I
> am
> > normally only intersted in the converters for one type.
> > 2) it is not efficient. Since I typically only use single lists, i have
> to
> > create a new map instance on each call, since without that
> > locking/synchronization gets ugly. Locking on list level is ok.
> >
> > Summary I would like to replace this method with or add the following
> method:
> > <T> List<PropertyConverter<T>>
> > getPropertyConverter(Class<T> targetType);
> > We could similarly add a method returning the currently registered
> types...
> >
> > Wdyt?
> >
> > Anatole
> >
> > -
> > Anatole Tresch
> > Glärnischweg 10
> > 8620 Wetzikon
> > Tel +41 (43) 317 05 30
> > -
> > Send from Mobile
> >
>

Re: Configurstioncontext

Posted by Mark Struberg <st...@yahoo.de>.
The Map was just a first idea. Happy to find something better.
Seeing the full map could be nice for admin views or JMX.
Of course the Configuration class itself only needs the list per type.

All of them of course should be immutable, thus I see no problem with concurrency in any case.
Converters, etc of course must be implemented reentrant! We should add this to the javadoc.


LieGrue,
strub





> On Wednesday, 31 December 2014, 19:09, Anatole Tresch <at...@gmail.com> wrote:
> > Hi Mark/all
> 
> I started today with the implementation of the ConfigurationContext. Doing so I 
> saw that only the full fledged map of property converters can be accessed. 
> The problem I have with it are as follows:
> 1) i dont see the use case for returning the full map. During runtime I am 
> normally only intersted in the converters for one type.
> 2) it is not efficient. Since I typically only use single lists, i have to 
> create a new map instance on each call, since without that 
> locking/synchronization gets ugly. Locking on list level is ok.
> 
> Summary I would like to replace this method with or add the following method:
> <T> List<PropertyConverter<T>> 
> getPropertyConverter(Class<T> targetType);
> We could similarly add a method returning the currently registered types...
> 
> Wdyt?
> 
> Anatole
> 
> -
> Anatole Tresch
> Glärnischweg 10
> 8620 Wetzikon
> Tel +41 (43) 317 05 30
> -
> Send from Mobile
>