You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Jon Stevens <jo...@latchkey.com> on 2000/12/17 22:05:16 UTC

runtime design issues

Ok,

I'm mucking with Runtime again cause I'm re-doing the way that Turbine
initializes Velocity because it is seriously broken right now. :-)

The main issue is that we need to do some double initialization. In other
words, first, I want to initialize Velocity with its defaults and then I
want to override some of those defaults with other values (such as the log
file path and templates path as well as whatever is in a user specified
velocity.properties file).

The problem is that there are several catch 22's and duplications of effort.
For instance, if I call Runtime.init(propertiesFile), then the log file will
get first created in the default location and then I will be replacing that
to be the location that Turbine wants. Not good because it creates all sorts
of potential synchronized issues as well as a duplication of executed code
(first the templates are initialized to the defaults and then replaced with
what Turbine specifies).

So, can you guys think of a better way to deal with this? Please don't touch
Runtime as I have something pretty much working now and I will commit it
soon and I don't want to deal with conflicts. But, I think this whole
problem needs to be dealt with better.

thanks,

-jon

-- 
Honk if you love peace and quiet.


Re: runtime design issues

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Are you sure?  I made those changes, adding init( Properties ) and
reworking init( filename  ).  

The way I intended it (and the way I am reading the code) :

1) The default properties are loaded from the velocity.jar.

Depending on which method you use, either :
2a) the override properties from the Properties are overlaid on the
default set, replacing the default values
2b) the override properties from the file 'filename' are overlaid on the
default set, replacing default values 

3) Init() is finally called, which does the actual work of Logger,
Loader, ParserPool ,etc

More inline.

Jon Stevens wrote:
> 
> Ok,
> 
> I'm mucking with Runtime again cause I'm re-doing the way that Turbine
> initializes Velocity because it is seriously broken right now. :-)
> 
> The main issue is that we need to do some double initialization. In other
> words, first, I want to initialize Velocity with its defaults and then I
> want to override some of those defaults with other values (such as the log
> file path and templates path as well as whatever is in a user specified
> velocity.properties file).
>
> The problem is that there are several catch 22's and duplications of effort.
> For instance, if I call Runtime.init(propertiesFile), then the log file will
> get first created in the default location and then I will be replacing that
> to be the location that Turbine wants. Not good because it creates all sorts
> of potential synchronized issues as well as a duplication of executed code
> (first the templates are initialized to the defaults and then replaced with
> what Turbine specifies).

I don't understand.  Can you wait to bring up Velocity until you know
what turbine wants, and have a complete set of properties?  Or do you
need a running Velocity to bring up turbine?

> 
> So, can you guys think of a better way to deal with this? Please don't touch
> Runtime as I have something pretty much working now and I will commit it
> soon and I don't want to deal with conflicts. But, I think this whole
> problem needs to be dealt with better.
> 
> thanks,
> 
> -jon
> 
> --
> Honk if you love peace and quiet.
-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity