Re: BlockInfoReader.java patch

Peter Donald <peter-4lf8KW9E9MLMqX/[email protected]>
Newsgroups gmane.comp.java.jcontainer.interest
Message-ID <[email protected]>
On Wed, 29 Oct 2003 11:07 pm, Mircea Toma wrote:
> Is there a reason why is necessary to have a dedicated task like
> org.jcontainer.dna.tools.metaclass.GenerateDNADescriptorsTask?

Essentially because it does some validation of the attribute parameters and it 
allows expansions of values in the context of the source file. For example 
you can do something like

/**
 * @dna.dependency type="ClassLoader"
 */
 
The underlying task will expand "ClassLoader" into "java.lang.ClassLoader". It 
does this via normal type resolution rules (ie by looking through import 
statements etc) and can be much easier to read and refactor (if you change 
packages of a service). So the aboves underlying representation once 
processed by the DNA task will look like

/**
 * @dna.dependency key="java.lang.ClassLoader" type="java.lang.ClassLoader" 
optional="false"
 */

While some of this expansion can be done on load of the descriptor (ie 
populating key parameter) some of it requires the context of the source file 
to work.

Does that make sense?

In the future we have talked about having a "Schema" file for attributes and 
this schema file would automatically expand attributes via default values, 
resolving types etc based on the schema. We are not there yet though ;)

-- 
Cheers,

Peter Donald
------------------------------------
The two secrets to success:
   1- Don't tell anyone everything.
------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.