Here is my summary of what I agree with.  It think that we are in
agreement :)

A) The rule about our properties :

* For any property that can have multiple values (ex.
file.resource.loader.resource.path ), it is permissible to distinguish
the values with a .<integer> at the end of the property.

ex :

file.resource.loader.resource.path.1 = foo
file.resource.loader.resrouce.path.2 = bar

The reason is to allow our properties to be handled by Map-like objects
in applications, such as Hashtable, Properties, etc.

B) The o.a.v.runtime.Runtime configuration API :

/**
 *  sets the value of the property <prop> to the value <value>.
 *  Repeated call with the same <prop> simply replace the existing value
 *
 *  If a property is a multi-valued property and ends with .<integer>
 *  setProperty will 'do the right thing' ( internally call
addProperty() :)
 *
 *  proposal - if <value> == null, then reset the property to empty
 */
boolean setProperty( String prop, String value )

/**
 *  adds a value to the end of a multivalued property set
 *
 *  it is up to the caller to decide if a property is multivalued,
 *  and thus using this call is appropriate
 */
boolean addProperty( String prop, String value )

/**
 * takes the user properties as set via the above methods, if any,
 * lays them over the default prop set, and initializes the 
 * Velocity Runtime
 */
boolean init()


C)  We haven't really discussed this, but I think it is very valuable,
convenient and obvious thing to do. We can isolate the Runtime from the
configuration-flavor-of-the-week, adding and deprecating as time goes
on.

In the org.apache.velocity.app.Velocity application helper class :

/**
 *  reads the properties from the file <filename>,  sets them in the 
 *  runtime via setProperty() and calls init()
 */ 
boolean init( String filename )

/**
 *  reads the properties from the Properties object <prop>, sets them in
the
 *  runtime via setProperty() and calls init()
 */
boolean init( Properties prop)

/**
 *  reads the properties from the Configuration object <conf>, sets them
in the
 *  runtime via setProperty(), and calls init()
 */
boolean init( Configuration conf)


geir

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to