Top Banner
UFCEPM-15-M Object- oriented Design and Programming Jin Sa
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: uml ppt

UFCEPM-15-M Object-oriented Design and Programming

Jin Sa

Page 2: uml ppt

• Start NetBeans (Start Programming)• Login to Blackboard

Page 3: uml ppt

Unit1: Object-oriented design and programming

Introduction and Use casesJin Sa

Page 4: uml ppt

Aims of the module

• Gain an understanding of object-oriented concepts: analyse, design and implement systems.

• Be able to use UML to analyse and design an object-oriented system.

• Use a typical object-oriented programming language (e.g. Java) to implement an object-oriented design

Page 5: uml ppt

Useful Reading• “UML Distilled: A Brief Guide to the Standard

Object Modelling Language (Object Technology S.)”, by Martin Fowler and Kendall Scott, ISBN number is: 0321193687.

• “Introduction to Java Programming – Comprehensive version, 6/e” (or 7/e) by Daniel Liang

• “Java Software Solution” by Lewis and Loftus • Course notes• Well known website

Page 6: uml ppt

Content and schedule• Unit 1 : Object-oriented design: introduction and use cases• Unit 2: Object-oriented programming: getting started with Java • Unit 3: Object-oriented design: objects and classes • Unit 4: Object-oriented design: class relationship• Unit 5: Assignment element 1• Unit 6: Object-oriented programming: objects and classes• Unit 7: Object-oriented design: interaction modelling• Unit 8: Object-oriented design and programming: inheritance and polymorphism• Unit 9: Object-oriented design and programming: abstract classes and interfaces• Unit 10: Assignment element 2 • Unit 11: Object-oriented programming: graphic user interface (GUI)• Unit 12: Object-oriented programming: event-driven programming• January Exam

Page 7: uml ppt

Object-orientation• What is an object?– Knows something: data– Has a behaviour or does something: function

• Objects make up systems

Page 8: uml ppt

Object-orientation lifecycle - simplified

• Use cases capture system functionalities• Class model, interaction model and

state/activity models capture the logical design of the system

• Use cases bridges the gap between requirement documents and the logical design

• Using the logical design, we create physical implementation using a specific language such as Java

Page 9: uml ppt

Design is art!

• There are many ways to achieve the same end result.

• Design is opinionated.• Design is subject to fashion!The important things are:• Rationale and justification• Reflection

Page 10: uml ppt

UML

• “The Unified Modelling Language (UML) is a language for specifying, visualizing, constructing, and documenting the artefacts of a software-intensive system.” [UML Specification 2.0]

• Reference:See student activity 1.2 in unit 1. (in own time)

Page 11: uml ppt

UML Diagrams

• Two types: Structure and Behaviour• Structure: static view , not about order of

interaction, e.g. class diagram• Behaviour: dynamic behaviour, – e.g. use case diagram illustrate how users interact

with the system– e.g. sequence diagram focusing on interaction

between objects and the sequence of these interaction

Page 12: uml ppt

Diagram notations

Use case diagram Class diagram

Page 13: uml ppt

Diagram notations (2)

• Sequence diagram

Page 14: uml ppt

In class exercises

• Read the case study in Section E – UweFlix Cinema– Through out this module, you maybe asked to

design and implement various aspects of this case study

Page 15: uml ppt

Use Cases and Actor

• Use case is “… a means for specifying required usages of a system” [UML spec. v2.0].

• Software designer – maps groups of related scenarios to a series of use

cases (captures the functional requirements)– establishes who (actors) interact with the use cases,

and which use cases work with each other• “An actor specifies a role played by a user or any

other system that interacts with the subject.” [UML spec. v2.0]

Page 16: uml ppt

Notation in UML

Page 17: uml ppt

Content of Use Case

• A textual narrative that describes the functionality or requirements that the use case represents.

• For example, a use case that represented the process of buying an item would be given a name like “Purchase Item”. The contents would be a description describing of the process of purchasing an item.

• This description normally describes a series of interactions between the system and the actor. This process normally yields a result that is of value to the actor.

Page 18: uml ppt

Example of a Use Case DescriptionBuy a Product (Taken from UML Distilled p101) Main Success Scenario:1. Customer browses catalogue and selects item to buy.2. Customer goes to the check out.3. Customer fills in shipping information4. System presents full pricing information5. Customer fills in credit card information6. system authorizes purchase7. System confirms sale8. System sends confirming email to customer

Page 19: uml ppt

Example of a Use Case Description (2)

Extensions3a: Customer is a regular customer

.1 System displays current shipping information.2 Customer may accept or override

6a: System fails to authorize credit purchases.1 Customer may re-enter credit card information or may cancel

Page 20: uml ppt

In Class exercise

• Refer to the course notes section F student activity 1.4

• Produce a Use case diagram for UWEFlix.• Discussion about the Use Cases

Page 21: uml ppt

Getting Familiar with NetBeans

• Refer to the course notes on this topic: Section G. Follow the activities set in the course notes.

• Do student activity 1.5