Project

General

Profile

Smart props - DONE » History » Version 4

Henning Blohm, 17.07.2016 10:57

1 1 Henning Blohm
h1. Smart Props
2
3
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.
4
5
h2. Design Draft
6
7
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.
8
9 4 Henning Blohm
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/
10
11
Built-in implicit contexts include system properties, environment variables, other component properties, the component name, the module name.
12
13
Example: A repository declaration could look like this:
14
15
<pre>
16
com.zfabrik.component.type=com.zfabrik.svncr
17
18
svncr.url=${system['svn.repoBaseUrl']}${system.branch}/base
19
svncr.user=${system['svn.user']}
20
svncr.passwordr=${system['svn.password']}
21
</pre>
22
23
24
25
26
h2. Possible extensions
27
28 2 Henning Blohm
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*.
29 1 Henning Blohm
30
For example:
31
32
<pre>
33
#!com.zfabrik.components/velocityConfig
34
#
35 3 Henning Blohm
com.zfabrik.component.type=com.zfabrik.java
36 1 Henning Blohm
37
#parse('mymodule/spring_template')
38
39
java.privateReferences=,\
40
  ${java_private_references},\
41
  someotherref
42
</pre>