Re: OOP Terminology - another word for "user"
- From: "Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 26 Nov 2006 14:28:23 GMT
rk wrote:
I'm documenting some code, and am looking for a term I can use to mean
the "user of this class".
First off, what do you mean by this ?
It's a serious question; are you talking about the objects which
interact with instances of this class, the code which specifies the
behaviour of those objects, or the person who wrote that code ? If the
former then you are presenting your design in (what I would call)
"true" OO style; if the latter then you are giving a code-centric
description. Either or both may be appropriate but they call for
different styles of expression.
I don't want to use the term "user", because it may be misinterpreted
to mean the human user of the computer.
General point: you are not going to find any term which doesn't have
an important extra meaining. (Mainly because the terminology of
programming has mainly been created by stealing, extending, or
analogising existing words and concepts). Just live with it.
Anyway being specific: if you are talking pure OO (my first option,
above) then one object may well be used by another object. Indeed
that's a frequently occurring pattern of interaction, and it would be
absurd to avoid the natural term because of fear of confusion.
The term "client" is even worse, as it could mean any of:
- the client the code is being created for
- an endpoint in a client/server system
Use "client code", frequently enough to remind people of what you are
talking about. Shorten it to "client" when the context is established.
The term "instantiator" isn't quite right, as it is implicitely
restricted to the creator of my object. I want the term to include
any code that makes a call to my object.
Correct; avoid that except in the cases you mention.
The term "implementor" is already used when talking about the
implementor of an abstract class, and I want to avoid confusion.
Implementor means the person who wrote the code, and you have little
reason to talk /about/ them directly (I'd hope). In any case you can
also use "programmer" for that. I wouldn't use "implementor" for
anything else ("object which implements Xxx" or "concrete subclass of
Xxx" would be better, depending on whether you are talking in OO).
The term "caller" isn't quite right, as it usually refers specifically
to the caller of a function, not the consumer of a class.
Agreed, but not entirely. The caller of a function (in OO) /is/ the
object which is interacting with this object. So if (in some passage
of text) there is a clear sense of which method or methods are under
discussion (there may not be), then "caller" (OO) or "calling code"
(code-centric) are prefectly acceptable.
NB: OO purists would prefer "sender" -- which unambiguously means the
calling object. Not too many people are happy with purist OO
terminology, though, so using it would probably be counter-productive
unless you have a rather puristical target audience.
"Consumer" is the best I've come up with so far, but it's not quite
perfect either.
I'd avoid that except where there is a clear producer/consumer
relationship.
It's probaly best to ring the changes: "calling code", "user code", and
"client code" (depending on context, and eliminating " code" where you
can to avoid repetition) when you are talking code-centric. "User",
"provider", "producer/consumer", "sender/caller", when you are talking
objects.
Oh, one last point. If you are talking objects, then very
anthropomorphic language is useful. "The the user[*] of the logging
package should tell the logger where to place it's output by calling
outputLocation(). The caller should pass the name of an existing
directory as parameter. Note that, by default, the logger will not
modify any existing files in that directory. If you wish to change
that behaviour then you can replace the logger's default
FileManagermentStrategy by..."
([*] note the deliberate ambiguity, or rather the deliberate refusal to
distinguish between the object which interacts with the logger and the
person who programmed its behaviour.)
-- chris
.
- References:
- Prev by Date: Re: New non-cryptograhic hash function(s)
- Next by Date: money distribution algorithms
- Previous by thread: Re: OOP Terminology - another word for "user"
- Next by thread: Re: OOP Terminology - another word for "user"
- Index(es):
Relevant Pages
|
|