Project

General

Profile

Smart props - DONE » History » Revision 5

Revision 4 (Henning Blohm, 17.07.2016 10:57) → Revision 5/14 (Henning Blohm, 17.07.2016 10:57)

h1. Smart Props 

 The goal of this concept is to provide facilities to simplify sharing of component configuration while still being able to query resolved component configuration efficiently and with minimal resource usage. 

 h2. Design Draft 

 What we aim for is an extended _properties_ format that allows declarative inclusion of other component's configuration and the use of some expression language style substitution of vaiables. In other words, we strive for the use of a template processing language. 

 The prospective candidate is the "Java Unified Expression Language":https://en.wikipedia.org/wiki/Unified_Expression_Language based on the implementation "JUEL":http://juel.sourceforge.net/ 

 Built-in implicit contexts include  

 * system properties,  
 * environment variables,  
 * other component properties (_lookup(<name>)_),  
 * properties, the component name,  
 * the module name. 

 Example: A repository declaration could look like this: 

 <pre> 
 com.zfabrik.component.type=com.zfabrik.svncr 

 svncr.url=${system['svn.repoBaseUrl']}${system.branch}/base 
 svncr.user=${system['svn.user']} 
 svncr.passwordr=${system['svn.password']} 
 </pre> 




 h2. Possible extensions 

 To extend this further, component declarations may indicate their template style via some "Shebang":http://de.wikipedia.org/wiki/Shebang, the default being *java.util.Properties*. 

 For example: 

 <pre> 
 #!com.zfabrik.components/velocityConfig 
 # 
 com.zfabrik.component.type=com.zfabrik.java 

 #parse('mymodule/spring_template') 

 java.privateReferences=,\ 
   ${java_private_references},\ 
   someotherref 
 </pre>