Class Diagram Example: GoF Design Patterns - Adapter

Description:

Adapter design pattern is one of the Gang of Four (GOF) design patterns. Adapter design pattern permits classes with disparate interfaces to work together by creating a common object by which they may communicate and interact.

To edit this Adapter design pattern template, Click Use this Template, then change the content to your liking.

What is Class Diagram?

Class diagrams still represent by far the most important and widely used modeling technique of UML. A class diagram is a static model of a system which shows the structure of the software in terms of the constituent classes and how each class is related to other classes. A class diagram gives a static view of the system. As opposed to a dynamic view, which describes what the software does when it runs, a class diagram provides a static view, which describes the classes that make up the software. Class Diagrams can also be used to generate source code for system implementation.

Guidelines for creating Class Diagram?

  1. Identify classes
    • a. From domain analysis such as textual analysis
    • b. From CRC cards
    • c. From use case description
    • d. From sequence diagram or use case scenarios
  2. Give analysis a name and a brief description which could be done through terms and glossary
  3. Structure classes in the right places of the diagram and related them with simple relationships
  4. As the development move forward, detail the class with attributes and operations, this often done in conjunction with use case and sequence diagrams
  5. Refine the class diagram with inheritance for future reuse
  6. Elaborate the details which is helpful for implementation such as accessibility, rules, constraints and etc.
  7. Put related classes into packages to form your software architecture

Purpose of Class Diagram

Class diagrams is widely used model for visualizing, specifying, and documenting structural features at different levels of details in software development process and they can help to achieve many benefits for your team, for example:

  • Capture and define the structure of classes together with other related classifiers.
  • Establish relationships between classes and classifiers.
  • Elaborate the class structure of a model by using attributes, operations, interface and etc.
  • Illustrate the common classifier roles and responsibilities that define the behavior of the system.
  • Organize the implementation classes in a package.
  • Refine an inheritance hierarchy among classes and classifiers for better reuse.
  • Refine class diagram from use case diagram or sequence diagram and establish the traceability among them.

Keen to try VP Online?

No limitations, no obligations, no cancellation fees.


Start a Free Trial