Hi Devs,
Looking at XmlConfigurationBuilder#defineProperty(), IMHO the property handling can be improved as follows,
With the possible combinations of @name, @value, @src, and @value [or having inline xml only with @name], the property holding map (globleProp) holds different objects. Thus, if someone uses this in a mediator or any specific requirement, one has to see the type (cast according) of the object. This, is IMHO is quite cumbersome. There also exist another class DynamicPropety, which just hold the info of the registry. IMHO, the above can be merged into one, called PropetyHolder ( good name ??),which holds the state depending on the @s combination.
Thus,
public class PropertyHolder {
// Variables to hold @s and type ex: 0 for inline, 1 for @name and @value etc.
private OMElement xmlObject ; // This holds either the inline xml or the xml from (@name && @src)
// variables related to registry.
// setter and getter for varible
public Object getProperty(){ //method gives the right object
}
}
Thus, when a PropetyHolder is set to the SynapseConfiguration with the key as @name, mediator author could get hold to it and get the object depending on the @s combination.
Thus, this way the user does not need to know, if the property is dynamic or static.
Please do provide your consensus on prior.
Thank you
Saminda
- Improvements to property handling Saminda Abeyruwan
- Re: Improvements to property handling Ruwan Linton
- Re: Improvements to property handling Saminda Abeyruwan
- Re: Improvements to property handling Ruwan Linton
