Object composition implementation styles

  In the first part, we looked at conceptual implications of the various styles of object implications. Now we shall look at a few common implementations of object composition in conjunction with the concepts presented in the earlier post. Association v/s composition First off, we shall start with an example in C to understand the difference struct node { int data; node *next; };struct node { int data; node *next;.. Read More

Implications of object composition styles

Object composition is a concept older than object oriented programming itself. Let us start off with a well understood example of how to represent a rectangle on a Cartesian plane: struct point { int x; int y; } ; struct rectangle { point tl; /* top left corner */ point br; /* bottom right corner */ }struct point { int x; int y; } ; struct rectangle { point tl;.. Read More