Re: [picocontainer-dev] JSR330 work progress

Paul Hammant <[email protected]> Mon, 2 Aug 2010 18:55:59 -0500
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
--0015175cdff83b41b2048cdff12c
Content-Type: text/plain; charset=ISO-8859-1

BSD is viewed as the lowest common denominator for OSS licenses.  It permits
commercial, 'open' and 'free' usages.  Read
http://stackoverflow.com/questions/40100/apache-licence-vs-bsd-vs-mit at
least.

For you, if there were a GPL2 OSS piece that wanted to use JType, they could
not.  They could update to GPL3 throughout, but they may not have all the
permissions of the copyright holders to do so (one might be dead for
example).  That's admittedly an incredibly tenuous situation for a niche
library like JType - sorry for wasting a minute of any reader's life!

Regards,

- Paul

On Mon, Aug 2, 2010 at 9:41 AM, Mark Hobson <[email protected]> wrote:

> 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.  Nice work. Zero deps == I like.   I'm 90% confident
> > that Pico (BSD) can import Apache License 2.0 code w/o problem.  But just
> > out of interest, why'd you never consider BSD ?  Or is it your employer's
> > choice ?
> > If its a good fit, I think we should perhaps 'shade' it in to the Pico
> jar,
> > such that Pico's deps don't grow*.  We already do this for Paranamer, so
> I
> > think its fine.  However that's almost invisible.  With a type system
> > though, there's a possibility that someone else using the type system,
> might
> > curse us for making that decision.  We'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].  It 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/Generic.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.
>  There'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.  Looking at the PicoContainer API, you'll
> >> > see
> >> >     <T> T getComponent(TypeOf<T> componentType);
> >> > .. in addition to ..
> >> >     <T> T getComponent(Class<T> componentType);
> >> > TypeOf is used rather than Type itself because one cannot do the
> >> > following
> >> > in Java:
> >> >      List<Color> colors = pico.getComponent(List<Color>.class);
> >> > Instead (and like Guice), we'll have to do:
> >> >      List<Color> colors = pico.getComponent(new TypeOf<Color>(){}); //
> >> > note
> >> > the anon inner class
> >> > TypeOf is doing a getGenericSuperclass() call to preserve the generics
> >> > info.
> >> >  I'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
> general
> >> > key
> >> > for items.  Thus even 'old fashioned' Class keys are morphed into
> >> > TypeOfs
> >> > via TypeOf.fromClass(Class c) calls.
> >> > - Paul
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

--0015175cdff83b41b2048cdff12c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

BSD is viewed as the lowest common denominator for OSS licenses. =A0It perm=
its commercial, &#39;open&#39; and &#39;free&#39; usages. =A0Read=A0<a href=
=3D"http://stackoverflow.com/questions/40100/apache-licence-vs-bsd-vs-mit">=
http://stackoverflow.com/questions/40100/apache-licence-vs-bsd-vs-mit</a> a=
t least.<div>
<br></div><div>For you, if there were a GPL2 OSS piece that wanted to use J=
Type, they could not. =A0They could update to GPL3 throughout, but they may=
 not have all the permissions of the copyright holders to do so (one might =
be dead for example). =A0That&#39;s admittedly an incredibly tenuous situat=
ion for a niche library like JType - sorry for wasting a minute of any read=
er&#39;s life!</div>
<div><br></div><div>Regards,</div><div><br></div><div>- Paul<br><br><div cl=
ass=3D"gmail_quote">On Mon, Aug 2, 2010 at 9:41 AM, Mark Hobson <span dir=
=3D"ltr">&lt;<a href=3D"mailto:[email protected]">[email protected]</=
a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">Cool. =A0It&#39;ll certainly stay with no d=
ependencies, it&#39;s a too small<br>
library to warrant any! =A0I&#39;m no license expert, what&#39;s the advant=
age<br>
of BSD over ASL?<br>
<br>
Shading it into Pico would be a good first step. =A0Hibernate Validator<br>
already does this with JType to aid their JSR303 type handling.<br>
<br>
Cheers,<br>
<font color=3D"#888888"><br>
Mark<br>
</font><div><div></div><div class=3D"h5"><br>
On 30 July 2010 15:29, Paul Hammant &lt;<a href=3D"mailto:[email protected]"=
>[email protected]</a>&gt; wrote:<br>
&gt; Sure I&#39;d love help. =A0Nice work. Zero deps =3D=3D I like. =A0 I&#=
39;m 90% confident<br>
&gt; that Pico (BSD) can import Apache License 2.0 code w/o problem. =A0But=
 just<br>
&gt; out of interest, why&#39;d you never consider BSD ? =A0Or is it your e=
mployer&#39;s<br>
&gt; choice ?<br>
&gt; If its a good fit, I think we should perhaps &#39;shade&#39; it in to =
the Pico jar,<br>
&gt; such that Pico&#39;s deps don&#39;t grow*. =A0We already do this for P=
aranamer, so I<br>
&gt; think its fine. =A0However that&#39;s almost invisible. =A0With a type=
 system<br>
