[Ns-bugs] [Bug 162] Calling Object::AggregateObject twice with the same Object type silently succeeds

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Thu Apr 10 07:42:31 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=162





------- Comment #11 from tomh at tomh.org  2008-04-10 10:42 -------

> 
> Because that would make these semantics hard to document in a consistent way
> across multiple helpers. It is important to make the helper API easy to use
> _but_ that does not mean make it highly optimized to a specific use-case. It
> just means that it should not be too painful to use it and that a wide range of
> use-cases are covered and that the overall structure is consistent.

We already have inconsistent API semantics here, even with your suggestion:

CsmaHelper::Install ();  // can be called repeatedly on the same container
InternetStackHelper::Install ();  // can not be called repeatedly on the same
container
> 
> What you suggest is not adding functionality because you can already use the
> API to do what you want if you re-arange your code but it is adding extra
> complex logic in the Helper API. Ideally, that code would contain zero complex
> logic and be a trivial pass-thru because you want to make it easy to replace it
> with adhoc code when it does not do what you need.

what is complex about checking whether the node already has a stack?  The point
of the helper API is to offload these details from the user.

> 
> This is really another instance of the Socket debate we had recently: you
> (users) just have to learn how the system is expected to work to use it
> efficiently and painlessly. It is not ok to add random extra hacks everywhere
> to attempt to save the user from having to learn how the system works because
> that is exactly the kind of process which lead to the current ns2 tcl code and
> you don't want to end up there.
>

I think that this frames the question the wrong way.  The question is not how
users learn how the system works, but how do we want the system to work in the
first place?  Remember, we are talking about helper API here.

If you really want consistent API, then you should not use Install() for
InternetStackHelper, because it does not have the same semantics as any of the
device Install()s.  Then, you can pick another name for
InternetStackHelper::Install() (or DeviceHelper::Install()).  Once you have
another name, you can define whatever semantics are most helpful for its usage.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list