I had a look at the src/java/org/apache/avalon/meta/info/builder/tags/DependencyTag.java file and found the following code:
/** * Set the value of the composition method. */ private void
setMethods() { m_methods = getLifecycleMethods( "compose", COMPONENT_MANAGER_CLASS ); if ( m_methods.length == 0 ) { m_methods =
getLifecycleMethods( "service", SERVICE_MANAGER_CLASS ); } }
It seems that only @avalon.dependency tags under either the compose() method or the service() method would be processed. Here are my concerns:
1. If an abstract class is used to handle lifecycle methods for components, the subclass does not necessary has these two methods, and thus it would be impossible to declare component dependencies. (of course empty service() or compose() methods may be declared, but that's like cutting toes to fit the shoes).
I like the expression! But I don't agree with the sentiment. If I have an abstract class the dependency declarations at the level are relative to the abstract class. Dependencies declared in a derived class are relative to the derived class and will accessed (normally) via an overriding service method in the derived class.
/**
* @avalon.dependency type="Widget" key="widget"
*/
public void service( ServiceManager mgr ) throws ServiceException
{
super.service( mgr );
Widget widget = mgr.lookup( "widget" );
}2. Wouldn't it be better to have the option of putting the dependency declaration under class level javadoc, so that all major avalon related tags are collected together?
Technically - its probably possible, however - there is a problem if you want to take advantage of tags to generate enhanced javadoc information. In this case you really want the declaration associated with the subject it is qualifying (class, constructor, method, etc.).
This also ties in tag scope verification with javadoc generation.
3. If it is a must-have requirement to have @avalon.dependency under these methods only, wouldn't it be nice to document it somewhere? (Or maybe I have missed it?)
Have you see this page:
http://avalon.apache.org/meta/tools/tags/index.html
I have been pulling my hair for a few days because maven avalon:meta
wouldn't generate the xinfo files correctly due to this setup. I am
sure others like me would face the same problem. We will really appreciate if this problem can be solved. :) Thanks.
My immediate impression is that some enhancements related to tag verification would address the main issue. For example - during tag assessment a invalid tag should generate a useful error message stating that the tag is declared outside of a recognized scope.
Stephen.
Mandr
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
