You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2012/07/21 00:13:45 UTC

@Config without @inject?

Hi,

was wondering if we couldn't provide a @Config or support @ConfigProperty
(let say a marking annotation for the moment) for static conf avoiding
@Inject? it is more readable for me

wonder what you think about trying to make things shorter (while meta
annotations are not in cdi itself)

typically:

public class Pool {
    @Config("pool.size")
    private int size;
}

- Romain

Re: @Config without @inject?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i agree excepted both are currently linked, ie 2) can use 1) values

- Romain


2012/7/23 Mark Struberg <st...@yahoo.de>

> Actually there are 2 (almost) completely separated topics:
>
> 1.) ConfigProvider as a tool which is CDI agnostic but gets used by DS
> internally
> 2.) @ConfigProperty which is a set of CDI produers to have config access
> for cdi projects at runtime.
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Romain Manni-Bucau <rm...@gmail.com>
> > To: deltaspike-dev@incubator.apache.org
> > Cc:
> > Sent: Monday, July 23, 2012 11:59 AM
> > Subject: Re: @Config without @inject?
> >
> > we can see it another way too, config is a bit out of cdi to be
> accessible
> > from extensions, so why letting it out of cdi?
> >
> > was just an idea, that's not the most important stuff to do ;)
> >
> > - Romain
> >
> >
> > 2012/7/23 Pete Muir <pm...@redhat.com>
> >
> >>  +1, agree with Mark and Gerhard.
> >>
> >>  Shorter code is not always clearer code :-)
> >>
> >>  On 21 Jul 2012, at 00:45, Gerhard Petracek wrote:
> >>
> >>  > i agree with mark (that was also one of my arguments against it in
> our
> >>  > short (irc) discussion)
> >>  >
> >>  > regards,
> >>  > gerhard
> >>  >
> >>  >
> >>  >
> >>  > 2012/7/21 Mark Struberg <st...@yahoo.de>
> >>  >
> >>  >> It's technically possible but it's imo not more readable.
> >>  >> We already got there having tons of different annotations and
> > noone
> >>  knows
> >>  >> if this actually triggers some action or not. If you have an
> > explicit
> >>  >> @Inject in front, then all is clear.
> >>  >>
> >>  >> LieGrue,
> >>  >> strub
> >>  >>
> >>  >>
> >>  >>
> >>  >> ----- Original Message -----
> >>  >>> From: Romain Manni-Bucau <rm...@gmail.com>
> >>  >>> To: deltaspike-dev@incubator.apache.org
> >>  >>> Cc:
> >>  >>> Sent: Saturday, July 21, 2012 12:13 AM
> >>  >>> Subject: @Config without @inject?
> >>  >>>
> >>  >>> Hi,
> >>  >>>
> >>  >>> was wondering if we couldn't provide a @Config or support
> >>  @ConfigProperty
> >>  >>> (let say a marking annotation for the moment) for static conf
> > avoiding
> >>  >>> @Inject? it is more readable for me
> >>  >>>
> >>  >>> wonder what you think about trying to make things shorter
> > (while meta
> >>  >>> annotations are not in cdi itself)
> >>  >>>
> >>  >>> typically:
> >>  >>>
> >>  >>> public class Pool {
> >>  >>>    @Config("pool.size")
> >>  >>>    private int size;
> >>  >>> }
> >>  >>>
> >>  >>> - Romain
> >>  >>>
> >>  >>
> >>
> >>
> >
>

Re: @Config without @inject?

Posted by Mark Struberg <st...@yahoo.de>.
Actually there are 2 (almost) completely separated topics:

1.) ConfigProvider as a tool which is CDI agnostic but gets used by DS internally
2.) @ConfigProperty which is a set of CDI produers to have config access for cdi projects at runtime.

LieGrue,
strub



