1 / 28

Intro to UML - OO Class Diagrams

Intro to UML - OO Class Diagrams. Week 5 CMIS570. Plan for Tonight. Object terms Unified Modeling Language history Class Diagrams Intro to Oracle Oracle ERDs. Object-Oriented Analysis & Design. Object-oriented analysis Defines all of the types of objects that do the work of the system

Download Presentation

Intro to UML - OO Class Diagrams

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to UML - OOClass Diagrams Week 5 CMIS570

  2. Plan for Tonight • Object terms • Unified Modeling Language history • Class Diagrams • Intro to Oracle • Oracle ERDs

  3. Object-Oriented Analysis & Design • Object-oriented analysis • Defines all of the types of objects that do the work of the system • Shows how objects interact • Object-oriented design • Defines all additional object types needed to communicate with people and devices in the system • Refines each type of object for implementation

  4. Object-Oriented Approach • Views information systems as collections of interacting objects that work together to accomplish tasks • Objects - things in the computer system that can respond to messages • No processes, programs, data entities, or files

  5. Classes and Objects • A class is a category of similar objects. • Each object is an instance of a class – that is, one specific member of the class. • Class is the template – it contains all the shared attributes and behaviors found in each object of the class.

  6. Objects • An object is a person, place, event, or thing about which we want to capture data and define processes. • Where have you heard this definition before?

  7. Objects versus Entity • Objects can have behaviors. • Behaviors are methods or operations that serve to specify what actions the object can perform. • Object instance is assigned a unique identifier. • Entities have primary and foreign keys. • However, objects have attributes like entities.

  8. Example! Patient appointment scheduling example

  9. Characteristics of OO Approach • Methods and Messages • Encapsulation (Information Hiding) • Hierarchical Inheritance • Polymorphism

  10. Behaviors / Methods / Messages • Behaviors specify what the object can do. • A method is nothing more than an action or process that an object can perform. Methods are very much like a function or procedure in a traditional programming language. • A message is the information sent to objects to trigger methods. Essentially a function or procedure call from one object to another object.

  11. Encapsulation / Information Hiding • Combining of processes and data into a single object. • All attributes and methods are all together/incorporated in definition of object. • Makes it easier to create new object classes – knows what to do when you want to create a new patient.

  12. Hierarchical Inheritance • Classes can have “children” • Parent is “base” or “super” class • Child is “derived” or “sub” class • Similar to subtypes and supertypes of entities.

  13. Polymorphism • The same message can be interpreted differently by different classes of objects.

  14. Unified Modeling Language (UML) • The Three Amigos – Booch, Jacobson, and Rumbaugh • Objective was to provide a common vocabulary of object-based terms and diagramming techniques for any systems development project from analysis through implementation.

  15. UML diagrams • 9 diagrams • Used throughout SDLC • Use consistent syntax and notation. • Key building block is the use-case.

  16. O-O Diagrams

  17. Class Diagrams • Static Model • During analysis, classes refer to the people, places, events, and things about which the system will capture information. • What is this similar to?

  18. Class Diagram vs ERD • What would the class diagram contain that the ERD does not?

  19. How to Draw the Class • Each class is drawn using three part-rectangles. • Let’s draw a class diagram for the Patient Appointment Scheduling System.

  20. Patient Admission system • A patient will call in to schedule an appointment or cancel an appointment. The office employee should be able to look up the patient’s name to determine if this is an existing patient. The office employee should also be able to lookup any existing unpaid bills the patient may have with the doctor’s office. The system will look up available times and dates for an appointment. When a day/time works for the patient, the system will add a new appointment. • Before available days and times can be recorded, an employee of the doctor’s office will need to create a master schedule. This master schedule will list all the doctor’s schedules and the days and times the office will be open for appointments. The employee may also be able to update other forms, such as a patient’s medical history. • A doctor can alter his or her schedule. When this occurs, the doctor will inform the employee of any days/times when he/she is not available. In addition, the doctor can add days/times when he/she is available to see patients.

  21. Three kinds of Methods • Constructor • Query • Update

  22. Relationships in Class Diagram • Again, similar to relationship in ERD. • However, maintained internally by system rather than by primary keys or foreign keys.

  23. Multiplicity • Just another name for cardinality • … and a different way to show it

  24. Multiplicity

  25. Creating a Class Diagram • 1. Identify classes • 2. Identify attributes and methods • 3. Draw relationships between the classes.

  26. Example:Student Fitness class • When a student wants to add a new class, the manager will check the fitness class schedule for availability. The manager will notify the student of an opening, and the student will pay the fee if there is an opening. The student is then registered for the class. • As new instructors are hired, their availability to teach a class will be recorded. Information on the type of class the instructor is certified to teach as well as the times he/she is available is recorded. • At times, the fitness class schedule must be changed. When this occurs, the manager will change the fitness schedule, and will then notify the instructors and students who are affected by the change.

  27. Another example • Using the web, customers should be able to search for products and identify if the item is available. They should be able to order the item. The functionality that the system should have is listed below: • Search through the inventory of products • Place an order • Receive marketing material on all products • User should be able to place item into shopping cart • User should be able to provide customer information including billing information.

  28. One last one… • The Cougar Car Rental Agency rents cars to customer at the airport. Customers either call to reserve a rental car for specific dates or come to the Cougar Car Rental desk at the airport to rent a car without a reservation. The car rental agents work behind the counter, taking phone reservations and waiting on customers. • When renting a car to a customer, the rental agent fills out the customer and rental car information on a rental contract, has the customer provide a credit card number as a down payment, has the customer sign the rental contract, and provide the customer a copy of the rental contract along with the keys for the rental car. • Cougar Agency also has service technicians who clean the cars when customers return them, fill cars with gas, and prepare the cars for the next rental. The service technicians also make sure that the cars receive their regular maintenance, such as oil changes, and schedule other service when the cars are in need of repair. Also, Cougar has only a limited number of each type of vehicle to rent.

More Related