Relations Links Versus Subclasses

User Generated

lfhzzref47

Programming

Description

Assignment:
Relations: Links Versus Subclasses

The basis of object-oriented design and programming is the class. The power of this approach comes from class relations or associations. These are ways in which classes can interact with one another. The two most important relations are inheritance and links.

Inheritance means that one class is a subset of another class. For example, the program developed in the Benchmarks could have the Employee class be a child-class of a Person class. A child-class inherits directly from the parent-class. A subclass structure is one in which a class will inherit from every class above it in the hierarchy. The Person class might store name, birthdate, address, and other similar information. The Employee class would inherit all of that information as well as any methods and would also add information and methods of its own like pay rate. This would facilitate creating another child-class of Person called Customer that would also inherit everything from Person but would be distinct from Employee. The Discussion prompt described the possibility of making PaidEmployee and Intern subclasses of Employee. Inheritance is shown in a class diagram with an open arrow pointing from the child-class to the parent-class.

Links mean that one class can pull information or methods from another class or that another relationship exists. As an example, a Payroll class might need to call the calculate_pay method for the PaidEmployee class. As another example, there might be a separate Department class, and the Employee class would have a “works in” relationship with the Department class. Links are shown as either a single line or as a line with diamonds on one or both ends. The form and labeling of links helps to tell about the relationship between the classes. You will utilize these forms in later systems courses, but for now, just placing a line in the diagram with a brief description describing the link is fine.

Our example results in the following class diagram. This diagram was created in Visio, which is one of several tools useful for creating UML diagrams. Note that not all aspects of this class UML diagram are completed. In some cases, not all class information is included. This shows examples of inheritance and linking but does not show the full system which will have far greater complexity.

  • Using one of the information systems examples explored in previous weeks or another example of your own choosing, describe an inheritance relation between two classes and show this with a class and subclass in a diagram.
  • Using one of the information systems examples explored in previous weeks or another example of your own choosing, describe a link relation between two classes and show this with a class diagram link. It is not necessary to utilize the same system as for inheritance.

For these diagrams, you may keep them simple. You will not be graded on multiplicity, public/private designations, or distinctions among associations, aggregations, and composition. All you need to do for each is show two class diagrams and describe the relationship. You will cover other aspects when you study system analysis and system design.

Place both diagrams and the accompanying descriptions in a single document file with a cover sheet.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hi buddy, i have finished the assignment. Thank you for giving me that opportunity to work with you.

Using UML class diagram to describe inheritance and links in information
systems.
a. Inheritance
Inheritance refers to the ability classes to share similar functionalities where one class
referred to as the child class...


Anonymous
Awesome! Perfect study aid.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags