Wednesday, April 28, 2010

More introducing than going into deep - some things you should have heard about when programming OO

call by value vs. call by reference
lazy fetching
early fail
trivial construction vs. non-trivial construction
value semantic
shallow copy vs. deep copy

Some OOP termini and their translation into C++:
1) object owns another object (has a relationship - aka wrapper)
2) object uses another object (uses a relationship)
2a) object reads another object (solved beeing const correct)
2b) object manipulates another object (non const qualified)
3) object "can" use or have another object (weak aggregation - can be solved using pointers)
4) object is a special form of another object (public inheritance)
5) object is a general form of another object (public inheritance)

declaration (usually done in header files)
definition (usually done in implementaiton files - *.cpp)
initialization (prefer initialization lists - member pointers have to be zero initialized)

static
non-static
this (why did Bjarne Stroustrup invented this to be a pointer - could'nt it be reference instead?)
const
volatile

buildin types vs. custom types

This list is more a collection of notes for myself but I had no clue where to put it elsewhere.