You could implement your own SymbolProvider [1] that reads a properties file with all your runtime-stuff. You can implement a reloadable mechanism so that the values can be altered at runtime (or not).

In your Module you contribute this provider to the SymbolSource service. You can even decide at what position (there's a hirarchie of SymbolProviders) you want your provider at.

To retrieve configs in your services and pages you just inject SymbolSource and voila global access to all config info should be in place.

Total time to implement a first draft for a rather unexperienced programmer (like me) 10 minutes.

Regards,
Michael

[1] http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/services/SymbolProvider.html


Patrick Moore schrieb:
Hi there --

I am looking to move from T4 to T5.

In T4/hivemind  configuration configuration was in xml files. This was great
because:

   1. is easily modifiable by non-Java programmers.
   2. By only allowing non-java types to change xml files, there was limited
   ways that damage could be done.
   3. Config changes did not require a rebuild/retest/redeploy cycle.
   4. non-programmer types could alter how modules were hooked together.

Moving to T5,

   1. some inner plumbing modules do make better sense to be hidden away
   from non-programmer type's fingers.
   2. For other modules, we want to allow things like directory paths and
   other text configuration to be exposed.  (properties file??)
   3. Other modules we do want to continue to leave "exposed" ala T4

Obviously, we do not want to be "fighting" T5 conventions. So what are
people's suggestions?

Is there a way to hook hivemind into T5?

Is there a standard way to read properties files and match property names to
java bean getter/setters?

Something I missed?

Patrick Moore
Amplafi
http://amplafi.com
650-207-9792
"Put your front window on your website"
corp blog : http://amplafi.com/blog
personal blog : http://www.sworddance.com/blog



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to