Sunday 19 April 2009

Functions, Methods and Operations

In C programming we had functions. In C++ we have functions, methods and operations. Here is what I understand the differences between them are:
  • Functions: These are the same old functions used in C programming case
  • Methods: OOPS concept used to refer a function inside a class. So if your C++ code has two functions where one of the function is part of a class and the other is directly within the code without being part of a class then the first one is a method and the other one a function.
  • Operations: I found operations being used generally in UML based books which may be talking about C++ or Java. As far as I understand, operations are abstract methods. When methods are declared (no implementation) then they are referred to as operations. This is the case when its UML representation like a class diagram or C++ code. When the implementation of that method is done (in C++ code) it i referred to as a method.

No comments:

Post a Comment