On Fri, Jan 20, 2012 at 1:36 PM, Newlyn Erratt <[email protected]> wrote:

> All,
>
> I have a question that I would like to pose.  The situation that I have is
> as follows:
>
> I have four different interfaces that are logically related.  I would like
> to keep them as separate interfaces so that replacement modules could be
> easily written and swapped in but would also like to reduce the overall
> number of files in my project.
>

Conflicting goals given how nesc works.   Sorry to be the bearer of bad
news.

If you want modularity via replacement modules with smallest granularity
then you must put each interface into a different file.

If you include say an interface file that defines all four interfaces then
this must be implemented by a single module.

Which means if you want interface replacement granularity you will have to
put each interface in its own file.


>
> The current situation is as follows:
> Each of the four interfaces has its own module and configuration file.
>
> I see two possible solutions:
>
> First:
> All four interfaces are implemented in one module.
> One configuration wires everything for the module.
>

Given  that the interfaces are logically related.   This is what I would
do.   It is also the simplest and also keeps related code together so it is
easier to find.



> Second:
> All four interfaces are implemented in one module.
> Four configuration files, each wiring one interface to the module.
>

Does this really buy you anything?



>
>
> The question, then, is: is there any standard or best practice for how
> this should be done?  Should configurations match modules or interfaces? Is
> my initial version the best?
>
>
> I would greatly appreciate any opinions or advice!
>
> Thanks,
> Newlyn
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to