Open post

Example Class Diagram vs Object Diagram

An object diagram is a snapshot of the objects in a system at a point in time. We can use an object diagram to show an example configuration of a snapshot from a class diagram. The figure shows the Class Diagram of Party Composition Structure and a particular snapshot at a point in time.

The object of the names are underlined and each name takes the form object name : class name. Both parts of the name are optional, so Robert and :Person are legal names. You can then show values for attributes and links in the object diagram and you can also think of an object diagram as a collaboration diagram without messages.

Import into your Project
Open post

Sales Order System

association -- a relationship between instances of the two classes. There is an association between two classes if an instance of one class must know about the other in order to perform its work. In a diagram, an association is a link connecting two classes.

aggregation -- an association in which one class belongs to a collection. An aggregation has a diamond end pointing to the part containing the whole. In our diagram, Order has a collection of OrderDetails.

generalization -- an inheritance link indicating one class is a superclass of the other. A generalization has a triangle pointing to the superclass. Payment is a superclass of Cash, Check, and Credit.

A Class diagram gives an overview of a system by showing its classes and the relationships among them. Class diagrams are static -- they display what interacts but not what happens when they do interact.

This class diagram models a customer order from a retail catalog. The central class is the Order. Associated with it are the Customer making the purchase and the Payment. A Payment is one of four kinds: CashCheck, Credit or Wire Transfer. The order contains OrderDetails (line items), each with its associated Item.

Import into your Project
Open post

Class Diagram – A Car

A car consists of different structural components, such as the engine, body, suspension, gearbox, etc. Each component in turn contains its own attributes and operations. For example, the engine has its capacity, and it can be started or stopped. We can represent the car with a class diagram. The class diagram example shows a simplified structural model of a car in a class diagram.

Import into your Project

Posts navigation

1 2 3 44 45 46 47