- Forward


Class Models
for Engineering Design


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Overview
Back SMYC Forward
  • Purpose of Class Models for Engineering Design
  • Contents of Such Models
  • The Process
Class Models for Engineering Design
Back SMYC Forward
  • Purpose:
    • Illustrate the specifications for the static structure of classes and interfaces
  • Enhineering Models vs. Conceptual Models:
    • A conceptual model represent real-world concepts
    • An engineering design model represent software components
Contents of Class Models for Engineering Design
Back SMYC Forward
  • Classes and Interfaces/Contracts
  • Attributes
  • Methods
  • Dependencies
The Process
Back SMYC Forward
  1. Identify all of the classes
  2. Identify attributes of each class
  3. Identify methods
  4. Add type/signature information
  5. Add associations ("use"), aggregations ("has a"), and specializations ("is a")
  6. Replace classes with interfaces (as appropriate)
  7. Add dependencies (where needed)
Classes in UML
Back SMYC Forward

The Basics

class_uml
Classes in UML (cont.)
Back SMYC Forward

Visibility

  • Public (+)
  • Private (-)
  • Protected (#)
  • Implemented (or Package) (~)
Relationships: Association
Back SMYC Forward
  • Definition:
    • Class A is said to be associated with class B if an object in class A can send a message to an object of class B or if an object in class A can create, receive or return objects of class B.

      association-university

      Expand
  • Set Theoretic Concepts:
    • ?
Relationships: Dependency
Back SMYC Forward
  • Definition:
    • Class A is said to depend on class B if method in an object of class A is passed an object of class B.

      dependency-student

      Expand
  • Dependency or Association?
    • A dependency is a special types of association
Relationships: Specialization
Back SMYC Forward
  • Definition:
    • An object of class A "is-an" object of class B if A is/does everything that B is/does and more.

      specialization-funds

      Expand
  • Set Theoretic Concepts:
    • Subset and superset
Relationships: Aggregation
Back SMYC Forward
  • Definition:
    • An object of class A "has-an" object of class B if B is a part of A.

      aggregation-university

      Expand
  • Set Theoretic Concepts:
    • Union?
Relationships: Composition
Back SMYC Forward
  • Definition:
    • An object of class A is composed of an object of class B if B is a part of A and A controls the life of B (e.g., if A is destroyed then B will be destroyed). Thus a component can be associated with exactly one composite (making the multiplicity implictly 1).

      composition-university

      Expand
  • Set Theoretic Concepts:
    • Union plus?
Interfaces in UML
Back SMYC Forward
  • Defined:
    • A set of operations/services
  • Implications:
    • A class that implements/realizes an interface promises that it will implement all of the methods in the interface
    • A class that implements/realizes an interface has an "is a" relationship with that interface
Interfaces in UML (cont.)
Back SMYC Forward

An Example

UML-interfaces
There's Always More to Learn
Back -