[cddlm] issue on a component property value

Steve Loughran steve_loughran at hpl.hp.com
Wed Apr 19 04:30:52 CDT 2006


Jun Tatemura wrote:
> Dear team,
> 
> In the F2F discussion with OGSA team, we had a
> question on our specs. We promised that we will discuss
> in the WG.
> 
> [Q] Can a component have a parameter such that
> (1) sometimes the user want to specify a value
> but (2) sometimes the user want the component
> to specify the value dynamically (as a default value).
> 
> In fact, it is not obvious from the current component
> model or CDL.
> 
> A default value of a component property can be introduced,
> for example, as param2 in the following component
> description, Component1. If the user extends this
> template without specifying a value on param2, 100 is
> used as a default value.
> However, how can a dynamic value be default?
> 
> <Component1>
> <cmp:CommandPath .../>
> <cmp:CodeBase .../>
> <param1 cdl:lazy="true"/>
> <param2>100</param2>
> <Component1>
> 
> For a dynamic value, we use @cdl:lazy.
> When param1 is assigned by the component,
> we should specify @cdl:lazy so that any reference to
> this property is resolved at run time.
> 
> However, specifying @cdl:lazy at a property
> does not mean that the component MUST/SHOULD assign a value to
> the property. It does not mean that the user MUST NOT/SHOULD NOT
> assign a value either. In fact, CDL does not have any notion on
> a role who assigns values (such as users, systems, components,
> etc).
> 
> For CDL, it is fine if the user assign the value to a property
> with @cdl:lazy. CDL only cares when a reference to the property
> is resolved. In this sense, the question to the answer can be
> 'yes' - the user can assign the value to the above param1.
> But we do not know whether the value is used by the component
> (or just ignored).
> In CDL, we cannot say if a component allows the user to
> specify a specific property.
> 
> In fact, in the early design discussion, we were discussing
> @cdl:use="readonly" for that purpose:
> <param1 cdl:lazy="true" cdl:use="readonly" />
> For some reason (I don't remember), we have removed this from
> the spec.
> This means that (1) any reference to this property
> is resolved at run time (2) you cannot override this property
> by inheritance -- in a component model, this means that
> the value can be assigned only by the component (the user is
> not allowed to assign the value)
> 
> A possible solution would be one of the following:
> 
> [1] CDL-level solution:
> add "readonly" as a value of @cdl:use
> [2] Component-level solution:
> extend the component model specification so that
> one can specify how a property is used by a component.
> [3] Application-level solution:
> just let it unspecified (as is) and think this as a semantic
> level matter the component model does not care.
> 

I dont particularly see why it is an issue. Yes, you can declare a value 
for something that is dynamic. In that case, the static value is used 
until the runtime sets the dynamic value. Accordingly, it does not make 
much sense to declare a value for a dynamic value, because it will get 
lost by the time anything does a lazy read of the value. Anything that 
does a non-lazy resolve of the value, well, they get whatever is there.

The other thing to consider is that an implementation of a component may 
choose to implement its own policy. That is, it may have a lazy value by 
default, but if one is set then that one takes precendence. That is 
trivial to implement, at least in the smartfrog runtime. I think our 
TempFile component may do some of that; anything you leave out gets some 
random value picked out the air, while stuff you fill in gets used as 
parameters for the operation.

-steve





More information about the cddlm-wg mailing list