PDA

View Full Version : property value substitution


tmart
02-27-2010, 08:57 PM
It would be handy to allow some form of property value expansion/substitution at the AppLogic level. For example... sometimes the value of a property might need to be used in slightly different contexts. A property representing an external IP address might be used both for an "IN" firewall appliance as well as to construct absolute URLs prefixes somewhere within an application.

So - maybe we define a property named "WEB_IPADDR" of our application boundary; the property has the name "IN_ipaddr" and we give this some routable IP address as a value. We redirect the "IN" appliance's corresponding property to this value.

Now elsewhere in the app we might want to use the value of WEB_IPADDR as more than just its value. It would be handy for example to be able to construct compound property values for example by giving another component property the value "http://${WEB_IPADDR}/" or even something like "http://${WEB_IPADDR}/${URL_BASE_PATH}" and so on...

Perhaps my example isn't a beautiful one; however, I hope that you can imagine other uses.

Certainly all of these properties could be leveraged in shell scripts once the components are running; however, in complicated applications we have had to create many properties for components and something like this would help to reduce the complexity and chances for errors & typos.

-- Tim

PeterNic
02-28-2010, 01:47 PM
Tim,

Thanks - good idea. I think you are essentially referring to being able to use property values in expressions. For example, in addition to the substitution, it makes sense to do things like inversion: not(${MON_STANDBY}).

However, substitution seems a much simpler to start with.

Best regards,
- Peter

tmart
03-02-2010, 05:03 PM
Yes, general expression evaluation would be great... but I imagine that the devil is in the details. I mean, ideally, it would be fantastic if you could allow something like BASH expressions where we had built-in tests for null, etc. such as $(( MEM / 2)) or ${netmask:=255.255.255.0}. Anyhow, maybe you can find a nice compromise between simple token replacement and a full expression evaluation engine.

Thanks for considering this.

tmart
03-05-2010, 11:12 AM
another related feature request: allow property value display within the annotation boxes. For example, create a text box and have it's text be something like: "Public IP: $(IN_ipaddr) ... ports: ($IN_ports)" have have the actual values show up in the text boxes when not in edit mode. When in edit mode, the textbox contents would revert to the editable strings with the property names, etc.. Of course for this to be truly useful it would need to take into account for any redirects up to parent assemblies, etc.