----- Original Message -----
> From: Romain Manni-Bucau <rm...@gmail.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Monday, July 23, 2012 11:59 AM
> Subject: Re: @Config without @inject?
> 
> we can see it another way too, config is a bit out of cdi to be accessible
> from extensions, so why letting it out of cdi?
> 
> was just an idea, that's not the most important stuff to do ;)
> 
> - Romain
> 
> 
> 2012/7/23 Pete Muir <pm...@redhat.com>
> 
>>  +1, agree with Mark and Gerhard.
>> 
>>  Shorter code is not always clearer code :-)
>> 
>>  On 21 Jul 2012, at 00:45, Gerhard Petracek wrote:
>> 
>>  > i agree with mark (that was also one of my arguments against it in our
>>  > short (irc) discussion)
>>  >
>>  > regards,
>>  > gerhard
>>  >
>>  >
>>  >
>>  > 2012/7/21 Mark Struberg <st...@yahoo.de>
>>  >
>>  >> It's technically possible but it's imo not more readable.
>>  >> We already got there having tons of different annotations and 
> noone
>>  knows
>>  >> if this actually triggers some action or not. If you have an 
> explicit
>>  >> @Inject in front, then all is clear.
>>  >>
>>  >> LieGrue,
>>  >> strub
>>  >>
>>  >>
>>  >>
>>  >> ----- Original Message -----
>>  >>> From: Romain Manni-Bucau <rm...@gmail.com>
>>  >>> To: deltaspike-dev@incubator.apache.org
>>  >>> Cc:
>>  >>> Sent: Saturday, July 21, 2012 12:13 AM
>>  >>> Subject: @Config without @inject?
>>  >>>
>>  >>> Hi,
>>  >>>
>>  >>> was wondering if we couldn't provide a @Config or support
>>  @ConfigProperty
>>  >>> (let say a marking annotation for the moment) for static conf 
> avoiding
>>  >>> @Inject? it is more readable for me
>>  >>>
>>  >>> wonder what you think about trying to make things shorter 
> (while meta
>>  >>> annotations are not in cdi itself)
>>  >>>
>>  >>> typically:
>>  >>>
>>  >>> public class Pool {
>>  >>>    @Config("pool.size")
>>  >>>    private int size;
>>  >>> }
>>  >>>
>>  >>> - Romain
>>  >>>
>>  >>
>> 
>> 
> 

Re: @Config without @inject?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
we can see it another way too, config is a bit out of cdi to be accessible
from extensions, so why letting it out of cdi?

was just an idea, that's not the most important stuff to do ;)

- Romain


2012/7/23 Pete Muir <pm...@redhat.com>

> +1, agree with Mark and Gerhard.
>
> Shorter code is not always clearer code :-)
>
> On 21 Jul 2012, at 00:45, Gerhard Petracek wrote:
>
> > i agree with mark (that was also one of my arguments against it in our
> > short (irc) discussion)
> >
> > regards,
> > gerhard
> >
> >
> >
> > 2012/7/21 Mark Struberg <st...@yahoo.de>
> >
> >> It's technically possible but it's imo not more readable.
> >> We already got there having tons of different annotations and noone
> knows
> >> if this actually triggers some action or not. If you have an explicit
> >> @Inject in front, then all is clear.
> >>
> >> LieGrue,
> >> strub
> >>
> >>
> >>
> >> ----- Original Message -----
> >>> From: Romain Manni-Bucau <rm...@gmail.com>
> >>> To: deltaspike-dev@incubator.apache.org
> >>> Cc:
> >>> Sent: Saturday, July 21, 2012 12:13 AM
> >>> Subject: @Config without @inject?
> >>>
> >>> Hi,
> >>>
> >>> was wondering if we couldn't provide a @Config or support
> @ConfigProperty
> >>> (let say a marking annotation for the moment) for static conf avoiding
> >>> @Inject? it is more readable for me
> >>>
> >>> wonder what you think about trying to make things shorter (while meta
> >>> annotations are not in cdi itself)
> >>>
> >>> typically:
> >>>
> >>> public class Pool {
> >>>    @Config("pool.size")
> >>>    private int size;
> >>> }
> >>>
> >>> - Romain
> >>>
> >>
>
>

Re: @Config without @inject?

Posted by Pete Muir <pm...@redhat.com>.
+1, agree with Mark and Gerhard.

Shorter code is not always clearer code :-)

On 21 Jul 2012, at 00:45, Gerhard Petracek wrote:

