CSE2305/CSC2050 - Object-Oriented Software Engineering
Week 9

 

Topic 17: The Booch Notation


Synopsis


Booch's Notation


Representing classes¤


        [Diagram showing a cloud with a dashed outline, labelled with
         the underlined word "Vehicle" and with a list of attributes
         and operations beneath it]

class Vehicle { public: Vehicle(void); virtual bool Register(string regnum); string GetRego(void);

private: string myRegNum; };


Representing inheritance


        [Previous diagram with an extra "class cloud" labelled
         "Car", and with additional attributes and operations]

class Vehicle { public: Vehicle(void); virtual bool Register(string regnum); string GetRego(void);

private: string myRegNum; };

class Car : public Vehicle { public: Car(string make, string model); virtual bool Register(string regnum); string GetDescription(void);

private: string myMake; string myModel; };


Representing aggregation¤

class StudRec { public: StudRec(int ID, string name, double mark);

int GetID(void); string GetName(void); double GetMark(void);

private: int myID; string myName; double myMark; };


        [Diagram showing four class clouds, labelled "StudRec", "int", "double",
         and "string", with a line from the StudRec cloud to each of the other
         clouds. Each line has a black disc at the StudRec end.]

class StudRec { public: StudRec(int ID, string name, double mark);

int GetID(void); string GetName(void); double GetMark(void);

private: int myID; string myName; double myMark; };


        [Diagram showing four class clouds, labelled "StudRec", "int", "double",
         and "string", with a line from the StudRec cloud to each of the other
         clouds. Each line has a black disc at the StudRec end and a solid box at the
         other end.]

class StudRec { public: StudRec(int ID, string name, double mark);

int GetID(void); string GetName(void); double GetMark(void);

private: int* myIDPtr; string* myNamePtr; double* myMarkPtr; };


        [Diagram showing four class clouds, labelled "StudRec", "int", "double",
         and "string", with a line from the StudRec cloud to each of the other
         clouds. Each line has a black disc at the StudRec end and a hollow box at the
         other end.]


Representing client/server use


        [Diagram showing three class clouds, labelled "StudRec", "istream"
         and "ostream", with a line from the StudRec cloud to each of the other
         clouds. Each line has a circle at the StudRec end.]

class StudRec { public: StudRec(int ID, string name, double mark);

int GetID(void); string GetName(void); double GetMark(void);

void PrintMe(ostream& os); void ReadMe(istream& is);

private: int myID; string myName; double myMark; };

class BSTree { private: class Node { public: int myValue; Node* myLeft; Node* myRight;

Node(void); }

public: // ETC... };


        [Diagram showing two class clouds, labelled "BSTree", 
         and "Node", with the Node cloud inside the BSTree cloud.]


        [Previous diagram with a loop added from the Node class
         to itself. The loop has a black disc at one end and
         a hollow box at the other.]


Representing other class¤-like entities


        [Diagram showing a "class cloud" with a dashed box obscuring
         the top right-hand corner]

template <class TYPE> class ListOf { public: bool First(void); bool Next(void); TYPE GetCurrent(void); bool InsertCurrent(const TYPE& newelem); bool DeleteCurrent(void);

private: TYPE* myArray; int mySize; int myNextFree; };


        [Diagram showing a "class cloud" with a solid box obscuring
         the top right-hand corner]

template <> class ListOf<bool> { public: bool First(void); bool Next(void); TYPE GetCurrent(void); bool InsertCurrent(const TYPE& newelem); bool DeleteCurrent(void);

private: long* myPackedArray; };


        [Diagram showing a "class cloud" labelled math.h with a shadow
         below and to its right. In the cloud are a number of attributes
         (e.g. M_PI) and operations (e.g. sin())]


Putting it all together


        [Diagram showing a simple design illustrating most of the
         features described above.]


Representing objects


         [Diagram showing a cloud shape with a solid outline,
          labelled with the name of the object and its attributes.


Representing object interactions: the Object Diagram


         [Diagram showing numerous cloud shape with solid outlines,
          with arrows representing calls of members.]


Representing object interactions: the Interaction Diagram


         [Diagram showing a series of vertical dashed lines, each
          labelled with an object name. Arrows between the lines
          indicate member function calls, as time increased down
          the diagram.]


         [Previous diagram with swollen object lines whilst active.]


Other Booch notations


Reading

Booch, G., "Object-oriented Analysis and Design with Applications", Second Edition, Benjamin Cummings, 1994 (in particular: Chapter 5).

 


This material is part of the CSE2305/CSC2050 - Object-Oriented Software Engineering course.
Copyright © Damian Conway, 1998. All rights reserved.

Last updated: Tue Jul 6 11:33:55 1999