Vous êtes sur la page 1sur 26

CSC 450

CSC450 Software Engineering


Devon M. Simmonds University of North Carolina, Wilmington

Software Design
Slides adapted from Robert B. France and other sources.
1

CSC 450

Software Design bridging the gap between


requirements & Implementation
Software Design Requirements Analysis Systems Engineering Deployment Testing Implementation

Evolution

In this lecture we will address:


An introduction to software design Software design phases Software design principles UML package diagrams
2

CSC 450

What is Software Design?


Software design expresses a solution to a problem in programming language independent terms.
This permits a design to be implemented in any programming language.

CSC 450

Why do we design?
A key design challenge is controlling complexity

CSC 450

Controlling Complexity
Complexity handling mechanisms:
Modularization - breaking up a solution into logical units. Abstraction - use functional and data abstraction.

CSC 450

Design Principles
Separation of concerns Modularity Abstraction Generality Incrementality Anticipation of change

CSC 450

Moving from problem to solution


Requirements Spec
System attributes, anticipated changes, design constraints Use Cases Contracts Class Diagrams Other models
7

Design Spec
Design goals

Architecture subsystem structure subsystem interfaces etc.

CSC 450
Requirements versus Design Class Diagrams
Domain analysis: Exploratory domain models are class diagrams in which classes represent domain concepts.
Classes in these diagrams DO NOT represent software concepts.

Requirements specification: A requirements class model (system domain model) consists of class diagrams in which the classes represent information that will be maintained by the software. Design specification: A design class model (system model) consists of class diagrams in which classes represent solution concepts.

An Example of a Requirements Class Diagram


Pay s-f or-ov erdue-charges

CSC 450
0..1

VideoRental CashPay ment amount : Money 1 Pay s-f or 1 RentalTransaction 1 date 1 1 1..* dueDate returnDate returnTime

*
Initiates 1 1 Customer address name phoneNumber 1 Has 1 Membership ID startDate 1 LoanPolicy perDay RentalCharge perDay LateCharge 1..* 1 Def ines 1..* Maintains

*
Rents

Records-rental-of 1..* VideoStore

Rents-f rom address name 1 phoneNumber

Stocks 1

Video ID 1

*
1

1 Owns-a

Catalog 1 Described-by 1..* VideoDescription 1 title subjectCategory Determines-rental-charge

An example of a design class diagram


EmployeeRole
+ getName [e2]
crewMember *

CSC 450

**

Booking
Booking [c2] * *

SpecificFlight
+ specifyAirplane [a1] + createFlightLog [b1] + changeAirplane [d1] + findCrewMember [e1] addLinkToBooking [c3]

0..1

Airplane
addLinkToSpecificFlight [a2, d3] deleteLinkToSpecificFlight [d2]

PassengerRole
+ makeBooking [c1] addLinkToBooking [c4]

0..1

FlightLog
FlightLog [b2]

Design phases
Architectural Design
Identify subsystems and the services they provide Describe interactions across subsystems

CSC 450

Subsystem Design:
Define classes Describe how objects interact to accomplish subsystem services
Sequence diagrams, state machines, etc.

User Interface Design Data structures/Database Design Algorithm Design


Pre and post conditions

Test Case Design

11

UML Diagram Types for Design


Architectural Design
Package diagrams Component diagrams Deployment diagrams

CSC 450

Subsystem Design:
Class diagrams Sequence diagrams State machines

Object Constraint language


To express constraints on models and model elements
12

CSC 450

Outline
Requirements Analysis Systems Engineering Software Design Implementation Deployment Testing

Evolution

An introduction to software design Software design phases Software design principles UML package diagrams

Software Design bridging the gap between requirements & Implementation

13

CSC 450

UML Packages
A package is rendered as a tabbed folder A package is a collection of model elements A package owns its model elements
destruction of the package results in destruction of the model elements relationship between a model element and its package is a composition
Domain

Shape
Production
Order Processing

Point Sales

Client

Name in box

Fill Order

Ship Order

Name in tab

Use of membership 14 symbol

Packages as a namespace
Domain Production

CSC 450

Sales Ship Order

+Client

OrderProcessing

Fill Order

A package defines a namespace


A model element belongs to at most one package Model elements can be referenced outside of the packages they are defined in, package1::class1::etc.
Domain::OrderProcessing::Fill
These are examples of qualified names.

A package can contain other packages


Domain::Production

Package elements may have public or private visibility only.


15

Example: package with subpackages


Domain

CSC 450

Core/Misc

Payments

Products

Sales

Authorization Transactions

16

Details of Payments Package


Payments 1 Payment amount merchantID Core::Store ServiceContract address name phoneNumber Authorizes-payments-of 1..* AuthorizationService

CSC 450

Paid-by 1 1 CashPayment amountTendered Credit Payment Check Payment

Check Check Authorization Service Credit Authorization Service 1 Authorized-by

Authorized-by

* * *
Establishescredit-for

Logs Establishesidentity-for 1 DriversLicense number 1 1 Abused-by 1 Sales::Customer - CreditPayments have CreditPaymentReplies Identifies - CheckPayments have CheckPaymentReplies

1 Accounts Receivable

1 CreditCard expiryDate number 1

Authorization Transactions:: PaymentAuthorizationReply

Domain::Payments::Payment
17

CSC 450

Packages of a Business System


Customer Care Accounts Receivable

Order Processing Marketing

Package can have dependencies on other packages


18

CSC 450

More of Package Diagrams in UML

19

CSC 450

UML packages - core concepts


Construct
Package

Description
A grouping of model elements.

Syntax
Name

Import

A dependency indicating that the public contents of the target package are added to the namespace of the source package. A dependency indicating that the public contents of the target package are available in the namespace of the source package. A dependency indicating that the public contents of the target package are added to the namespace of the source package.

import

Access

access

Merge

merge

20

CSC 450

Package Import, package access and package merge

21

Packages of a Business System - with specific dependencies


Customer Care -A
copy() paste()

CSC 450

Marketing

+A

<<access>>
Order Processing +A
cut() paste()

<<import>>

-B

22

CSC 450

Package Merge
Marketing
<<merge>> <<merge>>

Accounts Receivable

Order Processing

23

CSC 450

Package Merge (2)

24

CSC 450

Summary
An introduction to software design Software design phases Software design principles UML package diagrams

25

CSC 450

The End
Qu es ti ons?
______________________ Devon M. Simmonds Computer Science Department University of North Carolina Wilmington
_____________________________________________________________

26

Vous aimerez peut-être aussi