Objects communicate with messages. Each message corresponds to a method call withinthe Object. This basicbehavior allows objects to have behavior based on methods. Eachobject has it own set of data which the methods can access.

“Kissa” is a Class with inheritance with super-class and sub-class forming abstractions.

Classes define the parts of an object.They form a template defining all the methods anddata available for that object. A class may have a hierarchy of inheritance. The super-class may be inherited from a sub-class. In this way one can create abstract objects torepresent the real world. An abstract vehicle class becomes a super class for both theauto and airplane classes. An auto or airplane IS A vehicle–

the IS A relationship.

“Pie” is polymorphism implemented in objects by instantiation and encapsulation.

Polymorphism literally means many forms. Through inheritance we see classes takingmany forms. There are many other ways to express many forms with objects. One objectmay contain another object. Objects also may be composed as needed to form complexsystems. Polymorphism means

that the same messages perform differently. The instanceof a single object is when one uses a class to create a new object. Objects can thenpopulate the application, each with its own context. Each object hides its data from therest of the world. This manner of data hiding is called encapsulation. It guarantees thatonly the class owner or programmer makes the changes necessary to change its ownmethods.

Putting an object at a memory location:http://gethelp.devx.com/techtips/cpp_pro/10min/10min0999.asp

Test framework:

http://www.ddj.com/dept/cpp/184401279

Visual C++ console code

Create with a win32 console project and choose the empty option when creating files.Use the “#include<conio.h>” with a “getch();” at the end of the program to keep the fileoutput on the screen for printing.

Visual C++ debug statements

This code seems to work for placing debug comments as needed:

#define COMMENT SLASH(/)

#define SLASH(s) /##s

…

#ifdef _DEBUG

#include <iostream>

#define dout std::cout

#else

#define dout COMMENT

#endif

dout << “something to say here” << endl;

// no doubt

Patterns to discuss: Dispatch of functions

Strategy (Concrete, Abstract)

O sort comparitors

Dispatching functions verses objects

#include <stdio.h>

void func1() {printf("func1\n");}

void func2() {printf("func2\n");}

typedef void (*fp)(void);

fp funcs[] = {&func1, &func2, 0};

int main() {

int i = 0;

while (funcs[i])

funcs[i++]();

return 0;

}

}

In object land create an interface, implement to the interface, execute off a collection ofinterfaced object method calls.