M
Mark Sicignano
I don't know where I first heard this, or if it's even correct, but I had
understood an "operation" to be something that you do to an object, and the
"method" is the particular implementation that gets called when the object
is asked to perform the operation.
For example, you might define Shape as having a Draw() "operation" (defined
as pure virtual), and objects such as Square, Circle and Rectangle would
provide their own "methods" to implement the Draw() operation.
Of course in C++, you declare and/or define operations and methods by
writing "member functions".
To earlier posters, I don't see anything pretentious about using the word
method. Makes perfect sense to me to use it in the context that I provided
above. The implementation of the Draw() operation for the Square uses a
different method to getting the job done than that of the Circle. Square and
Rectangle use very similar methods to implement the Draw operation.
-mark
understood an "operation" to be something that you do to an object, and the
"method" is the particular implementation that gets called when the object
is asked to perform the operation.
For example, you might define Shape as having a Draw() "operation" (defined
as pure virtual), and objects such as Square, Circle and Rectangle would
provide their own "methods" to implement the Draw() operation.
Of course in C++, you declare and/or define operations and methods by
writing "member functions".
To earlier posters, I don't see anything pretentious about using the word
method. Makes perfect sense to me to use it in the context that I provided
above. The implementation of the Draw() operation for the Square uses a
different method to getting the job done than that of the Circle. Square and
Rectangle use very similar methods to implement the Draw operation.
-mark