WEBDEV Concepts

122 Part 4: Advanced concepts • Relationship : describes how classes interact with each other. There are three types of relationships: • Association : Structural relationship between classes. For example, the Orders class is linked to the Product and Customer classes. A Customer can place several Orders. An order contains several products. An order must contain at least one product. • Dependency : Use relationship that establishes that the instances of a class are linked to the instances of another element. For example, the Orders class uses the Inventory class: before adding a product to an order, you must make sure the product is available in stock. • Generalization : Relationship between a general class (parent) and a specific class (child) that derives from it. For example, the Sail_Boat and Speed_Boat classes are derived from the Boat class. • Package : divide and organize the diagram representation (in the same way that directories organize files). Each package can contain classes and relationships. The generation of a class diagram allows you to create the structure of the WINDEV, WEBDEV and WINDEV Mobile classes used in your application. 2.2 Use case diagram A use case diagram is used to view the behavior of a system in such way that: • the user can understand how to use each element. • the developer can implement these elements. For example, the behavior of a cell phone can be described via a use case diagram. A use case diagram includes the following elements: • Actor : represents the role of the users that interact with the application. For example, a person who works in a bank as a loan manager. If they have an account in the same bank, they will also play the role of customer. • Use case : describes a sequence of actions performed by the application. For example, place an order, enter an invoice, create a new customer entry, etc, ... A use case describes the actions performed by an application but it does not specify how the application performs these actions. • Relationship : describes the behavior of an actor with a use case. There are three types of relationships: • Association : Structural relationship between two linked elements. • Dependency : Indicates that one element uses or depends on another element. For example, a bank customer may get cash from an ATM. In this case, the Get Cash action depends on the Customer. To withdraw money, the Customer must enter a PIN number. In this case, the Get Cash action depends on the Password. • Generalization : Relationship in which elements are organized based on a hierarchy.

RkJQdWJsaXNoZXIy NDQ0OA==