velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Bauman" <n...@cortexity.com>
Subject Re: Can I write a macro that can call itself?
Date Sat, 14 Jul 2001 14:07:18 GMT
I kind of see Jon's point: if you have something to contribute, we'd like 
to have it, so do the contribution in code (and send out a `diff -uNr`). 
This is similar to the IETF approach ("A whitepaper and a running 
implementation, not just a whitepaper") and they get a lot done as a 
result. What you are arguing about is so minimal (the name of the dir being 
searched instead of CWD) that the miles of text you've written to complain 
about it you could have made the change to the source, which you have under 
your nose, approximately 76.8 times over.

AFA compile-time checking versus properties files I think is a matter of 
taste in this case. Velocity comes with the defaults defined in a 
properties file in the CLASSPATH, as opposed to being defined in an 
interface as static finals. Big whup. I've used both in my code (although I 
tend to choose to do what you suggest) and I see no appreciable difference 
in the value of both approaches.

If what you suggest is to go one step further and refactor up the class 
heirarchy into an abstract class major portions of the code, this is not to 
be undertaken lightly, not to mention that I personally think it's not 
necessary right now. But if you think it's needed, DO IT and show us what 
you've done. A project as big as Velocity, with a half-dozen major other 
projects depending on it will take a year to complete such a major 
refactoring.

So, to recap: Go for it! Contribute! EMails are fine, but they affect only 
the hearts of the list members, not the running implementation.

>>  > Why shouldn't exceptions report the problem exactly? It costs
>>  > nothing
>>>  to be explicit: e.g. "Couldn't find filename.xt in any of [ dir1,
>>>  dir2, dir3 ]". As it now stands, its like a C compiler complaining
>>>  "undefined variable" with no variable name or line number to go by.
>>
>>I'm pretty sure that the log file reports which directories where
>>loaded by the file resource loader. If the file isn't found in that
>>directory then it is pretty clear where the problem is.
>>
>>>  The filename was was obvious by inspection. What wasn't was the path
>>>  being searched.
>>
>>Eh?
>>
>>Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader :
>>initialization starting.
>>Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader : adding path
>>'/Users/jon/checkout/scarab/target/webapps/scarab/WEB-
INF/src/torque/templat
>>es'
> 
> I found the log file I was referring to. You must be using a different
> version.
> 
> Mon Jul 09 12:46:53 EDT 2001 AvalonLogSystem initialized using 
> logfile /jwaa/velocity.log
> Mon Jul 09 12:46:53 EDT 2001   [info]   [info] Default Properties 
> File: org/apache/velocity/runtime/defaults/velocity.properties
> Mon Jul 09 12:46:53 EDT 2001   [info] Resource Loader Instantiated: 
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : 
> initialization starting.
> Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : adding path
> '.' Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : 
> initialization complete.
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
> org.apache.velocity.runtime.directive.Literal
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
> org.apache.velocity.runtime.directive.Macro
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
> org.apache.velocity.runtime.directive.Parse
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
> org.apache.velocity.runtime.directive.Include
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
> org.apache.velocity.runtime.directive.Foreach
> Mon Jul 09 12:46:53 EDT 2001   [info] Created: 20 parsers.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization
> starting. Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : adding
> VMs from  VM library template : VM_global_library.vm
> Mon Jul 09 12:46:53 EDT 2001  [error] ResourceManager : unable to  find
> resource 'VM_global_library.vm' in any resource loader.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : error using  VM 
> library template VM_global_library.vm : 
> org.apache.velocity.exception.ResourceNotFoundException: Unable to 
> find resource 'VM_global_library.vm'
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInline =  true
> : VMs can be defined inline in templates
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : 
> allowInlineToOverride = false : VMs defined inline may NOT replace 
> previous VM definitions
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInlineLocal  =
> false : VMs defined inline will be  global in scope if allowed.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : messages on  : VM 
> system will output logging messages
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization
> complete. Mon Jul 09 12:46:53 EDT 2001   [info] Velocity successfully
> started.
> 
> I still assert that "Couldn't find Template.tmp in [ pathname1, 
> pathname2 ] would have
> been far more useful than ".". And what the heck is 
> VM_global_library.vm, and why can't
> it be found? It was wondering about that one that made me try adding 
> "class" to the loader list.
> 
>>"using Jakarta"????????????????????????
> 
> I meant Velocity.
> 
>>  >, users have to download, understand, and install
>>>  apache, a connector (JServ, mod_jk, etc), and tomcat, each with its
>>>  own configuration file peculariaties, each of which is tested only
>>>  for syntactic validity, with any semantic invalidity exposed so that
>>>  NullPointerExceptions turn up at runtime.
>>
>>The problem is that it is very difficult to guess every single
>>different configuration and use of our software as well as catch that
>>usage perfectly. We try our best, but sometimes it isn't always easy.
>>
>>Needless to say, I'm not really sure what the point of what you are
>>trying to say is. Are you saying that we should make things easier for
>>our users? Are you saying that we intentionally make things difficult?
>>If so, then let me point you at this document:
> 
> Jon, try taking what I've been saying at face value instead of trying 
> to make everything a confrontation. I've made a number of very 
> concrete technical proposals: Abstract classes over properties files, 
> static over dynamic binding, the need for both semantic and syntactic 
> checks on all external data (especially properties files), avoiding 
> Strings/nulls in favor of application-specific Field types and many 
> others. I've absolutely no interest in playing games or picking 
> fights.
> 
>>     <http://jakarta.apache.org/site/understandingopensource.html>
> 
> Yeah. Pitch in and help a group that slaps down other ideas this
> readily?
> 
>>All the information you needed was in the log file. See above.
> 
> Yeah. Everything in that ".". Mea culpa.
> 
>>  > Condescending lecture deleted. I've uploaded everything I have to
>>  > say
>>>  to http://virtualschool.edu/jwaa. You won't be hearing from me
>>>  again. In closing, I'll only add my disappointment in how closed
>>>  this community is to constructive feedback, consideration of
>>>  alternative technical approaches (static vs dynamic binding), and
>>>  even offers to help (previous paragraph).
>>
>>Your response was not constructive feedback. It was a silly rant.
> 
> Sure Jon. Over and out.
> -- 
> For industrial age goods there were checks and credit cards.
> For everything else there is mybank.dom at
> http://virtualschool.edu/mybank Brad Cox, PhD; bcox@virtualschool.edu
> 703 361 4751


-- 
Nick Bauman
Software Engineer
3600 Dupont
Minneapolis, MN
55412
Mobile Phone: (612) 810-7406
Home Phone: (612) 522-0165


Mime
View raw message