This section contains 568 words (approx. 2 pages at 300 words per page) |
Class responsibilities are what a class is charged with doing. They represent an implicit contract with the other objects in the system that covers what it will do and when it will do it.
There is typically no one-to-one mapping between a class's responsibilities and a class's methods. This is because the responsibilities are decided at a stage generally earlier in the design process and at a higher level of abstraction than the stage at which a class's operations are distilled into a class's methods.
The difference between an operation and a method is that operations describe processes performed by the class whereas a method performs some specific coded function. An operation is something invoked on an object, and a method is the code that gets executed. Because some object-orientated programming languages support polymorphism, there may not be a one-to-one correspondence between operations and methods. The...
This section contains 568 words (approx. 2 pages at 300 words per page) |