[Ns-developers] Default Values
tjkopena at cs.drexel.edu
Fri Jan 18 18:27:10 PST 2008
First, a snippet from the Seattle meeting notes:
> - Two conventions regarding default values will be adopted:
> -- Default values used to set values on an object should, in general,
> also have getters and setters to access the value through the
> object's interface.
> -- Default values may be used for initialization only, and can either
> be global, static values or global but changeable per node.
My take on this was the same as Tom's---that this was talking about
when objects are created, not necessarily restricting the use of
default values to scenario construction. The former seems reasonable
to me, that default values should only be used to initialize objects
and should not be referenced throughout its lifetime. A related point
is what I was talking about in regard to Craig's Set() function, it
should be made clear that changing the default values does not effect
already created objects. To me that just sounds too chaotic.
As I understand it, one of the issues ostensibly being addressed by
limiting default value use to the construction phase is that code may
change values without the user being aware, and cause hard to debug
misbehavior. However, it's not obvious to me that the factory
getters/setters approach resolves that. Wouldn't that code just as
easily interact with the factory as change a default value? It seems
like not using the default values adds new code (the getters/setters)
without achieving the desired restriction.
What if default values could be locked, either system wide or by
specific variables? If anything tries to change one afterward, the
sim bails and the user knows something's going on.
- joe kopena
right here and now
More information about the Ns-developers