[Ns-bugs] [Bug 162] Calling Object::AggregateObject twice with the same Object type silently succeeds
bugzilla-daemon at nsnam-www.ece.gatech.edu
Wed Apr 9 09:05:39 PDT 2008
------- Comment #6 from mathieu.lacage at sophia.inria.fr 2008-04-09 12:05 -------
> > > changeset 2895 f8523d79a0b7
> > > fixes the specific problem of re-aggregating Internet stack twice. (which
> > > shouldn't assert-- we should just avoid the re-aggregation)
> > I think that this is wrong. It is a programming error to attempt to attach the
> > same stack twice to a node. We need to assert. If there are helpers where we do
> > this check already, then, these helpers should be changed to not contain the
> > check.
> The alternative is that we will not be able to pass in a container holding a
> multi-interface node to the internet stack helper. See, for instance, the
> mixed-wireless script.
This just means that your script needs to be written in a slightly different
way: it needs to
> I don't think it is wrong to define the semantics of the AddInternetStack
> method to "add an IPv4 stack to the node if one has not already been added".
> Can you elaborate why you think this is a bad idea?
We already discussed that in the past in the case of the MobilityHelper::Layout
method: the issue is that if you allow what you suggest, you have to define
_exactly_ the semantics of doing this operation twice. For some helpers such as
the InternetStackHelper, it is not too hard and somewhat makes sense. For other
helpers, it is highly non-trivial (MobilityHelper) because it does interact in
very non-obvious ways with some of the features of said helper.
So, if you want to allow this feature in various helpers, then, you have to
document these sometimes non-trivial semantics on a per-helper basis which is
really a recipe for pain and disaster. It is vastly easier to document and
convey to users that each operation is allowed only once. Yes, it means that in
some cases, you will have to structure your program in a certain way and won't
be able to use some shortcuts. That "pain" is worth the overall conceptual
simplification I think.
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