&gt; though, there&#39;s a possibility that someone else using the type sys=
tem, might<br>
&gt; curse us for making that decision. =A0We&#39;d need to play through so=
me real-life<br>
&gt; scenarios before we worked out whether that was right or wrong.<br>
&gt; Things for pinging us Mark.<br>
&gt; - Paul<br>
&gt;<br>
&gt; * JSR 330 / @Inject might have to be an external dep.<br>
&gt; On Fri, Jul 30, 2010 at 5:19 AM, Mark Hobson &lt;<a href=3D"mailto:mar=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Good to see that work is progressing on JSR330 Paul!<br>
&gt;&gt;<br>
&gt;&gt; I know I&#39;ve mentioned it before, and it may be more pertinent =
now<br>
&gt;&gt; regarding TypeOf, but JType [1] has support for type literals via<=
br>
&gt;&gt; Generic&lt;T&gt; [2]. =A0It also provides various factory methods =
to construct<br>
&gt;&gt; them in Generics and implements the complicated type assignability=
<br>
&gt;&gt; logic in TypeUtils.isAssignable, which I guess you&#39;ll need.<br=
>
&gt;&gt;<br>
&gt;&gt; I&#39;m happy to help out from the JType side of things if you wan=
ted to<br>
&gt;&gt; integrate it into Pico?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;&gt; Mark<br>
&gt;&gt;<br>
&gt;&gt; [1] <a href=3D"http://code.google.com/p/jtype/" target=3D"_blank">=
http://code.google.com/p/jtype/</a><br>
&gt;&gt; [2]<br>
&gt;&gt; <a href=3D"http://jtype.googlecode.com/svn/site/apidocs/com/google=
code/jtype/Generic.html" target=3D"_blank">http://jtype.googlecode.com/svn/=
site/apidocs/com/googlecode/jtype/Generic.html</a><br>
&gt;&gt;<br>
&gt;&gt; On 23 July 2010 10:23, Paul Hammant &lt;<a href=3D"mailto:paul@ham=
mant.org">[email protected]</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi folks,<br>
&gt;&gt; &gt; I&#39;m working towards JSR330 compatibility in the Git Pico3=
 repo. =A0There&#39;s<br>
&gt;&gt; &gt; a<br>
&gt;&gt; &gt; TCK that comes with JSR330 so tracking progress is easy.<br>
&gt;&gt; &gt; First up, I&#39;ve had to add a mechanism to a) preserve type=
 erasure and b)<br>
&gt;&gt; &gt; allow lookup based on types. =A0Looking at the PicoContainer =
API, you&#39;ll<br>
&gt;&gt; &gt; see<br>
&gt;&gt; &gt; =A0=A0 =A0&lt;T&gt; T getComponent(TypeOf&lt;T&gt; componentT=
ype);<br>
&gt;&gt; &gt; .. in addition to ..<br>
&gt;&gt; &gt; =A0=A0 =A0&lt;T&gt; T getComponent(Class&lt;T&gt; componentTy=
pe);<br>
&gt;&gt; &gt; TypeOf is used rather than Type itself because one cannot do =
the<br>
&gt;&gt; &gt; following<br>
&gt;&gt; &gt; in Java:<br>
&gt;&gt; &gt; =A0=A0 =A0 List&lt;Color&gt; colors =3D pico.getComponent(Lis=
t&lt;Color&gt;.class);<br>
&gt;&gt; &gt; Instead (and like Guice), we&#39;ll have to do:<br>
&gt;&gt; &gt; =A0=A0 =A0 List&lt;Color&gt; colors =3D pico.getComponent(new=
 TypeOf&lt;Color&gt;(){}); //<br>
&gt;&gt; &gt; note<br>
&gt;&gt; &gt; the anon inner class<br>
&gt;&gt; &gt; TypeOf is doing a=A0getGenericSuperclass() call to preserve t=
he generics<br>
&gt;&gt; &gt; info.<br>
&gt;&gt; &gt; =A0I&#39;ve to think more about references being held to Type=
Of instances<br>
&gt;&gt; &gt; because<br>
&gt;&gt; &gt; of the inner class consequences for garbage collection.<br>
&gt;&gt; &gt; Internally, PicoContainer is moving towards using TypeOf as t=
he general<br>
&gt;&gt; &gt; key<br>
&gt;&gt; &gt; for items. =A0Thus even &#39;old fashioned&#39; Class keys ar=
e morphed into<br>
&gt;&gt; &gt; TypeOfs<br>
&gt;&gt; &gt; via TypeOf.fromClass(Class c) calls.<br>
&gt;&gt; &gt; - Paul<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------=
---<br>
&gt;&gt; To unsubscribe from this list, please visit:<br>
&gt;&gt;<br>
&gt;&gt; =A0 =A0<a href=3D"http://xircles.codehaus.org/manage_email" target=
=3D"_blank">http://xircles.codehaus.org/manage_email</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
---------------------------------------------------------------------<br>
To unsubscribe from this list, please visit:<br>
<br>
 =A0 =A0<a href=3D"http://xircles.codehaus.org/manage_email" target=3D"_bla=
nk">http://xircles.codehaus.org/manage_email</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>

--0015175cdff83b41b2048cdff12c--