"Geir Magnusson Jr." wrote:

> Jason van Zyl wrote:
> >
> > "Geir Magnusson Jr." wrote:
> > >
> > > > I confess I do not sympathize with the number suffixes - more editing work
> > > > changing the order of a group of properties (ok... some keystrokes more!).
> > >
> > > Ok.  The main advantage is that we don't prevent anyone from using a
> > > Properties, Hashtable, Hashmap, Treemap, etc... to hold this stuff.  It
> > > keeps them unique, and in a easy pattern to parse.
> >
> > We don't prevent anyone from using anything to configure their
> > apps. You can use whatever you want, you just have to adjust it
> > to use Runtime.setProperty(). If you want to use a HashMap, or
> > Properties that's fine. Do your own processing and use Runtime.setProperty().
>
> Yes.  I like the setProperty().  Agreed!
>
> Now, how do I store the two properties
>
> resource.loader = file
> resource.loader = classpath
>
> in a Hashtable, Hashmap or Properties?

You can store them however you like, if your app has it's own
configuration then that's up to you. As long as you use the setProperty()
method. Your configuration file could look like anything. It's up
to the app to do the processing. What is in Turbine I think is
fairly typical, you have your application configuration and
it does the processing of its config and uses the runtime to
set the properties accordingly.

I see what you're driving, the applications configuration is
the applications problem. It is possible to store the properties
in whatever format you want. I see what you are looking for
though.

If adding the number suffix doesn't cause any problem i.e. I don't think

resource.loader.1 = file
resource.loader.2 = classpath

or

resource.loader = file
resource.loader = classpath

Will make any difference when using

Configuration.subset("resource.loader")

But I don't ever want to get into the situation where you have to tack
on little bits of free text like ".1" to say dynamically add a resource
loader (one day when we might) or add a template path.

I think the addition of the ".1" in a properties file say on

resource.loader.1 = file

Won't cause a problem internally because Configuration.subset("resource.loader")

will return [file, classpath]

for both

resource.loader = file
resource.loader = classpath

or

resource.loader.1 = file
resource.loader.2 = classpath

So I think if you really wanted to load a properties file, alter it,
then Velocity.init(Properties) then I think the Configuration class
will deal with it fine internally. So you can use a Properties class if you want,
and
I don't have to add any free text bits like ".1" to the end of a property.
I think both ways will work which is fine with me.

And your Velocity.init(Properties) could take of processing the properties
any way you see fit. What we provide for configuration is

setProperty()
addProperty()
init()

And the app can use those anyway it sees fit. So if you want to use a Properties
file then you have to do the processing to make it work, though like I said I think

the Configuration class will deal with it so I think we're in the clear. You're
satsified if you can use the number suffixes to make things unique to
classes like Properties, and I'm happy because I don't have to use free text
bits to set properties like the template path dynamically.


>
>
> geir
>
>
> > >
> > >
> > > Given the good idea of eliminating the 'integer in the middle' that
> > > keeps the loader properties distinct, having them at the end when you
> > > mean 'multiple-valued property' is a nice and easy way to do it.
> >
> > How do you propose we add multiple resource paths using the
> > Runtime.setProperty() or Runtime.addProperty()?
> >
> > >
> > >
> > > geir
> > >
> > > --
> > > Geir Magnusson Jr.                               [EMAIL PROTECTED]
> > > Developing for the web?  See http://jakarta.apache.org/velocity/
> >
> > --
> > jvz.
> >
> > Jason van Zyl
> > [EMAIL PROTECTED]
> >
> > http://jakarta.apache.org/velocity
> > http://jakarta.apache.org/turbine
>
> --
> Geir Magnusson Jr.                               [EMAIL PROTECTED]
> Developing for the web?  See http://jakarta.apache.org/velocity/

--
jvz.

Jason van Zyl
[EMAIL PROTECTED]

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine



Reply via email to