> i agree with mark (that was also one of my arguments against it in our
> short (irc) discussion)
> 
> regards,
> gerhard
> 
> 
> 
> 2012/7/21 Mark Struberg <st...@yahoo.de>
> 
>> It's technically possible but it's imo not more readable.
>> We already got there having tons of different annotations and noone knows
>> if this actually triggers some action or not. If you have an explicit
>> @Inject in front, then all is clear.
>> 
>> LieGrue,
>> strub
>> 
>> 
>> 
>> ----- Original Message -----
>>> From: Romain Manni-Bucau <rm...@gmail.com>
>>> To: deltaspike-dev@incubator.apache.org
>>> Cc:
>>> Sent: Saturday, July 21, 2012 12:13 AM
>>> Subject: @Config without @inject?
>>> 
>>> Hi,
>>> 
>>> was wondering if we couldn't provide a @Config or support @ConfigProperty
>>> (let say a marking annotation for the moment) for static conf avoiding
>>> @Inject? it is more readable for me
>>> 
>>> wonder what you think about trying to make things shorter (while meta
>>> annotations are not in cdi itself)
>>> 
>>> typically:
>>> 
>>> public class Pool {
>>>    @Config("pool.size")
>>>    private int size;
>>> }
>>> 
>>> - Romain
>>> 
>> 


Re: @Config without @inject?

Posted by Gerhard Petracek <ge...@gmail.com>.
i agree with mark (that was also one of my arguments against it in our
short (irc) discussion)

regards,
gerhard



2012/7/21 Mark Struberg <st...@yahoo.de>

> It's technically possible but it's imo not more readable.
> We already got there having tons of different annotations and noone knows
> if this actually triggers some action or not. If you have an explicit
> @Inject in front, then all is clear.
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Romain Manni-Bucau <rm...@gmail.com>
> > To: deltaspike-dev@incubator.apache.org
> > Cc:
> > Sent: Saturday, July 21, 2012 12:13 AM
> > Subject: @Config without @inject?
> >
> > Hi,
> >
> > was wondering if we couldn't provide a @Config or support @ConfigProperty
> > (let say a marking annotation for the moment) for static conf avoiding
> > @Inject? it is more readable for me
> >
> > wonder what you think about trying to make things shorter (while meta
> > annotations are not in cdi itself)
> >
> > typically:
> >
> > public class Pool {
> >     @Config("pool.size")
> >     private int size;
> > }
> >
> > - Romain
> >
>

Re: @Config without @inject?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you refine "all is clear"? if just a semantic point @InjectConfig is
fine and you gain a line (for a lot of user).

- Romain


2012/7/21 Mark Struberg <st...@yahoo.de>

> It's technically possible but it's imo not more readable.
> We already got there having tons of different annotations and noone knows
> if this actually triggers some action or not. If you have an explicit
> @Inject in front, then all is clear.
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Romain Manni-Bucau <rm...@gmail.com>
> > To: deltaspike-dev@incubator.apache.org
> > Cc:
> > Sent: Saturday, July 21, 2012 12:13 AM
> > Subject: @Config without @inject?
> >
> > Hi,
> >
> > was wondering if we couldn't provide a @Config or support @ConfigProperty
> > (let say a marking annotation for the moment) for static conf avoiding
> > @Inject? it is more readable for me
> >
> > wonder what you think about trying to make things shorter (while meta
> > annotations are not in cdi itself)
> >
> > typically:
> >
> > public class Pool {
> >     @Config("pool.size")
> >     private int size;
> > }
> >
> > - Romain
> >
>

Re: @Config without @inject?

Posted by Mark Struberg <st...@yahoo.de>.
It's technically possible but it's imo not more readable.
We already got there having tons of different annotations and noone knows if this actually triggers some action or not. If you have an explicit @Inject in front, then all is clear.

LieGrue,
strub



----- Original Message -----
> From: Romain Manni-Bucau <rm...@gmail.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Saturday, July 21, 2012 12:13 AM
> Subject: @Config without @inject?
> 
> Hi,
> 
> was wondering if we couldn't provide a @Config or support @ConfigProperty
> (let say a marking annotation for the moment) for static conf avoiding
> @Inject? it is more readable for me
> 
> wonder what you think about trying to make things shorter (while meta
> annotations are not in cdi itself)
> 
> typically:
> 
> public class Pool {
>     @Config("pool.size")
>     private int size;
> }
> 
> - Romain
>