Re: [picocontainer-dev] JSR330 work progress

Mark Hobson <[email protected]> Mon, 2 Aug 2010 15:41:03 +0100
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Cool.  It'll certainly stay with no dependencies, it's a too small
library to warrant any!  I'm no license expert, what's the advantage
of BSD over ASL?

Shading it into Pico would be a good first step.  Hibernate Validator
already does this with JType to aid their JSR303 type handling.

Cheers,

Mark

On 30 July 2010 15:29, Paul Hammant <[email protected]> wrote:
> Sure I'd love help. =A0Nice work. Zero deps =3D=3D I like. =A0 I'm 90% co=
nfident
> that Pico (BSD) can import Apache License 2.0 code w/o problem. =A0But ju=
st
> out of interest, why'd you never consider BSD ? =A0Or is it your employer=
's
> choice ?
> If its a good fit, I think we should perhaps 'shade' it in to the Pico ja=
r,
> such that Pico's deps don't grow*. =A0We already do this for Paranamer, s=
o I
> think its fine. =A0However that's almost invisible. =A0With a type system
> though, there's a possibility that someone else using the type system, mi=
ght
> curse us for making that decision. =A0We'd need to play through some real=
-life
> scenarios before we worked out whether that was right or wrong.
> Things for pinging us Mark.
> - Paul
>
> * JSR 330 / @Inject might have to be an external dep.
> On Fri, Jul 30, 2010 at 5:19 AM, Mark Hobson <[email protected]> wrote=
:
>>
>> Good to see that work is progressing on JSR330 Paul!
>>
>> I know I've mentioned it before, and it may be more pertinent now
>> regarding TypeOf, but JType [1] has support for type literals via
>> Generic<T> [2]. =A0It also provides various factory methods to construct
>> them in Generics and implements the complicated type assignability
>> logic in TypeUtils.isAssignable, which I guess you'll need.
>>
>> I'm happy to help out from the JType side of things if you wanted to
>> integrate it into Pico?
>>
>> Cheers,
>>
>> Mark
>>
>> [1] http://code.google.com/p/jtype/
>> [2]
>> http://jtype.googlecode.com/svn/site/apidocs/com/googlecode/jtype/Generi=
c.html
>>
>> On 23 July 2010 10:23, Paul Hammant <[email protected]> wrote:
>> > Hi folks,
>> > I'm working towards JSR330 compatibility in the Git Pico3 repo. =A0The=
re's
>> > a
>> > TCK that comes with JSR330 so tracking progress is easy.
>> > First up, I've had to add a mechanism to a) preserve type erasure and =
b)
>> > allow lookup based on types. =A0Looking at the PicoContainer API, you'=
ll
>> > see
>> > =A0=A0 =A0<T> T getComponent(TypeOf<T> componentType);
>> > .. in addition to ..
>> > =A0=A0 =A0<T> T getComponent(Class<T> componentType);
>> > TypeOf is used rather than Type itself because one cannot do the
>> > following
>> > in Java:
>> > =A0=A0 =A0 List<Color> colors =3D pico.getComponent(List<Color>.class)=
;
>> > Instead (and like Guice), we'll have to do:
>> > =A0=A0 =A0 List<Color> colors =3D pico.getComponent(new TypeOf<Color>(=
){}); //
>> > note
>> > the anon inner class
>> > TypeOf is doing a=A0getGenericSuperclass() call to preserve the generi=
cs
>> > info.
>> > =A0I've to think more about references being held to TypeOf instances
>> > because
>> > of the inner class consequences for garbage collection.
>> > Internally, PicoContainer is moving towards using TypeOf as the genera=
l
>> > key
>> > for items. =A0Thus even 'old fashioned' Class keys are morphed into
>> > TypeOfs
>> > via TypeOf.fromClass(Class c) calls.
>> > - Paul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> =A0 =A0http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email