commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <dmi...@apache.org>
Subject Re: [clazz] Type-based or instance-based metadata?
Date Sat, 26 Oct 2002 16:33:28 GMT
Berin,

----- Original Message -----
From: "Berin Loritsch" <bloritsch@apache.org>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Friday, October 25, 2002 11:57 PM
Subject: Re: [clazz] Type-based or instance-based metadata?


> Dmitri Plotnikov wrote:
> > Another dilemma we'll have to resolve is whether metadata will be
> > type-based, instance-based or both.
> >
> > Here's what I am talking about:
> >
> > Let's say we have this class:
> >
> > class Address {
> >   public Object getStreet(){ return new String[]{"555", "Sole Pike"}; }
> >   public Comparable getCity() { return "Chipsburg"; }
> > }
> >
> > Type-based introspection (like java.beans.Introspector) will tell us
> > that "street" is a property of type "Object" and "city" has type
> > "Comparable".
> >
> > Instance-based introspection will give us "String[]" and "String"
> > respectively.
> >
> > Question: is "street" a collection (indexed) property? From the type's
> > prospective it is not, from the instance prospective it is.
>
> But what metadata are you looking at?  Your Address class is Data.  What
> data about the data are you looking for?  The examples you gave describe
> the Reflection API which is Type based.
>
> Most meta info that is useful is type based, not instance based.
I guess my examples are not very convincing.  What I am trying to say is
that type-based metadata is only as detailed as the type.  For example, if
you declare a property as "int" you have said quite a bit about the
property, however if you declare it as "Object" you have said almost
nothing.  Better yet, all DynaBeans are of the same type - DynaBean.
Looking at the type says nothing at all.  Same with Map.

> What you are looking at is instance based reflection info.  Not a more
> generic meta info.
First, we do want to have more metadata than mere reflection. We would like
to capture information on how to store XML with Betwixt or JAXB, how to
access objects with JXPath etc.

Second,  we are looking to support a wider variety of object models than can
be supported via Java reflection alone (DynaBeans, Maps etc)

> Meta info that is useful to me is things like this:
>
> * Creation policy (pooled components, thread local components, singleton
>     components, etc.)
Agreed.

> * Required components (i.e. when one component requires a component of
>     another type)
Could you provide more details on this one?

>
> Stuff along those lines.
>
> --
>
> "They that give up essential liberty to obtain a little temporary safety
>   deserve neither liberty nor safety."
>                  - Benjamin Franklin
>
>
- Dmitri


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message