[Ns-developers] ns-3-object proposed for merge

craigdo@ee.washington.edu craigdo at ee.washington.edu
Mon Jan 28 13:32:58 PST 2008


       
> >         One remaining issue that is not implemented in the above is
> >         whether we
> >         rename QueryInterface and AddInterface to something
> >         else.  What about
> >         QueryObject and AggregateObject?
> > 
> > I think QueryInterface and AddInterface can remain as they are.  It
> > really is just a matter of how you define "interface" :)  Unless you
> > are determined to define interface as "pure" java-style interfaces,
> > then all is ok from my point of view.
> 
> The thing is that for most people, an interface is really a very
> java-like interface, which is really nothing like what we have.
> 
> I would thus tend to support tom's proposal.

I've always thought the name QueryInterface was silly.  If you take the name
at face value it means question-interface.  Okay, maybe the original
Microsquish people shortened it from QueryForInterface to avoid typing three
characters in that long-winded QI form; but still, that means
question-for-interface.  To understand what that means you need to connect
the meaning of Query with a general database query in which you are looking
for something based on some key.  What's up with that?  What the heck do
databases have to do with trying to find Interfaces?  

Okay, now maybe I'm being silly myself, but, if we're going to wander around
and change our QI to something else, IMHO we should change it to something
meaningful to us in our system.  Since our stuff has almost nothing to do
with COM or Java or C# or balls on springs, maybe getting away from the
Query part is a good idea for several reasons.

Our aggregate mechanism is going to take an Object with an associated TypeId
(implicitly specified by a class name) and add it to a collection of other
Objects that must all have different TypeIds (different class names).  The
other (discovery) method is going to ask the collection of Objects to search
for an Object with a provided TypeId (of a particular class name) and return
a pointer to *the* (at most one) Object in the collection of that class.

So, abstractly, we're adding an object of type "class-name" to a special
collection called an aggregation, and asking to locate and return an object
of type "class-name" in that aggregation.

Something along the lines of,

  AggregateClassObject and FindClassObject  or
  AggregateTypeObject  and LocateTypeObject

seem to me to convey what's happening better.

That said, I have no real strong feelings about the names and won't complain
about QueryObject and AddObject ... much (except when I continue to say
QueryInterface instead of QueryObject all the time and confuse everyone I
talk to :-/ ).

-- Craig




More information about the Ns-developers mailing list