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 2015/10/29 01:34:56 UTC
Passing additionally the accessed key to PropertyConverter.convert
Hi all,
I am currently working on different extensions for Tamaya. So far our
API/SPI worked perfectly. Now I have a use case, where I would like to ask
for your opinion because I would like to extend the SPI. Currently the
PropertyConverter is defined as follows:
public interface PropertyConverter<T>{
T convert(String value);
}
Now the issue with this is, that for supporting collection types (and
possibly also other similar use cases) I need additional information.
As of now this information is stored as part of the configuration,
which is fine (no additional mechanism is needed). But since, I do not
have any information on the *key* accessed, I cannot evaluate this
metadata within the converter. So my simple solution would be to
simply add the requested key as parameter to the convert method like
this:
public interface PropertyConverter<T>{
T convert(String key, String value);
}
Without any further objections or a better proposal I would introduce
this change later this week (and open a corresponding ticket, so it is
well documented in the release notes).
So let me know what you think ;)
Cheers,
Anatole
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> To map complex data types we should YAML as format. But even complex data
> structures could be expressed with property files:
>
>
we are extensible to make everybody "should" true :) - I don't disagree but
once again on the config topic you will never do it right since everybody
expects something different.
> Example:
>
> class FooBar {
> String foo;
> int bar
> }
>
> Representation:
>
> my.prefix.a.foo = "snafu"
> my.prefix.a.bar = 42
>
> Code
>
> FooBar foobar = Configuration.get("my.prefix.a")
>
> WDYT?
>
>
It works but I often used this kind of convention:
com.company.datasource.myDataSource = ....some nice super proprietary
format ;)...
datasource info is in the key and nowhere else to make it lighter. This is
a company choice a config framework has to deal with IMO and not the
opposite.
Of course we can use properties "PostProcessor" to speak spring but it is
not that useful IMO.
> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
>
>> Maybe you need to be more precise cause boot properties doesnt map to very
>> advance types. If you think to @ConfigurationProperties it is a way to map
>> its config but not the only one in enterprises AFAIK.
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-10-29 17:39 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> No, you can use property files with Spring boot.
>>>
>>> Am 29.10.15 um 17:19 schrieb Romain Manni-Bucau:
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
My idea is to provide a tamaya format as (optional) extension module (what
I currently do in the experimental part). The additionan of additional keys
is easily also usable in yaml, xml, json and properties formats, so for
most use cases and the ones having more freedom it matches well.
But, of course, bigger enterprises should be able to do their own stuff...
I would not try to support any kind of collection format currently present
by Tamaya. If one is needed also thrid party colluegues can provide it...
My plan also is presenting our collection configuration ideas on my blog,
linked with our mailing list and project, so we can also produce visibility
and maybe further involvement ;) lets see ...
2015-10-31 16:12 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> Le 31 oct. 2015 01:19, "Anatole Tresch" <at...@gmail.com> a écrit :
> >
> > Hi Romain/all
> >
> > Not necessarily, e.g.
> > - I can have a list of Strings, but I want to validate them using
> whatever
> > validator.
>
> Think it is maybe where i split ans maybe what we should discuss: do we
> want tamaya to support enterprises practise or impose a tamaya format.
>
> Im for the adaptation of course since config is IMO custom by design.
>
> > - Similarly a value can be accessed as list or as String, but the
> > combination policy may be different (overriding is not always the way to
> go)
> > - Or I might even define keys that I only want to be overridable by
> certain
> > components?
> > - there are use cases, where additional information for a particular
> entry
> > is required: e.g. its exact source (file, URL, DB etc), its sensitivitiy,
> > its used encryption algorithm etc.
> >
> > I am sure the list gets longer with time, so for me Tamaya should support
> > these cases. The logic itself is not built into the core. It is only the
> > SPI that supports doing such things, which IMO is a good thing because it
> > does not constrain users what they do with it.
> >
> > How far we go with the collection module, we will see. That is one of the
> > reasons, why it is currently in the experimental part...
> >
> > Cheers,
> > Anatole
> >
> >
> > 2015-10-31 1:38 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> > > Well for collection, map and object it is useless since it is part of
> the
> > > java side not the config IMO. That said it does make the context
> useless.
> > > Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
> > >
> > > > Hi Oliver
> > > >
> > > > basically I would even not call append it. they are additional keys
> with
> > > > allow to add additional information. Similar mechanisms could also be
> > > used
> > > > for tracking the origin of the entries read. The format/syntax is not
> yet
> > > > fixed (and also not implemented). I started in the experimental
> > > collections
> > > > modul just with a small example configuration. I am happy to share
> > > thaughts
> > > > on this.
> > > > 1) I decided to use the {} for having a separation of meta entries,
> from
> > > > other ones. Basically I could even filter out the meta-entries for
> normal
> > > > access. So adding meta basically is possible, but I think we should
> try
> > > to
> > > > be a bit more advanced to prevent clashes with anything users define.
> > > E.g.
> > > > how about:
> > > >
> > > > a.b.mylist.__meta.collection-type=java.util.LinkedList
> > > > a.b.mylist.__meta.element-type=int
> > > > a.b.mylist.__meta.collection-separators=,;
> > > >
> > > > or even shorter:
> > > >
> > > > a.b.mylist.__collection-type=java.util.LinkedList
> > > > a.b.mylist.__element-type=int
> > > > a.b.mylist.__collection-separators=,;
> > > >
> > > > WDYT?
> > > >
> > > > Cheers,
> > > > Anatole
> > > >
> > > >
> > > > 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <
> o.b.fischer@swe-blog.net
> >:
> > > >
> > > > > Thx Anatole, now I got it. As I understand you would like to append
> to
> > > > the
> > > > > actual key metadata (not to the key itself). This is fine for me!
> > > > >
> > > > > 1. Are these meta data optional? As I understand not.
> > > > > 2. Could we change the syntax? Adding meta data sould work with
> every
> > > > kind
> > > > > of provider (db, JSON, YAML, something else,...}
> > > > >
> > > > > The curly braces are already used in JSON and other fileformat.
> > > Therefore
> > > > > I would suggest to to use "metadata" or simply "meta" to divide the
> key
> > > > > itself and the meta data.
> > > > >
> > > > > a.b.mylist.{collection-type}=java.util.LinkedList
> > > > > a.b.mylist.{element-type}=int
> > > > > a.b.mylist.{collection-separators)=,;
> > > > >
> > > > > would be
> > > > >
> > > > > a.b.mylist.meta.collection-type=java.util.LinkedList
> > > > > a.b.mylist.meta.element-type=int
> > > > > a.b.mylist.meta.collection-separators=,;
> > > > >
> > > > >
> > > > > WDYT?
> > > > >
> > > > > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> > > > >
> > > > >> Hi Oliver
> > > > >>
> > > > >> I do not disagree AFAIK... (inline more)...
> > > > >>
> > > > >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <
> > > o.b.fischer@swe-blog.net
> > > > >:
> > > > >>
> > > > >> To map complex data types we should YAML as format. But even
> complex
> > > > data
> > > > >>> structures could be expressed with property files:
> > > > >>>
> > > > >>> Example:
> > > > >>>
> > > > >>> class FooBar {
> > > > >>> String foo;
> > > > >>> int bar
> > > > >>> }
> > > > >>>
> > > > >>> Representation:
> > > > >>>
> > > > >>> my.prefix.a.foo = "snafu"
> > > > >>> my.prefix.a.bar = 42
> > > > >>>
> > > > >>> Agreed. That is one option how it can be done.
> > > > >>>
> > > > >>
> > > > >>
> > > > >>
> > > > >> Code
> > > > >>>
> > > > >>> FooBar foobar = Configuration.get("my.prefix.a")
> > > > >>>
> > > > >>> WDYT?
> > > > >>>
> > > > >>> That is how it is...
> > > > >>
> > > > >> My use case is a simpler one:
> > > > >>
> > > > >> a.b.mylist=1,2,3
> > > > >>
> > > > >> Now I want to have an additional validation in place, define it
> > > should
> > > > be
> > > > >> traded as list and I want to use ',' as separator.
> > > > >> This metadata could be added as well, e.g. by adding additional
> > > > >> properties:
> > > > >>
> > > > >> a.b.mylist.{collection-type}=java.util.LinkedList
> > > > >> a.b.mylist.{element-type}=int
> > > > >> a.b.mylist.{collection-separators)=,;
> > > > >>
> > > > >> For being able to access these kind of "Meta" entries, I need to
> have
> > > > >> access to the original key (a.b.mylist). So there is nothing
> changed
> > > on
> > > > >> the
> > > > >> basic configuration logic, despite it gets more flexible, e.g. I
> can
> > > > also
> > > > >> enhance the combination policy and allow to have the combination
> > > policy
> > > > be
> > > > >> adaptive, depending on the config data, e.g. by adding
> > > > >>
> > > > >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> > > > >>
> > > > >> Summarizing I did not change any of the basic mechanisms in place,
> I
> > > > just
> > > > >> made them a bit more flexible. It is still up to the modules in
> place,
> > > > >> what
> > > > >> you do with it. I am currently working on a collection support
> module
> > > in
> > > > >> the experimental part to gain more experience with it and also for
> > > > having
> > > > >> a
> > > > >> playground I could easily reference, blog on it and see, what
> other
> > > > people
> > > > >> think... ;)
> > > > >>
> > > > >> OK, so far?
> > > > >>
> > > > >> Cheers,
> > > > >> Anatole
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> > > > >>
> > > > >> Maybe you need to be more precise cause boot properties doesnt map
> to
> > > > very
> > > > >>> --
> > > > >>> N Oliver B. Fischer
> > > > >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > > >>> P +49 30 44793251
> > > > >>> M +49 178 7903538
> > > > >>> E o.b.fischer@swe-blog.net
> > > > >>> S oliver.b.fischer
> > > > >>> J oliver.b.fischer@jabber.org
> > > > >>> X http://xing.to/obf
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>
> > > > > --
> > > > > N Oliver B. Fischer
> > > > > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > > > P +49 30 44793251
> > > > > M +49 178 7903538
> > > > > E o.b.fischer@swe-blog.net
> > > > > S oliver.b.fischer
> > > > > J oliver.b.fischer@jabber.org
> > > > > X http://xing.to/obf
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > *Anatole Tresch*
> > > > Java Engineer & Architect, JSR Spec Lead
> > > > Glärnischweg 10
> > > > CH - 8620 Wetzikon
> > > >
> > > > *Switzerland, Europe Zurich, GMT+1*
> > > > *Twitter: @atsticks*
> > > > *Blogs: **http://javaremarkables.blogspot.ch/
> > > > <http://javaremarkables.blogspot.ch/>*
> > > >
> > > > *Google: atsticksMobile +41-76 344 62 79*
> > > >
> > >
> >
> >
> >
> > --
> > *Anatole Tresch*
> > Java Engineer & Architect, JSR Spec Lead
> > Glärnischweg 10
> > CH - 8620 Wetzikon
> >
> > *Switzerland, Europe Zurich, GMT+1*
> > *Twitter: @atsticks*
> > *Blogs: **http://javaremarkables.blogspot.ch/
> > <http://javaremarkables.blogspot.ch/>*
> >
> > *Google: atsticksMobile +41-76 344 62 79*
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 31 oct. 2015 01:19, "Anatole Tresch" <at...@gmail.com> a écrit :
>
> Hi Romain/all
>
> Not necessarily, e.g.
> - I can have a list of Strings, but I want to validate them using whatever
> validator.
Think it is maybe where i split ans maybe what we should discuss: do we
want tamaya to support enterprises practise or impose a tamaya format.
Im for the adaptation of course since config is IMO custom by design.
> - Similarly a value can be accessed as list or as String, but the
> combination policy may be different (overriding is not always the way to
go)
> - Or I might even define keys that I only want to be overridable by
certain
> components?
> - there are use cases, where additional information for a particular entry
> is required: e.g. its exact source (file, URL, DB etc), its sensitivitiy,
> its used encryption algorithm etc.
>
> I am sure the list gets longer with time, so for me Tamaya should support
> these cases. The logic itself is not built into the core. It is only the
> SPI that supports doing such things, which IMO is a good thing because it
> does not constrain users what they do with it.
>
> How far we go with the collection module, we will see. That is one of the
> reasons, why it is currently in the experimental part...
>
> Cheers,
> Anatole
>
>
> 2015-10-31 1:38 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
>
> > Well for collection, map and object it is useless since it is part of
the
> > java side not the config IMO. That said it does make the context
useless.
> > Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
> >
> > > Hi Oliver
> > >
> > > basically I would even not call append it. they are additional keys
with
> > > allow to add additional information. Similar mechanisms could also be
> > used
> > > for tracking the origin of the entries read. The format/syntax is not
yet
> > > fixed (and also not implemented). I started in the experimental
> > collections
> > > modul just with a small example configuration. I am happy to share
> > thaughts
> > > on this.
> > > 1) I decided to use the {} for having a separation of meta entries,
from
> > > other ones. Basically I could even filter out the meta-entries for
normal
> > > access. So adding meta basically is possible, but I think we should
try
> > to
> > > be a bit more advanced to prevent clashes with anything users define.
> > E.g.
> > > how about:
> > >
> > > a.b.mylist.__meta.collection-type=java.util.LinkedList
> > > a.b.mylist.__meta.element-type=int
> > > a.b.mylist.__meta.collection-separators=,;
> > >
> > > or even shorter:
> > >
> > > a.b.mylist.__collection-type=java.util.LinkedList
> > > a.b.mylist.__element-type=int
> > > a.b.mylist.__collection-separators=,;
> > >
> > > WDYT?
> > >
> > > Cheers,
> > > Anatole
> > >
> > >
> > > 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o.b.fischer@swe-blog.net
>:
> > >
> > > > Thx Anatole, now I got it. As I understand you would like to append
to
> > > the
> > > > actual key metadata (not to the key itself). This is fine for me!
> > > >
> > > > 1. Are these meta data optional? As I understand not.
> > > > 2. Could we change the syntax? Adding meta data sould work with
every
> > > kind
> > > > of provider (db, JSON, YAML, something else,...}
> > > >
> > > > The curly braces are already used in JSON and other fileformat.
> > Therefore
> > > > I would suggest to to use "metadata" or simply "meta" to divide the
key
> > > > itself and the meta data.
> > > >
> > > > a.b.mylist.{collection-type}=java.util.LinkedList
> > > > a.b.mylist.{element-type}=int
> > > > a.b.mylist.{collection-separators)=,;
> > > >
> > > > would be
> > > >
> > > > a.b.mylist.meta.collection-type=java.util.LinkedList
> > > > a.b.mylist.meta.element-type=int
> > > > a.b.mylist.meta.collection-separators=,;
> > > >
> > > >
> > > > WDYT?
> > > >
> > > > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> > > >
> > > >> Hi Oliver
> > > >>
> > > >> I do not disagree AFAIK... (inline more)...
> > > >>
> > > >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <
> > o.b.fischer@swe-blog.net
> > > >:
> > > >>
> > > >> To map complex data types we should YAML as format. But even
complex
> > > data
> > > >>> structures could be expressed with property files:
> > > >>>
> > > >>> Example:
> > > >>>
> > > >>> class FooBar {
> > > >>> String foo;
> > > >>> int bar
> > > >>> }
> > > >>>
> > > >>> Representation:
> > > >>>
> > > >>> my.prefix.a.foo = "snafu"
> > > >>> my.prefix.a.bar = 42
> > > >>>
> > > >>> Agreed. That is one option how it can be done.
> > > >>>
> > > >>
> > > >>
> > > >>
> > > >> Code
> > > >>>
> > > >>> FooBar foobar = Configuration.get("my.prefix.a")
> > > >>>
> > > >>> WDYT?
> > > >>>
> > > >>> That is how it is...
> > > >>
> > > >> My use case is a simpler one:
> > > >>
> > > >> a.b.mylist=1,2,3
> > > >>
> > > >> Now I want to have an additional validation in place, define it
> > should
> > > be
> > > >> traded as list and I want to use ',' as separator.
> > > >> This metadata could be added as well, e.g. by adding additional
> > > >> properties:
> > > >>
> > > >> a.b.mylist.{collection-type}=java.util.LinkedList
> > > >> a.b.mylist.{element-type}=int
> > > >> a.b.mylist.{collection-separators)=,;
> > > >>
> > > >> For being able to access these kind of "Meta" entries, I need to
have
> > > >> access to the original key (a.b.mylist). So there is nothing
changed
> > on
> > > >> the
> > > >> basic configuration logic, despite it gets more flexible, e.g. I
can
> > > also
> > > >> enhance the combination policy and allow to have the combination
> > policy
> > > be
> > > >> adaptive, depending on the config data, e.g. by adding
> > > >>
> > > >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> > > >>
> > > >> Summarizing I did not change any of the basic mechanisms in place,
I
> > > just
> > > >> made them a bit more flexible. It is still up to the modules in
place,
> > > >> what
> > > >> you do with it. I am currently working on a collection support
module
> > in
> > > >> the experimental part to gain more experience with it and also for
> > > having
> > > >> a
> > > >> playground I could easily reference, blog on it and see, what other
> > > people
> > > >> think... ;)
> > > >>
> > > >> OK, so far?
> > > >>
> > > >> Cheers,
> > > >> Anatole
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> > > >>
> > > >> Maybe you need to be more precise cause boot properties doesnt map
to
> > > very
> > > >>> --
> > > >>> N Oliver B. Fischer
> > > >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > >>> P +49 30 44793251
> > > >>> M +49 178 7903538
> > > >>> E o.b.fischer@swe-blog.net
> > > >>> S oliver.b.fischer
> > > >>> J oliver.b.fischer@jabber.org
> > > >>> X http://xing.to/obf
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > > --
> > > > N Oliver B. Fischer
> > > > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > > P +49 30 44793251
> > > > M +49 178 7903538
> > > > E o.b.fischer@swe-blog.net
> > > > S oliver.b.fischer
> > > > J oliver.b.fischer@jabber.org
> > > > X http://xing.to/obf
> > > >
> > > >
> > >
> > >
> > > --
> > > *Anatole Tresch*
> > > Java Engineer & Architect, JSR Spec Lead
> > > Glärnischweg 10
> > > CH - 8620 Wetzikon
> > >
> > > *Switzerland, Europe Zurich, GMT+1*
> > > *Twitter: @atsticks*
> > > *Blogs: **http://javaremarkables.blogspot.ch/
> > > <http://javaremarkables.blogspot.ch/>*
> > >
> > > *Google: atsticksMobile +41-76 344 62 79*
> > >
> >
>
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
Hi Romain/all
Not necessarily, e.g.
- I can have a list of Strings, but I want to validate them using whatever
validator.
- Similarly a value can be accessed as list or as String, but the
combination policy may be different (overriding is not always the way to go)
- Or I might even define keys that I only want to be overridable by certain
components?
- there are use cases, where additional information for a particular entry
is required: e.g. its exact source (file, URL, DB etc), its sensitivitiy,
its used encryption algorithm etc.
I am sure the list gets longer with time, so for me Tamaya should support
these cases. The logic itself is not built into the core. It is only the
SPI that supports doing such things, which IMO is a good thing because it
does not constrain users what they do with it.
How far we go with the collection module, we will see. That is one of the
reasons, why it is currently in the experimental part...
Cheers,
Anatole
2015-10-31 1:38 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> Well for collection, map and object it is useless since it is part of the
> java side not the config IMO. That said it does make the context useless.
> Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
>
> > Hi Oliver
> >
> > basically I would even not call append it. they are additional keys with
> > allow to add additional information. Similar mechanisms could also be
> used
> > for tracking the origin of the entries read. The format/syntax is not yet
> > fixed (and also not implemented). I started in the experimental
> collections
> > modul just with a small example configuration. I am happy to share
> thaughts
> > on this.
> > 1) I decided to use the {} for having a separation of meta entries, from
> > other ones. Basically I could even filter out the meta-entries for normal
> > access. So adding meta basically is possible, but I think we should try
> to
> > be a bit more advanced to prevent clashes with anything users define.
> E.g.
> > how about:
> >
> > a.b.mylist.__meta.collection-type=java.util.LinkedList
> > a.b.mylist.__meta.element-type=int
> > a.b.mylist.__meta.collection-separators=,;
> >
> > or even shorter:
> >
> > a.b.mylist.__collection-type=java.util.LinkedList
> > a.b.mylist.__element-type=int
> > a.b.mylist.__collection-separators=,;
> >
> > WDYT?
> >
> > Cheers,
> > Anatole
> >
> >
> > 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> >
> > > Thx Anatole, now I got it. As I understand you would like to append to
> > the
> > > actual key metadata (not to the key itself). This is fine for me!
> > >
> > > 1. Are these meta data optional? As I understand not.
> > > 2. Could we change the syntax? Adding meta data sould work with every
> > kind
> > > of provider (db, JSON, YAML, something else,...}
> > >
> > > The curly braces are already used in JSON and other fileformat.
> Therefore
> > > I would suggest to to use "metadata" or simply "meta" to divide the key
> > > itself and the meta data.
> > >
> > > a.b.mylist.{collection-type}=java.util.LinkedList
> > > a.b.mylist.{element-type}=int
> > > a.b.mylist.{collection-separators)=,;
> > >
> > > would be
> > >
> > > a.b.mylist.meta.collection-type=java.util.LinkedList
> > > a.b.mylist.meta.element-type=int
> > > a.b.mylist.meta.collection-separators=,;
> > >
> > >
> > > WDYT?
> > >
> > > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> > >
> > >> Hi Oliver
> > >>
> > >> I do not disagree AFAIK... (inline more)...
> > >>
> > >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <
> o.b.fischer@swe-blog.net
> > >:
> > >>
> > >> To map complex data types we should YAML as format. But even complex
> > data
> > >>> structures could be expressed with property files:
> > >>>
> > >>> Example:
> > >>>
> > >>> class FooBar {
> > >>> String foo;
> > >>> int bar
> > >>> }
> > >>>
> > >>> Representation:
> > >>>
> > >>> my.prefix.a.foo = "snafu"
> > >>> my.prefix.a.bar = 42
> > >>>
> > >>> Agreed. That is one option how it can be done.
> > >>>
> > >>
> > >>
> > >>
> > >> Code
> > >>>
> > >>> FooBar foobar = Configuration.get("my.prefix.a")
> > >>>
> > >>> WDYT?
> > >>>
> > >>> That is how it is...
> > >>
> > >> My use case is a simpler one:
> > >>
> > >> a.b.mylist=1,2,3
> > >>
> > >> Now I want to have an additional validation in place, define it
> should
> > be
> > >> traded as list and I want to use ',' as separator.
> > >> This metadata could be added as well, e.g. by adding additional
> > >> properties:
> > >>
> > >> a.b.mylist.{collection-type}=java.util.LinkedList
> > >> a.b.mylist.{element-type}=int
> > >> a.b.mylist.{collection-separators)=,;
> > >>
> > >> For being able to access these kind of "Meta" entries, I need to have
> > >> access to the original key (a.b.mylist). So there is nothing changed
> on
> > >> the
> > >> basic configuration logic, despite it gets more flexible, e.g. I can
> > also
> > >> enhance the combination policy and allow to have the combination
> policy
> > be
> > >> adaptive, depending on the config data, e.g. by adding
> > >>
> > >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> > >>
> > >> Summarizing I did not change any of the basic mechanisms in place, I
> > just
> > >> made them a bit more flexible. It is still up to the modules in place,
> > >> what
> > >> you do with it. I am currently working on a collection support module
> in
> > >> the experimental part to gain more experience with it and also for
> > having
> > >> a
> > >> playground I could easily reference, blog on it and see, what other
> > people
> > >> think... ;)
> > >>
> > >> OK, so far?
> > >>
> > >> Cheers,
> > >> Anatole
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> > >>
> > >> Maybe you need to be more precise cause boot properties doesnt map to
> > very
> > >>> --
> > >>> N Oliver B. Fischer
> > >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > >>> P +49 30 44793251
> > >>> M +49 178 7903538
> > >>> E o.b.fischer@swe-blog.net
> > >>> S oliver.b.fischer
> > >>> J oliver.b.fischer@jabber.org
> > >>> X http://xing.to/obf
> > >>>
> > >>>
> > >>>
> > >>
> > > --
> > > N Oliver B. Fischer
> > > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > P +49 30 44793251
> > > M +49 178 7903538
> > > E o.b.fischer@swe-blog.net
> > > S oliver.b.fischer
> > > J oliver.b.fischer@jabber.org
> > > X http://xing.to/obf
> > >
> > >
> >
> >
> > --
> > *Anatole Tresch*
> > Java Engineer & Architect, JSR Spec Lead
> > Glärnischweg 10
> > CH - 8620 Wetzikon
> >
> > *Switzerland, Europe Zurich, GMT+1*
> > *Twitter: @atsticks*
> > *Blogs: **http://javaremarkables.blogspot.ch/
> > <http://javaremarkables.blogspot.ch/>*
> >
> > *Google: atsticksMobile +41-76 344 62 79*
> >
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
I'm -1 to assume the structure in Tamaya at API level (= dont force
anything). In all extensions I'm +1 (= encourage it).
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-11-03 10:08 GMT-08:00 Oliver B. Fischer <o....@swe-blog.net>:
> As it would be an extension module I am fine with it. But I would realy
> propose to put the meta data of a key below the value holding key itself.
> IMHO there should be a simple and obvious tree structure. It improves the
> readability.
>
> Could we agree on that?
>
> Am 31.10.15 um 01:38 schrieb Romain Manni-Bucau:
>
>> Well for collection, map and object it is useless since it is part of the
>> java side not the config IMO. That said it does make the context useless.
>> Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
>>
>> Hi Oliver
>>>
>>> basically I would even not call append it. they are additional keys with
>>> allow to add additional information. Similar mechanisms could also be
>>> used
>>> for tracking the origin of the entries read. The format/syntax is not yet
>>> fixed (and also not implemented). I started in the experimental
>>> collections
>>> modul just with a small example configuration. I am happy to share
>>> thaughts
>>> on this.
>>> 1) I decided to use the {} for having a separation of meta entries, from
>>> other ones. Basically I could even filter out the meta-entries for normal
>>> access. So adding meta basically is possible, but I think we should try
>>> to
>>> be a bit more advanced to prevent clashes with anything users define.
>>> E.g.
>>> how about:
>>>
>>> a.b.mylist.__meta.collection-type=java.util.LinkedList
>>> a.b.mylist.__meta.element-type=int
>>> a.b.mylist.__meta.collection-separators=,;
>>>
>>> or even shorter:
>>>
>>> a.b.mylist.__collection-type=java.util.LinkedList
>>> a.b.mylist.__element-type=int
>>> a.b.mylist.__collection-separators=,;
>>>
>>> WDYT?
>>>
>>> Cheers,
>>> Anatole
>>>
>>>
>>> 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>>
>>> the
>>> kind
>>> data
>>> be
>>> also
>>> be
>>> just
>>> having
>>> people
>>> very
>>>
>>> --
>>> *Anatole Tresch*
>>> Java Engineer & Architect, JSR Spec Lead
>>> Glärnischweg 10
>>> CH - 8620 Wetzikon
>>>
>>> *Switzerland, Europe Zurich, GMT+1*
>>> *Twitter: @atsticks*
>>> *Blogs: **http://javaremarkables.blogspot.ch/
>>> <http://javaremarkables.blogspot.ch/>*
>>>
>>> *Google: atsticksMobile +41-76 344 62 79*
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
As it would be an extension module I am fine with it. But I would realy
propose to put the meta data of a key below the value holding key
itself. IMHO there should be a simple and obvious tree structure. It
improves the readability.
Could we agree on that?
Am 31.10.15 um 01:38 schrieb Romain Manni-Bucau:
> Well for collection, map and object it is useless since it is part of the
> java side not the config IMO. That said it does make the context useless.
> Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
>
>> Hi Oliver
>>
>> basically I would even not call append it. they are additional keys with
>> allow to add additional information. Similar mechanisms could also be used
>> for tracking the origin of the entries read. The format/syntax is not yet
>> fixed (and also not implemented). I started in the experimental collections
>> modul just with a small example configuration. I am happy to share thaughts
>> on this.
>> 1) I decided to use the {} for having a separation of meta entries, from
>> other ones. Basically I could even filter out the meta-entries for normal
>> access. So adding meta basically is possible, but I think we should try to
>> be a bit more advanced to prevent clashes with anything users define. E.g.
>> how about:
>>
>> a.b.mylist.__meta.collection-type=java.util.LinkedList
>> a.b.mylist.__meta.element-type=int
>> a.b.mylist.__meta.collection-separators=,;
>>
>> or even shorter:
>>
>> a.b.mylist.__collection-type=java.util.LinkedList
>> a.b.mylist.__element-type=int
>> a.b.mylist.__collection-separators=,;
>>
>> WDYT?
>>
>> Cheers,
>> Anatole
>>
>>
>> 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> the
>> kind
>> data
>> be
>> also
>> be
>> just
>> having
>> people
>> very
>>
>> --
>> *Anatole Tresch*
>> Java Engineer & Architect, JSR Spec Lead
>> Glärnischweg 10
>> CH - 8620 Wetzikon
>>
>> *Switzerland, Europe Zurich, GMT+1*
>> *Twitter: @atsticks*
>> *Blogs: **http://javaremarkables.blogspot.ch/
>> <http://javaremarkables.blogspot.ch/>*
>>
>> *Google: atsticksMobile +41-76 344 62 79*
>>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Tamaya shouldnt impose a format but adapt to any - or then it is just
another config framework and not a generic config API adapted to the most.
Le 30 oct. 2015 18:44, "Alexandru Zbarcea" <al...@apache.org> a écrit :
> Hi,
>
> It seems to me like you are looking for conventions, that extend the
> property file to a new DSL.
>
> You want private attributes for a data structure (as meta-data), that
> became '.__meta' or '.__property' (similar to python).
>
> Log4j did pretty much the same thing, but started first to extend from
> .xml, and later from .properties file.
>
> Can it be '.yaml' from the beginning? Just a thought.
>
> WDYT?
> Alex
> On Oct 30, 2015 8:39 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> wrote:
>
> > Well for collection, map and object it is useless since it is part of the
> > java side not the config IMO. That said it does make the context useless.
> > Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
> >
> > > Hi Oliver
> > >
> > > basically I would even not call append it. they are additional keys
> with
> > > allow to add additional information. Similar mechanisms could also be
> > used
> > > for tracking the origin of the entries read. The format/syntax is not
> yet
> > > fixed (and also not implemented). I started in the experimental
> > collections
> > > modul just with a small example configuration. I am happy to share
> > thaughts
> > > on this.
> > > 1) I decided to use the {} for having a separation of meta entries,
> from
> > > other ones. Basically I could even filter out the meta-entries for
> normal
> > > access. So adding meta basically is possible, but I think we should try
> > to
> > > be a bit more advanced to prevent clashes with anything users define.
> > E.g.
> > > how about:
> > >
> > > a.b.mylist.__meta.collection-type=java.util.LinkedList
> > > a.b.mylist.__meta.element-type=int
> > > a.b.mylist.__meta.collection-separators=,;
> > >
> > > or even shorter:
> > >
> > > a.b.mylist.__collection-type=java.util.LinkedList
> > > a.b.mylist.__element-type=int
> > > a.b.mylist.__collection-separators=,;
> > >
> > > WDYT?
> > >
> > > Cheers,
> > > Anatole
> > >
> > >
> > > 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o.b.fischer@swe-blog.net
> >:
> > >
> > > > Thx Anatole, now I got it. As I understand you would like to append
> to
> > > the
> > > > actual key metadata (not to the key itself). This is fine for me!
> > > >
> > > > 1. Are these meta data optional? As I understand not.
> > > > 2. Could we change the syntax? Adding meta data sould work with every
> > > kind
> > > > of provider (db, JSON, YAML, something else,...}
> > > >
> > > > The curly braces are already used in JSON and other fileformat.
> > Therefore
> > > > I would suggest to to use "metadata" or simply "meta" to divide the
> key
> > > > itself and the meta data.
> > > >
> > > > a.b.mylist.{collection-type}=java.util.LinkedList
> > > > a.b.mylist.{element-type}=int
> > > > a.b.mylist.{collection-separators)=,;
> > > >
> > > > would be
> > > >
> > > > a.b.mylist.meta.collection-type=java.util.LinkedList
> > > > a.b.mylist.meta.element-type=int
> > > > a.b.mylist.meta.collection-separators=,;
> > > >
> > > >
> > > > WDYT?
> > > >
> > > > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> > > >
> > > >> Hi Oliver
> > > >>
> > > >> I do not disagree AFAIK... (inline more)...
> > > >>
> > > >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <
> > o.b.fischer@swe-blog.net
> > > >:
> > > >>
> > > >> To map complex data types we should YAML as format. But even complex
> > > data
> > > >>> structures could be expressed with property files:
> > > >>>
> > > >>> Example:
> > > >>>
> > > >>> class FooBar {
> > > >>> String foo;
> > > >>> int bar
> > > >>> }
> > > >>>
> > > >>> Representation:
> > > >>>
> > > >>> my.prefix.a.foo = "snafu"
> > > >>> my.prefix.a.bar = 42
> > > >>>
> > > >>> Agreed. That is one option how it can be done.
> > > >>>
> > > >>
> > > >>
> > > >>
> > > >> Code
> > > >>>
> > > >>> FooBar foobar = Configuration.get("my.prefix.a")
> > > >>>
> > > >>> WDYT?
> > > >>>
> > > >>> That is how it is...
> > > >>
> > > >> My use case is a simpler one:
> > > >>
> > > >> a.b.mylist=1,2,3
> > > >>
> > > >> Now I want to have an additional validation in place, define it
> > should
> > > be
> > > >> traded as list and I want to use ',' as separator.
> > > >> This metadata could be added as well, e.g. by adding additional
> > > >> properties:
> > > >>
> > > >> a.b.mylist.{collection-type}=java.util.LinkedList
> > > >> a.b.mylist.{element-type}=int
> > > >> a.b.mylist.{collection-separators)=,;
> > > >>
> > > >> For being able to access these kind of "Meta" entries, I need to
> have
> > > >> access to the original key (a.b.mylist). So there is nothing changed
> > on
> > > >> the
> > > >> basic configuration logic, despite it gets more flexible, e.g. I can
> > > also
> > > >> enhance the combination policy and allow to have the combination
> > policy
> > > be
> > > >> adaptive, depending on the config data, e.g. by adding
> > > >>
> > > >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> > > >>
> > > >> Summarizing I did not change any of the basic mechanisms in place, I
> > > just
> > > >> made them a bit more flexible. It is still up to the modules in
> place,
> > > >> what
> > > >> you do with it. I am currently working on a collection support
> module
> > in
> > > >> the experimental part to gain more experience with it and also for
> > > having
> > > >> a
> > > >> playground I could easily reference, blog on it and see, what other
> > > people
> > > >> think... ;)
> > > >>
> > > >> OK, so far?
> > > >>
> > > >> Cheers,
> > > >> Anatole
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> > > >>
> > > >> Maybe you need to be more precise cause boot properties doesnt map
> to
> > > very
> > > >>> --
> > > >>> N Oliver B. Fischer
> > > >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > >>> P +49 30 44793251
> > > >>> M +49 178 7903538
> > > >>> E o.b.fischer@swe-blog.net
> > > >>> S oliver.b.fischer
> > > >>> J oliver.b.fischer@jabber.org
> > > >>> X http://xing.to/obf
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > > --
> > > > N Oliver B. Fischer
> > > > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > > P +49 30 44793251
> > > > M +49 178 7903538
> > > > E o.b.fischer@swe-blog.net
> > > > S oliver.b.fischer
> > > > J oliver.b.fischer@jabber.org
> > > > X http://xing.to/obf
> > > >
> > > >
> > >
> > >
> > > --
> > > *Anatole Tresch*
> > > Java Engineer & Architect, JSR Spec Lead
> > > Glärnischweg 10
> > > CH - 8620 Wetzikon
> > >
> > > *Switzerland, Europe Zurich, GMT+1*
> > > *Twitter: @atsticks*
> > > *Blogs: **http://javaremarkables.blogspot.ch/
> > > <http://javaremarkables.blogspot.ch/>*
> > >
> > > *Google: atsticksMobile +41-76 344 62 79*
> > >
> >
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Alexandru Zbarcea <al...@apache.org>.
Hi,
It seems to me like you are looking for conventions, that extend the
property file to a new DSL.
You want private attributes for a data structure (as meta-data), that
became '.__meta' or '.__property' (similar to python).
Log4j did pretty much the same thing, but started first to extend from
.xml, and later from .properties file.
Can it be '.yaml' from the beginning? Just a thought.
WDYT?
Alex
On Oct 30, 2015 8:39 PM, "Romain Manni-Bucau" <rm...@gmail.com> wrote:
> Well for collection, map and object it is useless since it is part of the
> java side not the config IMO. That said it does make the context useless.
> Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
>
> > Hi Oliver
> >
> > basically I would even not call append it. they are additional keys with
> > allow to add additional information. Similar mechanisms could also be
> used
> > for tracking the origin of the entries read. The format/syntax is not yet
> > fixed (and also not implemented). I started in the experimental
> collections
> > modul just with a small example configuration. I am happy to share
> thaughts
> > on this.
> > 1) I decided to use the {} for having a separation of meta entries, from
> > other ones. Basically I could even filter out the meta-entries for normal
> > access. So adding meta basically is possible, but I think we should try
> to
> > be a bit more advanced to prevent clashes with anything users define.
> E.g.
> > how about:
> >
> > a.b.mylist.__meta.collection-type=java.util.LinkedList
> > a.b.mylist.__meta.element-type=int
> > a.b.mylist.__meta.collection-separators=,;
> >
> > or even shorter:
> >
> > a.b.mylist.__collection-type=java.util.LinkedList
> > a.b.mylist.__element-type=int
> > a.b.mylist.__collection-separators=,;
> >
> > WDYT?
> >
> > Cheers,
> > Anatole
> >
> >
> > 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> >
> > > Thx Anatole, now I got it. As I understand you would like to append to
> > the
> > > actual key metadata (not to the key itself). This is fine for me!
> > >
> > > 1. Are these meta data optional? As I understand not.
> > > 2. Could we change the syntax? Adding meta data sould work with every
> > kind
> > > of provider (db, JSON, YAML, something else,...}
> > >
> > > The curly braces are already used in JSON and other fileformat.
> Therefore
> > > I would suggest to to use "metadata" or simply "meta" to divide the key
> > > itself and the meta data.
> > >
> > > a.b.mylist.{collection-type}=java.util.LinkedList
> > > a.b.mylist.{element-type}=int
> > > a.b.mylist.{collection-separators)=,;
> > >
> > > would be
> > >
> > > a.b.mylist.meta.collection-type=java.util.LinkedList
> > > a.b.mylist.meta.element-type=int
> > > a.b.mylist.meta.collection-separators=,;
> > >
> > >
> > > WDYT?
> > >
> > > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> > >
> > >> Hi Oliver
> > >>
> > >> I do not disagree AFAIK... (inline more)...
> > >>
> > >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <
> o.b.fischer@swe-blog.net
> > >:
> > >>
> > >> To map complex data types we should YAML as format. But even complex
> > data
> > >>> structures could be expressed with property files:
> > >>>
> > >>> Example:
> > >>>
> > >>> class FooBar {
> > >>> String foo;
> > >>> int bar
> > >>> }
> > >>>
> > >>> Representation:
> > >>>
> > >>> my.prefix.a.foo = "snafu"
> > >>> my.prefix.a.bar = 42
> > >>>
> > >>> Agreed. That is one option how it can be done.
> > >>>
> > >>
> > >>
> > >>
> > >> Code
> > >>>
> > >>> FooBar foobar = Configuration.get("my.prefix.a")
> > >>>
> > >>> WDYT?
> > >>>
> > >>> That is how it is...
> > >>
> > >> My use case is a simpler one:
> > >>
> > >> a.b.mylist=1,2,3
> > >>
> > >> Now I want to have an additional validation in place, define it
> should
> > be
> > >> traded as list and I want to use ',' as separator.
> > >> This metadata could be added as well, e.g. by adding additional
> > >> properties:
> > >>
> > >> a.b.mylist.{collection-type}=java.util.LinkedList
> > >> a.b.mylist.{element-type}=int
> > >> a.b.mylist.{collection-separators)=,;
> > >>
> > >> For being able to access these kind of "Meta" entries, I need to have
> > >> access to the original key (a.b.mylist). So there is nothing changed
> on
> > >> the
> > >> basic configuration logic, despite it gets more flexible, e.g. I can
> > also
> > >> enhance the combination policy and allow to have the combination
> policy
> > be
> > >> adaptive, depending on the config data, e.g. by adding
> > >>
> > >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> > >>
> > >> Summarizing I did not change any of the basic mechanisms in place, I
> > just
> > >> made them a bit more flexible. It is still up to the modules in place,
> > >> what
> > >> you do with it. I am currently working on a collection support module
> in
> > >> the experimental part to gain more experience with it and also for
> > having
> > >> a
> > >> playground I could easily reference, blog on it and see, what other
> > people
> > >> think... ;)
> > >>
> > >> OK, so far?
> > >>
> > >> Cheers,
> > >> Anatole
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> > >>
> > >> Maybe you need to be more precise cause boot properties doesnt map to
> > very
> > >>> --
> > >>> N Oliver B. Fischer
> > >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > >>> P +49 30 44793251
> > >>> M +49 178 7903538
> > >>> E o.b.fischer@swe-blog.net
> > >>> S oliver.b.fischer
> > >>> J oliver.b.fischer@jabber.org
> > >>> X http://xing.to/obf
> > >>>
> > >>>
> > >>>
> > >>
> > > --
> > > N Oliver B. Fischer
> > > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > > P +49 30 44793251
> > > M +49 178 7903538
> > > E o.b.fischer@swe-blog.net
> > > S oliver.b.fischer
> > > J oliver.b.fischer@jabber.org
> > > X http://xing.to/obf
> > >
> > >
> >
> >
> > --
> > *Anatole Tresch*
> > Java Engineer & Architect, JSR Spec Lead
> > Glärnischweg 10
> > CH - 8620 Wetzikon
> >
> > *Switzerland, Europe Zurich, GMT+1*
> > *Twitter: @atsticks*
> > *Blogs: **http://javaremarkables.blogspot.ch/
> > <http://javaremarkables.blogspot.ch/>*
> >
> > *Google: atsticksMobile +41-76 344 62 79*
> >
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Well for collection, map and object it is useless since it is part of the
java side not the config IMO. That said it does make the context useless.
Le 30 oct. 2015 14:52, "Anatole Tresch" <at...@gmail.com> a écrit :
> Hi Oliver
>
> basically I would even not call append it. they are additional keys with
> allow to add additional information. Similar mechanisms could also be used
> for tracking the origin of the entries read. The format/syntax is not yet
> fixed (and also not implemented). I started in the experimental collections
> modul just with a small example configuration. I am happy to share thaughts
> on this.
> 1) I decided to use the {} for having a separation of meta entries, from
> other ones. Basically I could even filter out the meta-entries for normal
> access. So adding meta basically is possible, but I think we should try to
> be a bit more advanced to prevent clashes with anything users define. E.g.
> how about:
>
> a.b.mylist.__meta.collection-type=java.util.LinkedList
> a.b.mylist.__meta.element-type=int
> a.b.mylist.__meta.collection-separators=,;
>
> or even shorter:
>
> a.b.mylist.__collection-type=java.util.LinkedList
> a.b.mylist.__element-type=int
> a.b.mylist.__collection-separators=,;
>
> WDYT?
>
> Cheers,
> Anatole
>
>
> 2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
> > Thx Anatole, now I got it. As I understand you would like to append to
> the
> > actual key metadata (not to the key itself). This is fine for me!
> >
> > 1. Are these meta data optional? As I understand not.
> > 2. Could we change the syntax? Adding meta data sould work with every
> kind
> > of provider (db, JSON, YAML, something else,...}
> >
> > The curly braces are already used in JSON and other fileformat. Therefore
> > I would suggest to to use "metadata" or simply "meta" to divide the key
> > itself and the meta data.
> >
> > a.b.mylist.{collection-type}=java.util.LinkedList
> > a.b.mylist.{element-type}=int
> > a.b.mylist.{collection-separators)=,;
> >
> > would be
> >
> > a.b.mylist.meta.collection-type=java.util.LinkedList
> > a.b.mylist.meta.element-type=int
> > a.b.mylist.meta.collection-separators=,;
> >
> >
> > WDYT?
> >
> > Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> >
> >> Hi Oliver
> >>
> >> I do not disagree AFAIK... (inline more)...
> >>
> >> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <o.b.fischer@swe-blog.net
> >:
> >>
> >> To map complex data types we should YAML as format. But even complex
> data
> >>> structures could be expressed with property files:
> >>>
> >>> Example:
> >>>
> >>> class FooBar {
> >>> String foo;
> >>> int bar
> >>> }
> >>>
> >>> Representation:
> >>>
> >>> my.prefix.a.foo = "snafu"
> >>> my.prefix.a.bar = 42
> >>>
> >>> Agreed. That is one option how it can be done.
> >>>
> >>
> >>
> >>
> >> Code
> >>>
> >>> FooBar foobar = Configuration.get("my.prefix.a")
> >>>
> >>> WDYT?
> >>>
> >>> That is how it is...
> >>
> >> My use case is a simpler one:
> >>
> >> a.b.mylist=1,2,3
> >>
> >> Now I want to have an additional validation in place, define it should
> be
> >> traded as list and I want to use ',' as separator.
> >> This metadata could be added as well, e.g. by adding additional
> >> properties:
> >>
> >> a.b.mylist.{collection-type}=java.util.LinkedList
> >> a.b.mylist.{element-type}=int
> >> a.b.mylist.{collection-separators)=,;
> >>
> >> For being able to access these kind of "Meta" entries, I need to have
> >> access to the original key (a.b.mylist). So there is nothing changed on
> >> the
> >> basic configuration logic, despite it gets more flexible, e.g. I can
> also
> >> enhance the combination policy and allow to have the combination policy
> be
> >> adaptive, depending on the config data, e.g. by adding
> >>
> >> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
> >>
> >> Summarizing I did not change any of the basic mechanisms in place, I
> just
> >> made them a bit more flexible. It is still up to the modules in place,
> >> what
> >> you do with it. I am currently working on a collection support module in
> >> the experimental part to gain more experience with it and also for
> having
> >> a
> >> playground I could easily reference, blog on it and see, what other
> people
> >> think... ;)
> >>
> >> OK, so far?
> >>
> >> Cheers,
> >> Anatole
> >>
> >>
> >>
> >>
> >>
> >>
> >> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> >>
> >> Maybe you need to be more precise cause boot properties doesnt map to
> very
> >>> --
> >>> N Oliver B. Fischer
> >>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> >>> P +49 30 44793251
> >>> M +49 178 7903538
> >>> E o.b.fischer@swe-blog.net
> >>> S oliver.b.fischer
> >>> J oliver.b.fischer@jabber.org
> >>> X http://xing.to/obf
> >>>
> >>>
> >>>
> >>
> > --
> > N Oliver B. Fischer
> > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> > P +49 30 44793251
> > M +49 178 7903538
> > E o.b.fischer@swe-blog.net
> > S oliver.b.fischer
> > J oliver.b.fischer@jabber.org
> > X http://xing.to/obf
> >
> >
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79*
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
Hi Oliver
basically I would even not call append it. they are additional keys with
allow to add additional information. Similar mechanisms could also be used
for tracking the origin of the entries read. The format/syntax is not yet
fixed (and also not implemented). I started in the experimental collections
modul just with a small example configuration. I am happy to share thaughts
on this.
1) I decided to use the {} for having a separation of meta entries, from
other ones. Basically I could even filter out the meta-entries for normal
access. So adding meta basically is possible, but I think we should try to
be a bit more advanced to prevent clashes with anything users define. E.g.
how about:
a.b.mylist.__meta.collection-type=java.util.LinkedList
a.b.mylist.__meta.element-type=int
a.b.mylist.__meta.collection-separators=,;
or even shorter:
a.b.mylist.__collection-type=java.util.LinkedList
a.b.mylist.__element-type=int
a.b.mylist.__collection-separators=,;
WDYT?
Cheers,
Anatole
2015-10-30 15:10 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> Thx Anatole, now I got it. As I understand you would like to append to the
> actual key metadata (not to the key itself). This is fine for me!
>
> 1. Are these meta data optional? As I understand not.
> 2. Could we change the syntax? Adding meta data sould work with every kind
> of provider (db, JSON, YAML, something else,...}
>
> The curly braces are already used in JSON and other fileformat. Therefore
> I would suggest to to use "metadata" or simply "meta" to divide the key
> itself and the meta data.
>
> a.b.mylist.{collection-type}=java.util.LinkedList
> a.b.mylist.{element-type}=int
> a.b.mylist.{collection-separators)=,;
>
> would be
>
> a.b.mylist.meta.collection-type=java.util.LinkedList
> a.b.mylist.meta.element-type=int
> a.b.mylist.meta.collection-separators=,;
>
>
> WDYT?
>
> Am 30.10.15 um 00:17 schrieb Anatole Tresch:
>
>> Hi Oliver
>>
>> I do not disagree AFAIK... (inline more)...
>>
>> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> To map complex data types we should YAML as format. But even complex data
>>> structures could be expressed with property files:
>>>
>>> Example:
>>>
>>> class FooBar {
>>> String foo;
>>> int bar
>>> }
>>>
>>> Representation:
>>>
>>> my.prefix.a.foo = "snafu"
>>> my.prefix.a.bar = 42
>>>
>>> Agreed. That is one option how it can be done.
>>>
>>
>>
>>
>> Code
>>>
>>> FooBar foobar = Configuration.get("my.prefix.a")
>>>
>>> WDYT?
>>>
>>> That is how it is...
>>
>> My use case is a simpler one:
>>
>> a.b.mylist=1,2,3
>>
>> Now I want to have an additional validation in place, define it should be
>> traded as list and I want to use ',' as separator.
>> This metadata could be added as well, e.g. by adding additional
>> properties:
>>
>> a.b.mylist.{collection-type}=java.util.LinkedList
>> a.b.mylist.{element-type}=int
>> a.b.mylist.{collection-separators)=,;
>>
>> For being able to access these kind of "Meta" entries, I need to have
>> access to the original key (a.b.mylist). So there is nothing changed on
>> the
>> basic configuration logic, despite it gets more flexible, e.g. I can also
>> enhance the combination policy and allow to have the combination policy be
>> adaptive, depending on the config data, e.g. by adding
>>
>> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
>>
>> Summarizing I did not change any of the basic mechanisms in place, I just
>> made them a bit more flexible. It is still up to the modules in place,
>> what
>> you do with it. I am currently working on a collection support module in
>> the experimental part to gain more experience with it and also for having
>> a
>> playground I could easily reference, blog on it and see, what other people
>> think... ;)
>>
>> OK, so far?
>>
>> Cheers,
>> Anatole
>>
>>
>>
>>
>>
>>
>> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
>>
>> Maybe you need to be more precise cause boot properties doesnt map to very
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
Thx Anatole, now I got it. As I understand you would like to append to
the actual key metadata (not to the key itself). This is fine for me!
1. Are these meta data optional? As I understand not.
2. Could we change the syntax? Adding meta data sould work with every
kind of provider (db, JSON, YAML, something else,...}
The curly braces are already used in JSON and other fileformat.
Therefore I would suggest to to use "metadata" or simply "meta" to
divide the key itself and the meta data.
a.b.mylist.{collection-type}=java.util.LinkedList
a.b.mylist.{element-type}=int
a.b.mylist.{collection-separators)=,;
would be
a.b.mylist.meta.collection-type=java.util.LinkedList
a.b.mylist.meta.element-type=int
a.b.mylist.meta.collection-separators=,;
WDYT?
Am 30.10.15 um 00:17 schrieb Anatole Tresch:
> Hi Oliver
>
> I do not disagree AFAIK... (inline more)...
>
> 2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
>> To map complex data types we should YAML as format. But even complex data
>> structures could be expressed with property files:
>>
>> Example:
>>
>> class FooBar {
>> String foo;
>> int bar
>> }
>>
>> Representation:
>>
>> my.prefix.a.foo = "snafu"
>> my.prefix.a.bar = 42
>>
>> Agreed. That is one option how it can be done.
>
>
>
>> Code
>>
>> FooBar foobar = Configuration.get("my.prefix.a")
>>
>> WDYT?
>>
> That is how it is...
>
> My use case is a simpler one:
>
> a.b.mylist=1,2,3
>
> Now I want to have an additional validation in place, define it should be
> traded as list and I want to use ',' as separator.
> This metadata could be added as well, e.g. by adding additional properties:
>
> a.b.mylist.{collection-type}=java.util.LinkedList
> a.b.mylist.{element-type}=int
> a.b.mylist.{collection-separators)=,;
>
> For being able to access these kind of "Meta" entries, I need to have
> access to the original key (a.b.mylist). So there is nothing changed on the
> basic configuration logic, despite it gets more flexible, e.g. I can also
> enhance the combination policy and allow to have the combination policy be
> adaptive, depending on the config data, e.g. by adding
>
> a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
>
> Summarizing I did not change any of the basic mechanisms in place, I just
> made them a bit more flexible. It is still up to the modules in place, what
> you do with it. I am currently working on a collection support module in
> the experimental part to gain more experience with it and also for having a
> playground I could easily reference, blog on it and see, what other people
> think... ;)
>
> OK, so far?
>
> Cheers,
> Anatole
>
>
>
>
>
>
> Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
>
>> Maybe you need to be more precise cause boot properties doesnt map to very
>> --
>> N Oliver B. Fischer
>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>> P +49 30 44793251
>> M +49 178 7903538
>> E o.b.fischer@swe-blog.net
>> S oliver.b.fischer
>> J oliver.b.fischer@jabber.org
>> X http://xing.to/obf
>>
>>
>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
Hi Oliver
I do not disagree AFAIK... (inline more)...
2015-10-29 17:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> To map complex data types we should YAML as format. But even complex data
> structures could be expressed with property files:
>
> Example:
>
> class FooBar {
> String foo;
> int bar
> }
>
> Representation:
>
> my.prefix.a.foo = "snafu"
> my.prefix.a.bar = 42
>
> Agreed. That is one option how it can be done.
> Code
>
> FooBar foobar = Configuration.get("my.prefix.a")
>
> WDYT?
>
That is how it is...
My use case is a simpler one:
a.b.mylist=1,2,3
Now I want to have an additional validation in place, define it should be
traded as list and I want to use ',' as separator.
This metadata could be added as well, e.g. by adding additional properties:
a.b.mylist.{collection-type}=java.util.LinkedList
a.b.mylist.{element-type}=int
a.b.mylist.{collection-separators)=,;
For being able to access these kind of "Meta" entries, I need to have
access to the original key (a.b.mylist). So there is nothing changed on the
basic configuration logic, despite it gets more flexible, e.g. I can also
enhance the combination policy and allow to have the combination policy be
adaptive, depending on the config data, e.g. by adding
a.b.mylist.{combinationPolicy}=MyCombinationPolicyClass
Summarizing I did not change any of the basic mechanisms in place, I just
made them a bit more flexible. It is still up to the modules in place, what
you do with it. I am currently working on a collection support module in
the experimental part to gain more experience with it and also for having a
playground I could easily reference, blog on it and see, what other people
think... ;)
OK, so far?
Cheers,
Anatole
Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> Maybe you need to be more precise cause boot properties doesnt map to very
>> advance types. If you think to @ConfigurationProperties it is a way to map
>> its config but not the only one in enterprises AFAIK.
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-10-29 17:39 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> No, you can use property files with Spring boot.
>>>
>>> Am 29.10.15 um 17:19 schrieb Romain Manni-Bucau:
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
To map complex data types we should YAML as format. But even complex
data structures could be expressed with property files:
Example:
class FooBar {
String foo;
int bar
}
Representation:
my.prefix.a.foo = "snafu"
my.prefix.a.bar = 42
Code
FooBar foobar = Configuration.get("my.prefix.a")
WDYT?
Am 29.10.15 um 17:42 schrieb Romain Manni-Bucau:
> Maybe you need to be more precise cause boot properties doesnt map to very
> advance types. If you think to @ConfigurationProperties it is a way to map
> its config but not the only one in enterprises AFAIK.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-10-29 17:39 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
>> No, you can use property files with Spring boot.
>>
>> Am 29.10.15 um 17:19 schrieb Romain Manni-Bucau:
>>
>> --
>> N Oliver B. Fischer
>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>> P +49 30 44793251
>> M +49 178 7903538
>> E o.b.fischer@swe-blog.net
>> S oliver.b.fischer
>> J oliver.b.fischer@jabber.org
>> X http://xing.to/obf
>>
>>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Maybe you need to be more precise cause boot properties doesnt map to very
advance types. If you think to @ConfigurationProperties it is a way to map
its config but not the only one in enterprises AFAIK.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-10-29 17:39 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> No, you can use property files with Spring boot.
>
> Am 29.10.15 um 17:19 schrieb Romain Manni-Bucau:
>
>> cause they don't use properties?
>>
>> That said I saw it used in spring apps (thanks ThreadLocal ;))
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-10-29 17:17 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> And why can Spring do this without such cumbersome syntax?
>>>
>>>
>>> Am 29.10.15 um 17:02 schrieb Romain Manni-Bucau:
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
No, you can use property files with Spring boot.
Am 29.10.15 um 17:19 schrieb Romain Manni-Bucau:
> cause they don't use properties?
>
> That said I saw it used in spring apps (thanks ThreadLocal ;))
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-10-29 17:17 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
>> And why can Spring do this without such cumbersome syntax?
>>
>>
>> Am 29.10.15 um 17:02 schrieb Romain Manni-Bucau:
>>
>> --
>> N Oliver B. Fischer
>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>> P +49 30 44793251
>> M +49 178 7903538
>> E o.b.fischer@swe-blog.net
>> S oliver.b.fischer
>> J oliver.b.fischer@jabber.org
>> X http://xing.to/obf
>>
>>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
cause they don't use properties?
That said I saw it used in spring apps (thanks ThreadLocal ;))
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-10-29 17:17 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> And why can Spring do this without such cumbersome syntax?
>
>
> Am 29.10.15 um 17:02 schrieb Romain Manni-Bucau:
>
>> com.company.config.foo= bar -> Map{foo:bar}
>>
>> converters are responsible of the syntax they handle, you can't suppose
>> anything on it cause almost all conventions are used in the nature - why a
>> config project is mainly a SPI.
>>
>>
>>
>>
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-10-29 16:59 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> Can you give me an example? I can't imagine a good example...
>>>
>>> Am 29.10.15 um 16:51 schrieb Romain Manni-Bucau:
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
And why can Spring do this without such cumbersome syntax?
Am 29.10.15 um 17:02 schrieb Romain Manni-Bucau:
> com.company.config.foo= bar -> Map{foo:bar}
>
> converters are responsible of the syntax they handle, you can't suppose
> anything on it cause almost all conventions are used in the nature - why a
> config project is mainly a SPI.
>
>
>
>
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-10-29 16:59 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
>> Can you give me an example? I can't imagine a good example...
>>
>> Am 29.10.15 um 16:51 schrieb Romain Manni-Bucau:
>>
>> --
>> N Oliver B. Fischer
>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>> P +49 30 44793251
>> M +49 178 7903538
>> E o.b.fischer@swe-blog.net
>> S oliver.b.fischer
>> J oliver.b.fischer@jabber.org
>> X http://xing.to/obf
>>
>>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
com.company.config.foo= bar -> Map{foo:bar}
converters are responsible of the syntax they handle, you can't suppose
anything on it cause almost all conventions are used in the nature - why a
config project is mainly a SPI.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-10-29 16:59 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> Can you give me an example? I can't imagine a good example...
>
> Am 29.10.15 um 16:51 schrieb Romain Manni-Bucau:
>
>> it is common to have a class or a class mapping in the key. We cant escape
>> it I fear. Also for map handling you need the key to have the prefix to
>> use.
>>
>> Next step is object mapping where the issue is the exact same: you need a
>> prefix so the key.
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-10-29 16:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>>
>> Hi,
>>>
>>> clean you please explain, why the key is needed for a converter?
>>>
>>> IMHO the key is only an identifier and should not carry any additional
>>> information. Working now in a team with many different services and
>>> different configuration mechanisms I see how dangerous is could be if
>>> there
>>> is such a hidden meaning and how confusing it could be if things like
>>>
>>> a.b.c.d = 20:20
>>> a.b.c.e = 20:20
>>>
>>> Configuration.get("a.b.c.d") != Configuration.get("a.b.c.d")
>>>
>>> IMHO this would allow a lot of dirty hacks which helps to decrease the
>>> maintainability of a software project.
>>>
>>>
>>> May I miss something... But I am open for arguments.
>>>
>>> Oliver
>>>
>>> Am 29.10.15 um 01:34 schrieb Anatole Tresch:
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E o.b.fischer@swe-blog.net
>>> S oliver.b.fischer
>>> J oliver.b.fischer@jabber.org
>>> X http://xing.to/obf
>>>
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
Can you give me an example? I can't imagine a good example...
Am 29.10.15 um 16:51 schrieb Romain Manni-Bucau:
> it is common to have a class or a class mapping in the key. We cant escape
> it I fear. Also for map handling you need the key to have the prefix to use.
>
> Next step is object mapping where the issue is the exact same: you need a
> prefix so the key.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-10-29 16:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
>
>> Hi,
>>
>> clean you please explain, why the key is needed for a converter?
>>
>> IMHO the key is only an identifier and should not carry any additional
>> information. Working now in a team with many different services and
>> different configuration mechanisms I see how dangerous is could be if there
>> is such a hidden meaning and how confusing it could be if things like
>>
>> a.b.c.d = 20:20
>> a.b.c.e = 20:20
>>
>> Configuration.get("a.b.c.d") != Configuration.get("a.b.c.d")
>>
>> IMHO this would allow a lot of dirty hacks which helps to decrease the
>> maintainability of a software project.
>>
>>
>> May I miss something... But I am open for arguments.
>>
>> Oliver
>>
>> Am 29.10.15 um 01:34 schrieb Anatole Tresch:
>>
>> --
>> N Oliver B. Fischer
>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>> P +49 30 44793251
>> M +49 178 7903538
>> E o.b.fischer@swe-blog.net
>> S oliver.b.fischer
>> J oliver.b.fischer@jabber.org
>> X http://xing.to/obf
>>
>>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
it is common to have a class or a class mapping in the key. We cant escape
it I fear. Also for map handling you need the key to have the prefix to use.
Next step is object mapping where the issue is the exact same: you need a
prefix so the key.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-10-29 16:47 GMT+01:00 Oliver B. Fischer <o....@swe-blog.net>:
> Hi,
>
> clean you please explain, why the key is needed for a converter?
>
> IMHO the key is only an identifier and should not carry any additional
> information. Working now in a team with many different services and
> different configuration mechanisms I see how dangerous is could be if there
> is such a hidden meaning and how confusing it could be if things like
>
> a.b.c.d = 20:20
> a.b.c.e = 20:20
>
> Configuration.get("a.b.c.d") != Configuration.get("a.b.c.d")
>
> IMHO this would allow a lot of dirty hacks which helps to decrease the
> maintainability of a software project.
>
>
> May I miss something... But I am open for arguments.
>
> Oliver
>
> Am 29.10.15 um 01:34 schrieb Anatole Tresch:
>
>> Hi all,
>>
>> I am currently working on different extensions for Tamaya. So far our
>> API/SPI worked perfectly. Now I have a use case, where I would like to ask
>> for your opinion because I would like to extend the SPI. Currently the
>> PropertyConverter is defined as follows:
>>
>> public interface PropertyConverter<T>{
>> T convert(String value);
>> }
>>
>> Now the issue with this is, that for supporting collection types (and
>> possibly also other similar use cases) I need additional information.
>> As of now this information is stored as part of the configuration,
>> which is fine (no additional mechanism is needed). But since, I do not
>> have any information on the *key* accessed, I cannot evaluate this
>> metadata within the converter. So my simple solution would be to
>> simply add the requested key as parameter to the convert method like
>> this:
>>
>> public interface PropertyConverter<T>{
>> T convert(String key, String value);
>> }
>>
>> Without any further objections or a better proposal I would introduce
>> this change later this week (and open a corresponding ticket, so it is
>> well documented in the release notes).
>>
>> So let me know what you think ;)
>>
>> Cheers,
>>
>> Anatole
>>
>>
>>
>>
>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E o.b.fischer@swe-blog.net
> S oliver.b.fischer
> J oliver.b.fischer@jabber.org
> X http://xing.to/obf
>
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by "Oliver B. Fischer" <o....@swe-blog.net>.
Hi,
clean you please explain, why the key is needed for a converter?
IMHO the key is only an identifier and should not carry any additional
information. Working now in a team with many different services and
different configuration mechanisms I see how dangerous is could be if
there is such a hidden meaning and how confusing it could be if things like
a.b.c.d = 20:20
a.b.c.e = 20:20
Configuration.get("a.b.c.d") != Configuration.get("a.b.c.d")
IMHO this would allow a lot of dirty hacks which helps to decrease the
maintainability of a software project.
May I miss something... But I am open for arguments.
Oliver
Am 29.10.15 um 01:34 schrieb Anatole Tresch:
> Hi all,
>
> I am currently working on different extensions for Tamaya. So far our
> API/SPI worked perfectly. Now I have a use case, where I would like to ask
> for your opinion because I would like to extend the SPI. Currently the
> PropertyConverter is defined as follows:
>
> public interface PropertyConverter<T>{
> T convert(String value);
> }
>
> Now the issue with this is, that for supporting collection types (and
> possibly also other similar use cases) I need additional information.
> As of now this information is stored as part of the configuration,
> which is fine (no additional mechanism is needed). But since, I do not
> have any information on the *key* accessed, I cannot evaluate this
> metadata within the converter. So my simple solution would be to
> simply add the requested key as parameter to the convert method like
> this:
>
> public interface PropertyConverter<T>{
> T convert(String key, String value);
> }
>
> Without any further objections or a better proposal I would introduce
> this change later this week (and open a corresponding ticket, so it is
> well documented in the release notes).
>
> So let me know what you think ;)
>
> Cheers,
>
> Anatole
>
>
>
>
--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E o.b.fischer@swe-blog.net
S oliver.b.fischer
J oliver.b.fischer@jabber.org
X http://xing.to/obf
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Why not having an abstract impl providing this API instead of duplicating
data on the main API?
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-10-29 11:01 GMT+01:00 Anatole Tresch <at...@gmail.com>:
> I left the value separate. Reason is that it make forwarding of conversion
> operations easier (as it is done several times in our impl and has proben
> to be useful). So the signature will be
>
> <T> T convert(String value, ConversionContext context);
>
> Cheers,
> Anatole
>
>
> 2015-10-29 8:45 GMT+01:00 Anatole Tresch <at...@gmail.com>:
>
> > What are your feeling about the value, we could integrate the value also
> > with the *ConversionContext*, so signature on PropertyConverter changes
> to
> >
> > <T> convert(ConversionContext context);
> >
> >
> >
> >
> >
> >
> > 2015-10-29 8:17 GMT+01:00 Anatole Tresch <at...@gmail.com>:
> >
> >> Fait enough, I was thinking of somenthing similar as well. Also because
> >> we could also include other metadata straight away, e.g. default values,
> >> contents from annotations etc.
> >>
> >> 2015-10-29 7:35 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> >>
> >>> Next will be to need a hierarchy so I d go directly with a
> >>> ConverterContext
> >>> to not break user impl with each release.
> >>> Le 29 oct. 2015 01:35, "Anatole Tresch" <at...@gmail.com> a écrit :
> >>>
> >>> > Hi all,
> >>> >
> >>> > I am currently working on different extensions for Tamaya. So far our
> >>> > API/SPI worked perfectly. Now I have a use case, where I would like
> to
> >>> ask
> >>> > for your opinion because I would like to extend the SPI. Currently
> the
> >>> > PropertyConverter is defined as follows:
> >>> >
> >>> > public interface PropertyConverter<T>{
> >>> > T convert(String value);
> >>> > }
> >>> >
> >>> > Now the issue with this is, that for supporting collection types (and
> >>> > possibly also other similar use cases) I need additional information.
> >>> > As of now this information is stored as part of the configuration,
> >>> > which is fine (no additional mechanism is needed). But since, I do
> not
> >>> > have any information on the *key* accessed, I cannot evaluate this
> >>> > metadata within the converter. So my simple solution would be to
> >>> > simply add the requested key as parameter to the convert method like
> >>> > this:
> >>> >
> >>> > public interface PropertyConverter<T>{
> >>> > T convert(String key, String value);
> >>> > }
> >>> >
> >>> > Without any further objections or a better proposal I would introduce
> >>> > this change later this week (and open a corresponding ticket, so it
> is
> >>> > well documented in the release notes).
> >>> >
> >>> > So let me know what you think ;)
> >>> >
> >>> > Cheers,
> >>> >
> >>> > Anatole
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > *Anatole Tresch*
> >>> > Java Engineer & Architect, JSR Spec Lead
> >>> > Glärnischweg 10
> >>> > CH - 8620 Wetzikon
> >>> >
> >>> > *Switzerland, Europe Zurich, GMT+1*
> >>> > *Twitter: @atsticks*
> >>> > *Blogs: **http://javaremarkables.blogspot.ch/
> >>> > <http://javaremarkables.blogspot.ch/>*
> >>> >
> >>> > *Google: atsticksMobile +41-76 344 62 79*
> >>> >
> >>>
> >>
> >>
> >>
> >> --
> >> *Anatole Tresch*
> >> Java Engineer & Architect, JSR Spec Lead
> >> Glärnischweg 10
> >> CH - 8620 Wetzikon
> >>
> >> *Switzerland, Europe Zurich, GMT+1*
> >> *Twitter: @atsticks*
> >> *Blogs: **http://javaremarkables.blogspot.ch/
> >> <http://javaremarkables.blogspot.ch/>*
> >>
> >> *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>*
> >>
> >>
> >
> >
> > --
> > *Anatole Tresch*
> > Java Engineer & Architect, JSR Spec Lead
> > Glärnischweg 10
> > CH - 8620 Wetzikon
> >
> > *Switzerland, Europe Zurich, GMT+1*
> > *Twitter: @atsticks*
> > *Blogs: **http://javaremarkables.blogspot.ch/
> > <http://javaremarkables.blogspot.ch/>*
> >
> > *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>*
> >
> >
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79*
>
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
I left the value separate. Reason is that it make forwarding of conversion
operations easier (as it is done several times in our impl and has proben
to be useful). So the signature will be
<T> T convert(String value, ConversionContext context);
Cheers,
Anatole
2015-10-29 8:45 GMT+01:00 Anatole Tresch <at...@gmail.com>:
> What are your feeling about the value, we could integrate the value also
> with the *ConversionContext*, so signature on PropertyConverter changes to
>
> <T> convert(ConversionContext context);
>
>
>
>
>
>
> 2015-10-29 8:17 GMT+01:00 Anatole Tresch <at...@gmail.com>:
>
>> Fait enough, I was thinking of somenthing similar as well. Also because
>> we could also include other metadata straight away, e.g. default values,
>> contents from annotations etc.
>>
>> 2015-10-29 7:35 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
>>
>>> Next will be to need a hierarchy so I d go directly with a
>>> ConverterContext
>>> to not break user impl with each release.
>>> Le 29 oct. 2015 01:35, "Anatole Tresch" <at...@gmail.com> a écrit :
>>>
>>> > Hi all,
>>> >
>>> > I am currently working on different extensions for Tamaya. So far our
>>> > API/SPI worked perfectly. Now I have a use case, where I would like to
>>> ask
>>> > for your opinion because I would like to extend the SPI. Currently the
>>> > PropertyConverter is defined as follows:
>>> >
>>> > public interface PropertyConverter<T>{
>>> > T convert(String value);
>>> > }
>>> >
>>> > Now the issue with this is, that for supporting collection types (and
>>> > possibly also other similar use cases) I need additional information.
>>> > As of now this information is stored as part of the configuration,
>>> > which is fine (no additional mechanism is needed). But since, I do not
>>> > have any information on the *key* accessed, I cannot evaluate this
>>> > metadata within the converter. So my simple solution would be to
>>> > simply add the requested key as parameter to the convert method like
>>> > this:
>>> >
>>> > public interface PropertyConverter<T>{
>>> > T convert(String key, String value);
>>> > }
>>> >
>>> > Without any further objections or a better proposal I would introduce
>>> > this change later this week (and open a corresponding ticket, so it is
>>> > well documented in the release notes).
>>> >
>>> > So let me know what you think ;)
>>> >
>>> > Cheers,
>>> >
>>> > Anatole
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > *Anatole Tresch*
>>> > Java Engineer & Architect, JSR Spec Lead
>>> > Glärnischweg 10
>>> > CH - 8620 Wetzikon
>>> >
>>> > *Switzerland, Europe Zurich, GMT+1*
>>> > *Twitter: @atsticks*
>>> > *Blogs: **http://javaremarkables.blogspot.ch/
>>> > <http://javaremarkables.blogspot.ch/>*
>>> >
>>> > *Google: atsticksMobile +41-76 344 62 79*
>>> >
>>>
>>
>>
>>
>> --
>> *Anatole Tresch*
>> Java Engineer & Architect, JSR Spec Lead
>> Glärnischweg 10
>> CH - 8620 Wetzikon
>>
>> *Switzerland, Europe Zurich, GMT+1*
>> *Twitter: @atsticks*
>> *Blogs: **http://javaremarkables.blogspot.ch/
>> <http://javaremarkables.blogspot.ch/>*
>>
>> *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>*
>>
>>
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>*
>
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
What are your feeling about the value, we could integrate the value also
with the *ConversionContext*, so signature on PropertyConverter changes to
<T> convert(ConversionContext context);
2015-10-29 8:17 GMT+01:00 Anatole Tresch <at...@gmail.com>:
> Fait enough, I was thinking of somenthing similar as well. Also because we
> could also include other metadata straight away, e.g. default values,
> contents from annotations etc.
>
> 2015-10-29 7:35 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> Next will be to need a hierarchy so I d go directly with a
>> ConverterContext
>> to not break user impl with each release.
>> Le 29 oct. 2015 01:35, "Anatole Tresch" <at...@gmail.com> a écrit :
>>
>> > Hi all,
>> >
>> > I am currently working on different extensions for Tamaya. So far our
>> > API/SPI worked perfectly. Now I have a use case, where I would like to
>> ask
>> > for your opinion because I would like to extend the SPI. Currently the
>> > PropertyConverter is defined as follows:
>> >
>> > public interface PropertyConverter<T>{
>> > T convert(String value);
>> > }
>> >
>> > Now the issue with this is, that for supporting collection types (and
>> > possibly also other similar use cases) I need additional information.
>> > As of now this information is stored as part of the configuration,
>> > which is fine (no additional mechanism is needed). But since, I do not
>> > have any information on the *key* accessed, I cannot evaluate this
>> > metadata within the converter. So my simple solution would be to
>> > simply add the requested key as parameter to the convert method like
>> > this:
>> >
>> > public interface PropertyConverter<T>{
>> > T convert(String key, String value);
>> > }
>> >
>> > Without any further objections or a better proposal I would introduce
>> > this change later this week (and open a corresponding ticket, so it is
>> > well documented in the release notes).
>> >
>> > So let me know what you think ;)
>> >
>> > Cheers,
>> >
>> > Anatole
>> >
>> >
>> >
>> >
>> > --
>> > *Anatole Tresch*
>> > Java Engineer & Architect, JSR Spec Lead
>> > Glärnischweg 10
>> > CH - 8620 Wetzikon
>> >
>> > *Switzerland, Europe Zurich, GMT+1*
>> > *Twitter: @atsticks*
>> > *Blogs: **http://javaremarkables.blogspot.ch/
>> > <http://javaremarkables.blogspot.ch/>*
>> >
>> > *Google: atsticksMobile +41-76 344 62 79*
>> >
>>
>
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>*
>
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Anatole Tresch <at...@gmail.com>.
Fait enough, I was thinking of somenthing similar as well. Also because we
could also include other metadata straight away, e.g. default values,
contents from annotations etc.
2015-10-29 7:35 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> Next will be to need a hierarchy so I d go directly with a ConverterContext
> to not break user impl with each release.
> Le 29 oct. 2015 01:35, "Anatole Tresch" <at...@gmail.com> a écrit :
>
> > Hi all,
> >
> > I am currently working on different extensions for Tamaya. So far our
> > API/SPI worked perfectly. Now I have a use case, where I would like to
> ask
> > for your opinion because I would like to extend the SPI. Currently the
> > PropertyConverter is defined as follows:
> >
> > public interface PropertyConverter<T>{
> > T convert(String value);
> > }
> >
> > Now the issue with this is, that for supporting collection types (and
> > possibly also other similar use cases) I need additional information.
> > As of now this information is stored as part of the configuration,
> > which is fine (no additional mechanism is needed). But since, I do not
> > have any information on the *key* accessed, I cannot evaluate this
> > metadata within the converter. So my simple solution would be to
> > simply add the requested key as parameter to the convert method like
> > this:
> >
> > public interface PropertyConverter<T>{
> > T convert(String key, String value);
> > }
> >
> > Without any further objections or a better proposal I would introduce
> > this change later this week (and open a corresponding ticket, so it is
> > well documented in the release notes).
> >
> > So let me know what you think ;)
> >
> > Cheers,
> >
> > Anatole
> >
> >
> >
> >
> > --
> > *Anatole Tresch*
> > Java Engineer & Architect, JSR Spec Lead
> > Glärnischweg 10
> > CH - 8620 Wetzikon
> >
> > *Switzerland, Europe Zurich, GMT+1*
> > *Twitter: @atsticks*
> > *Blogs: **http://javaremarkables.blogspot.ch/
> > <http://javaremarkables.blogspot.ch/>*
> >
> > *Google: atsticksMobile +41-76 344 62 79*
> >
>
--
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter: @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile +41-76 344 62 79*
Re: Passing additionally the accessed key to PropertyConverter.convert
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Next will be to need a hierarchy so I d go directly with a ConverterContext
to not break user impl with each release.
Le 29 oct. 2015 01:35, "Anatole Tresch" <at...@gmail.com> a écrit :
> Hi all,
>
> I am currently working on different extensions for Tamaya. So far our
> API/SPI worked perfectly. Now I have a use case, where I would like to ask
> for your opinion because I would like to extend the SPI. Currently the
> PropertyConverter is defined as follows:
>
> public interface PropertyConverter<T>{
> T convert(String value);
> }
>
> Now the issue with this is, that for supporting collection types (and
> possibly also other similar use cases) I need additional information.
> As of now this information is stored as part of the configuration,
> which is fine (no additional mechanism is needed). But since, I do not
> have any information on the *key* accessed, I cannot evaluate this
> metadata within the converter. So my simple solution would be to
> simply add the requested key as parameter to the convert method like
> this:
>
> public interface PropertyConverter<T>{
> T convert(String key, String value);
> }
>
> Without any further objections or a better proposal I would introduce
> this change later this week (and open a corresponding ticket, so it is
> well documented in the release notes).
>
> So let me know what you think ;)
>
> Cheers,
>
> Anatole
>
>
>
>
> --
> *Anatole Tresch*
> Java Engineer & Architect, JSR Spec Lead
> Glärnischweg 10
> CH - 8620 Wetzikon
>
> *Switzerland, Europe Zurich, GMT+1*
> *Twitter: @atsticks*
> *Blogs: **http://javaremarkables.blogspot.ch/
> <http://javaremarkables.blogspot.ch/>*
>
> *Google: atsticksMobile +41-76 344 62 79*
>