Docsity

Object-Oriented Design and Development: UML Methodology and Peer Grader System - Prof. Ge, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Lecture 15 Object-Oriented Languages and Systems 1
Design
[Skrien §1.1] What do we mean by program
design?
Why do we worry about design when writing a
program? Why isn’t it enough that the
program works?
Outline for Lecture 15
I. UML method in
overview
II. Example: Peer
grader system
Requirements analysis
Domain analysis
Use-cases
Suppose the code is never intended to be read by anyone else, or
used again?
Let’s name some reasons that design matters.
Criteria for elegant software
[Skrien §1.2] Good software should be …
• Usable,
• Complete,
• Efficient,
.
• Robust,
• Scalable,
.
• Simple,
• Readable,
• Modifiable,
• Reusable,
The first of these deal with correctness.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Object-Oriented Design and Development: UML Methodology and Peer Grader System - Prof. Ge and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Lecture 15 Object-Oriented Languages and Systems 1

Design

[Skrien §1.1] What do we mean by program design?

Why do we worry about design when writing a program? Why isn’t it enough that the program works?

Outline for Lecture 15

I. UML method in overview

II. Example: Peer grader system

Requirements analysis Domain analysis Use-cases

Suppose the code is never intended to be read by anyone else, or used again?

Let’s name some reasons that design matters.

Criteria for elegant software

[Skrien §1.2] Good software should be …

  • Usable,
  • Complete,
  • Efficient, .
  • Robust,
  • Scalable, .
  • Simple,
  • Readable,
  • Modifiable,
  • Reusable,

The first of these deal with correctness.

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 2

The last deal with maintainability.

Object-oriented design methodologies

An object-oriented methodology is defined as the system of principles and procedures applied to object-oriented software development.

Just over ten years ago, there was no standard OOD methodology. Then, the proponents of three of the major methodologies—Grady Booch, James Rumbaugh, and Ivar Jacobson—joined forces to produce the Unified Modeling Language (UML).

The UML method in overview^1

The UML method is an iterative approach.

In the past, many software-development methods “insisted” on a rigid series of steps: analysis first, then design.

The UML method allows for the reality that the development of a system is an iterative process.

  • The method encourages early coding of pieces of the system to aid in the requirements-discovery process.

The design should allow for change and discovery as the development process continues.

The three steps of OOA/OOD:

  • Requirements analysis , which provides the basic charter for the system’s functions.
  • Domain analysis , which provides the key logical structure of the system.
  • System design , which provides the key physical structure of the system.

(^1) This discussion is adapted from Using the Booch Method: A Rational Approach , by Iseult White, © 1994, Rational.

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 4

Requirements analysis

During requirements analysis , the analyst works with—

  • end users, and
  • domain experts

to enumerate the use cases that are key to the system’s operation.

Objective: Requirements analysis essentially forms a contract between the customer and the developers on what they system is to provide.

Deliverables:

  • System charter —outlines the responsibilities of the system.
  • System function statement —outlines the key use cases of the system.

Domain analysis

During domain analysis , an o-o model of the real-world system is developed.

This gives the developers enough knowledge to create a system carrying out the required functions.

Objective: Domain analysis identifies all major objects in the domain, including data and major operations.

The development of the model concentrates on resolving —

  • the potentially bewildering vocabulary used to define the system,
  • contradictory requirements,
  • obscure policy, and
  • varying styles of explanation and communication.

Good domain analysis also adds appropriate levels of abstraction.

Lecture 15 Object-Oriented Languages and Systems 5

This allows structures to be built that will be reusable in many other domains.

Deliverables:

  • Class diagrams —identify key classes of the domain.
  • Inheritance diagrams —show which classes inherit from other classes. (Do not over-use inheritance!)
  • Use-case diagrams —illustrate how objects will interact to carry out key functions.

System design

During system design , an effective and efficient implementation is defined.

Objective: Select appropriate computers, devices, software services, software units, and data storage strategies.

