UML Designer User's Guide

Class design

A class design is a model element that represents a class. A class design can be (but does not have to be) connected to a real Smalltalk class. The class design, rather than a real Smalltalk class, can then be connected to other model elements. In a class diagram, each class figure is attached to a class design rather than to an actual class.

Class designs provide an indirect coupling between your model and the actual Smalltalk implementation. During design, you might not yet be ready to start creating actual Smalltalk classes; instead, you can create class designs (which are comparatively lightweight) without any underlying Smalltalk classes. (However, you must create a real Smalltalk class if you want to create inheritance relationships between class designs.)

Furthermore, you might not yet know what your actual classes will be named, or you might want to use names other than the ones your actual classes will have (this might be the case if you are documenting legacy classes). A class design can have a different name from that of the Smalltalk class it is associated with; even if the names are different, a class design will still reflect any changes made to the underlying class.

Class designs also serve as a repository for class-related design information that is not normally captured in a Smalltalk code. For example, a class design can have a conformance link to one or more protocols, indicating that the attached class should implement all of the methods defined by the protocols. By conforming to protocols, class designs also specify information such as parameter and return types, which otherwise are not specified by a Smalltalk class definition. (On the other hand, class designs do not duplicate any information stored in the class itself, such as its methods or instance variables.)

In effect, class designs provide a bridge between analysis elements (like protocols) and implementation classes. They provide traceability links from implementation classes back to the model elements from which they are derived.

A class design combines the interface of its Smalltalk class with those of any protocols to which it conforms. Its methods, therefore, fall into two categories:

Similarly, the attributes of a class design can be either specified or implemented (or both).

A class design can be retrieved from an existing class. See Transforms and code generation for more information.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]