Roadmap to Detailed Design, Part 2

Documents in this section:

·        Example of class diagrams in Detailed Design Part 2

·        Example of sequence diagrams in Detailed Design Part 2

·        Brief description of class diagrams and sequence diagrams

·        Example of data dictionary

Purpose of this section:

·        Class diagrams provide the design team and the customer with a static view of all the system information and activities.  The entire application is divided into the classes that will defined and coded.  A class diagram shows where state is stored and where the control functions that act on it reside.

·        Sequence diagrams show how the methods and attributes in the classes interact over time to accomplish the use cases that define your application.

·        Data dictionaries compile all the graphical information in one place and provide a human searchable format for class information.  Data dictionaries are also useful as a cross-check for customers to see if the data dictionary (which is presumed to come from existing code augmented with headers for code-yet-to-come) is consistent with the design drawings.

How to make class and sequence diagrams:

·        Use your robustness diagram to allocate control functions as methods in your interface and entity classes. 

·        Identify in detail the state that you will have to track in each of your classes and the methods you'll use to act on the data.

·        Draw all your classes. 

·        To make a class diagram, interconnect the classes, labeling the connecting lines with the information appropriate to the type of class diagram you are drawing.  You have to draw three types for this class:  Inheritance, structure and implementation/associational diagrams.

·        After you have all your classes identified as well as you can, start drawing your sequence diagrams.  Sequence diagrams show how the methods in your classes interact with each other over time to accomplish the tasks you defined in your use cases.

·        You'll probably find that either you've missed something and have to add it to your class diagram, or there's a lot of "line crossing" on the sequence diagram, which should make you re-examine your class schema to see if you can reallocate to make the interfaces simpler.

·        Repeat until you run out of time.

Purpose of a data dictionary:

·        Have a place where ALL your high level information is captured in an easy-to-search fashion.

What is a data dictionary?

·        An alphabetized list of all your classes, with all the introductory comments, attributes and methods.  The attributes should have types and initial values associated with them, the methods should have parameter types and return type, if any.

How do I make one?

·        Take your code and strip out the actual implementation, leaving only class-level comments and the attributes and method list. 

·        Add the classes from your design that you haven't coded yet.

·        Verify that all the classes on your diagrams are in the data dictionary and that all the classes in the data dictionary are on the diagrams.

Note:  I know, I know - it's bad design to have the same information in more than one place.  In the real world, automated design tools will create the data dictionary for you from your drawings.  That said, someone has to go through and make sure that everything's there that should be there to cover the requirements.