Deliverables:

  • Architectural descriptions —capture major design decisions, such as choice of processors, language, etc.
  • Executable-release descriptions —define the goals and content of successive executable release implementations.
  • Package diagrams —partition the system into high-level groupings of classes and objects.
  • Component diagrams —show how the classes relate to the actual code. Specify the libraries and subsystems that are integrated to make up the system.
  • Sequence diagrams , which show the detailed operational logic to carry out functions. Tie together use-case diagrams and class diagrams, by showing how the classes collaborate to carry out a use-case.

Next time, we will cover the fundamentals of object orientation, and the UML methodology.

Example: Peer review in Expertiza

We will look at the peer-review functionality of the Expertiza system.

Lecture 15 Object-Oriented Languages and Systems 7

What does that tell us about submissions, and the relationship between submissions and reviews?

Another way to understand what the system is supposed to do is to take a look at some of its outputs:

Login screen

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 8

Create an assignment

Select an assignment

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 10

Fill out a rubric

View feedback and scores

Lecture 15 Object-Oriented Languages and Systems 11

Domain analysis

Domain analysis seeks to identify key abstractions —the classes and objects that are common to applications within a given domain. . The first step is discovering key classes. Start by underlining the nouns.

  • Don’t underline nouns that refer to implementation characteristics.
  • Be aware of ambiguity, aliasing, and overloading.
  • Distinguish between classes and objects.

As candidate abstractions are discovered, they are added to the data dictionary.

Some of the abstractions will turn out to be—

  • classes,
  • relations, and
  • attributes of other abstractions.

Choosing class names. A good class name should be—

  • Mnemonic.
  • A singular noun.
    • Characteristic of the abstraction.

.

The inability to name a class simply and clearly is a symptom of an ill-defined abstraction. It can be a warning sign of—

  • incompleteness,
  • weak cohesion, or
  • strong coupling.

Lecture 15 Object-Oriented Languages and Systems 13

Events: What events are relevant to the system?

  • An instructor sets up a new course to use the system.
  • An instructor creates a new assignment.
  • A student submits a submission.
  • A student reviews someone else’s submission.
  • A student submits a revision of a submission.
  • A student fills out a rubric for a submission.

Use-cases

A “use-case” is a narrative that describes the sequence of events when an actor (external to the system) uses the system to complete a process.

They are “stories” of how the system is used.

Based upon the events we have just listed, we can develop use- cases.

Use case: Create assignment Actors: Instructor Description: An instructor creates an assignment, specifying due dates, rubrics, penalties, etc.

Let us try one or two more use-cases. Use case: Actors: Description:

Use case: Actors:

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 14

Description:

To gain a deeper understanding of the processes and requirements for a system, an expanded use-case can be developed.

They are often done in a “conversational” style between the actors and the system.

Let us consider the use-case of reviewing a submission.

Use case: Review a submission Actors: Student Description: Student selects a submission to review, types in a review, and optionally a grade, then submits the review.

Typical course of events : Actor action System response

  1. A student logs into the system. 2. The system presents a screen listing assignments to submit or review.

  2. Student enters a review of the problem and, optionally, a grade, and submits it 6. The system updates its database of reviews and displays the new review to the student.

The use-cases in a system can be illustrated in a use-case diagram:

CSC/ECE 517 Lecture Notes © 2007 Edward F. Gehringer 16

The next step is to flesh out the analysis by deciding on the data attributes and operations that each class will have.

What attributes does course need to have?

What attributes does assignment need?

What attributes does student need?

How about submission?

When we proceed to design, we will also decide on methods for each.

Lecture 15 Object-Oriented Languages and Systems 17

Exercise: Requirements for the flight-reservation system

 The mission is to allow round-trip airline tickets to be bought over the Web.

 Each customer specifies an origination point, a destination, and dates for outbound and return flights.

 The customer reserves one outbound flight and one return flight from a menu presented by the system.

 Each choice that the system presents consists of one or more flight segments (there may be a change of planes).

 The customer may buy tickets for one or more passengers.

 No more tickets can be sold for a flight than there are seats on the plane.

 Each passenger is assigned to a specific seat.

 The system calculates the total cost of the tickets by adding the cost of the individual segments.

 If dissatisfied with the cost, the customer may select alternate flights.

 After a customer has bought a ticket, (s)he will be e-mailed a confirmation.

  1. Identify the key abstractions
  2. Write out a CRC card for each
  3. Outline a sample use-case