Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 26692 invoked from network); 26 Oct 2002 03:57:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 26 Oct 2002 03:57:10 -0000 Received: (qmail 11990 invoked by uid 97); 26 Oct 2002 03:58:09 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 11960 invoked by uid 97); 26 Oct 2002 03:58:09 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 11948 invoked by uid 98); 26 Oct 2002 03:58:08 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3DBA1297.5000902@apache.org> Date: Fri, 25 Oct 2002 20:57:11 -0700 From: Berin Loritsch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [clazz] Type-based or instance-based metadata? References: <20021025183503.91925.qmail@web11708.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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. What you are looking at is instance based reflection info. Not a more generic meta info. Meta info that is useful to me is things like this: * Creation policy (pooled components, thread local components, singleton components, etc.) * Required components (i.e. when one component requires a component of another type) Stuff along those lines. -- "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin -- To unsubscribe, e-mail: For additional commands, e-mail: