[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] Bug in nesC 1.2alpha10
Philip Levis
pal at cs.berkeley.edu
Sun May 22 15:10:53 PDT 2005
On May 20, 2005, at 2:07 PM, Cory Sharp wrote:
> Just for the record... A reasonable alternative is to define generic
> components of the form MyComponent(max_clients) instead of
> MyComponent(special_string). In practice, instantiation of those
> components looks like
>
> new MyComponent(uniqueCount(special_string))
>
> instead of
>
> new MyComponent(special_string)
>
> This is what the timer system does for VirtualizeTimerC and it works
> fine. I even assert this should be the standard practice since the
> max_clients form seems more general. The special_string form doesn't
> provide any additional abstraction for the use-cases I've heard so
> far.
I'm uncertain on this one.
On one hand, passing an integer is more flexible from a caller
standpoint. On the other, it is less flexible for the callee. For
example, a component can't include another unique() (e.g., for a null
or termination element) which it wants included in the uniqueCount().
My feeling is that components which expect to be accessed with unique
() keys through a parameterized interface should take a string, while
almost everything else should take an integer.
But this is the sort of thing that's easy to change, so we can figure
it out as 2.x fleshes out.
Phil
-------
"We shall not cease from exploration
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time."
- T. S. Eliot, 'Little Gidding'
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-host-mote-wg
mailing list