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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to