commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: New Component Idea - Commons MetaData
Date Mon, 24 Oct 2005 15:18:43 GMT
Of course, we could just extend Commons Attributes!  Didn't know that
already existed, duh!  


-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Monday, October 24, 2005 11:07 AM
To: 'Jakarta Commons Developers List'
Subject: New Component Idea - Commons MetaData

All,

JDK5 annotations allow us to supply metadata about classes, methods, fields,
packages, etc.  But, the metadata has to be included in the source code!
Maybe we can come up with a standardized way to register metadata about a
class into some repository.  A discussion at TheServerSide.com
(http://www.theserverside.com/news/thread.tss?thread_id=37249) gave me the
idea that this could be standardized.  The repository API could look
something like:

public interface MetaDataRepository
{
  public String getAttribute( Class c, AttributeName name );
  public String getAttribute( Package p, AttributeName name );
  public String getAttribute( Method m, AttributeName name );
  public String getAttribute( Field f, AttributeName name );
  public String getAttribute( Constructor c, AttributeName name );
} 

An AttributeName would basically encapsulate a namespace/name combination,
so that different frameworks can have the same name with different
namespaces.  We would also need to expose an API for modifying the MetaData
for a class, package, etc. so that users can hand-code this.  There could
also be a discovery mechanism for automatically looking up metadata based on
some conventions (similar to how we are talking about it at TSS.com), so
that users can add metadata to a class without having the source code.  We'd
also provide an adapter for JDK5 annotations (namespace = attribute class
name and name is the attribute name of the annotation type).  We may want to
make the return type Object, also, so that attributes could take on more
complex types (like enums or whatever).  Maybe we could start this project
in the sandbox to see how it shakes out?

James



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



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


Mime
View raw message