You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2007/11/15 20:38:50 UTC

Re: [classlib][misc] Could we make ObjectAccessor.getInstance() public?

On 15 November 2007 at 10:22, "Nathan Beyer" <nb...@gmail.com> wrote:
> This is a class in a org.apache.harmony package. By general
> convention, these classes are for implementation use within Harmony
> only. At some point, these packages will be unavailable at runtime
> (via OSGi or the like restrictions).
>
> There may be exceptions to this rule, such as where Harmony will
> provide plug-in points, etc. However, I don't believe this is falls
> into that category. There are a number of reasons, but most of them
> fall under the fact that creating instances like this would circumvent
> many of basic tenants and assumptions of the class library and
> runtime.

+1

I don't think it would be wise to start having exceptions to this.
The fact is there is a standard way to do this (JNI AllocObject)
so user code should use this rather than doing something that is
harmony-specific.

Regards,
 Mark.

> On Nov 15, 2007 4:16 AM, Andrew Zhang <zh...@gmail.com> wrote:
> > Hi,
> >
> > I find some methods of ObjectAccessor are useful for some existing
> > applications and potential users, e.g, Object allocateObject(Class). Could
> > we make getInstance() public so that users can benefit from these utility
> > methods? Thanks!
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> > http://zhanghuangzhu.blogspot.com/
> >
> 



Re: [classlib][misc] Could we make ObjectAccessor.getInstance() public?

Posted by Andrew Zhang <zh...@gmail.com>.
On Nov 16, 2007 3:38 AM, Mark Hindess <ma...@googlemail.com> wrote:

>
> On 15 November 2007 at 10:22, "Nathan Beyer" <nb...@gmail.com> wrote:
> > This is a class in a org.apache.harmony package. By general
> > convention, these classes are for implementation use within Harmony
> > only. At some point, these packages will be unavailable at runtime
> > (via OSGi or the like restrictions).
> >
> > There may be exceptions to this rule, such as where Harmony will
> > provide plug-in points, etc. However, I don't believe this is falls
> > into that category. There are a number of reasons, but most of them
> > fall under the fact that creating instances like this would circumvent
> > many of basic tenants and assumptions of the class library and
> > runtime.
>
> +1
>
> I don't think it would be wise to start having exceptions to this.
> The fact is there is a standard way to do this (JNI AllocObject)
> so user code should use this rather than doing something that is
> harmony-specific.


The problem is that users have to distribute their jars with a .dll or .so
file for different platforms instead of single jars...


>
> Regards,
>  Mark.
>
> > On Nov 15, 2007 4:16 AM, Andrew Zhang <zh...@gmail.com> wrote:
> > > Hi,
> > >
> > > I find some methods of ObjectAccessor are useful for some existing
> > > applications and potential users, e.g, Object allocateObject(Class).
> Could
> > > we make getInstance() public so that users can benefit from these
> utility
> > > methods? Thanks!
> > >
> > > --
> > > Best regards,
> > > Andrew Zhang
> > >
> > > http://zhanghuangzhu.blogspot.com/
> > >
> >
>
>
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/