27
CS288 Object-Oriented Software Engineering Motivation and Introduction Bill Mitchell

CS288 Object-Oriented Software Engineering Motivation and Introduction Bill Mitchell

  • View
    219

  • Download
    1

Embed Size (px)

Citation preview

CS288Object-Oriented Software Engineering

Motivation and Introduction

Bill Mitchell

2

CS288 Exam Marks

Course Average : 60%(Weight 40%) Assignment average: 68%(Weight 60%) Exam average: 55%

Actual Distribution of Marks

0

5

10

15

20

25

1 2 3 4 5 6 7 8 9 10

3

Overview

• Outline of course• Introduction to business development process• Motivation for Object Oriented Programming

Interfaces

CustomerSystems

CompetitorSystems to Customer

Customer Domain

CustomerSystems

CompetitorSystems to Customer

CustomerSystems

CompetitorSystems to Customer

Customer Domain

New Features

Existing Systems to Customer

Enterprise Domain

New Features

Existing Systems to Customer

New Features

Existing Systems to Customer

Enterprise DomainExternalSystems

External Infrastructure

ExternalSystemsExternalSystems

External Infrastructure

4

Outline of Course

• Java OO topics• Classes and inheritance• Class members and methods• Creating and destroying objects• Class inheritance and hierarchy• Defining Exception Classes• Java GUI with Swing• Java Event Model• Threads of control

(parallel programming)

5

Introduction to business design process

• Purpose

• Introduction to complexity of real world

methods

• Understand some of the social aspects of

real software engineering

• Realize the need for good methodology in

global enterprise environments

6

Groups Feature System

Enterprise Development Process

Technical Marketing

High Level Designs

Detailed Designs

ArchitectureRequirements

Standards

Feature Teams

Technical Marketing Requirements

Functional Requirements

System Requirements

Component Requirements

Box Teams

Integration Teams

Testing Teams

Customers

7

Telecoms Example (of dynamic behaviour)

• Network provider deploying 3G.

• Placing order for handsets.

• One of the many features included will be access to network Java game repository.

User InterfaceJava Game Menu

Network Infrastructure

Java GameRepository

8

Initial Customer Requirements

User Handset Network

Menu Key

Options

SelectFetch

Resource

Java Game

Confirmation

9

Technical RequirementsSignal Battery

06:00:12

Jed Sneed

B1 B2 B3

B4 B5 B6

Power Java Ack

Usage Scenariosdetermine functional elementswithin the interface.

UI (Screen)

Specific interface methods(buttons)

Ph. Bk Menu Hold

Context dependant public methods(on screen menus)

Abstract representation of screen elements

10

Technical Marketing Scenarios

Signal Battery

Default ScreenDisplay

B1 B2 B3

B4 B5 B6

Power Java Ack

Ph. Bk Menu Hold

Java Key Press

Each eventmodifies functionalityand UI configuration

Signal Battery

Java Games

B1 B2 B3

B4 B5 B6

Power Java Ack

Back Menu Select

•Doom 8•Quake 9•etc......

Customer Scenariobroken down intosequence of atomicevents, which changeinterface functionality.

11

Technical Marketing Scenarios

Normative scenarios are very focused on isolated behaviour of feature in these requirements:

• What if voice call received during download?

• Are there other applications that should be able to override the download?

• What if during the download the network service provider tries to update the phone configuration via the air interface for enhanced game play?

12

Technical Marketing Scenarios

User UI Network

MarketingRequirements

System

Functional Requirements

These omissions arise because the role of technical marketing is to focus on customer requirements, rather than functional requirements.

Customers are focussed on generating revenue from each feature, and rarely worry about the system as a whole.

13

Functional Requirements

UI NetworkSystem

Functional Requirements

• Functional requirements refine technical marketing requirements to logical entities defined in terms of their functionality.

• They are defined independently from any architecture requirements that will constrain implementations.

14

Functional Requirements Scenarios• The purpose of functional requirements is to be

precise enough for detailed specifications to be written for any particular architecture that can then be implemented.

• They do not define every single aspect of the features behaviour.

• They define comprehensive behaviour of the feature so that it performs well for any common eventuality, and can fail gracefully in exceptional circumstance.

• Made up of functional scenarios and partially defined state based models.

State Based Model

15

Sequence Diagram Example

System State

A single user action in marketing scenario is decomposed into multiple events

between concurrent system components.

User UI Phone_OS

Display Default View

key_press

(java_game_menu) java_game_menu

display

(menu, java_games)

Display Java Game View

Idle

Java Game View

Message with parametersProcess timeline

Start

Finish

16

Quick Quiz, Java Level 1 Revision

Write a complete Java program that:1. adds up the squares of the first 20 integers:

1 + 2*2 + 3*3 + .......... + 20*202. The program must use a for loop to achieve

this task.3. The program must implement this algorithm:

• Let sum be an integer with initial value 0• For each integer i between 0 and 20 add i*i to sum• Output the final value of sum to standard out.

Time: 5 minsNOT assessedTo be marked by person next to you in class

17

Quick Quiz, C++ Model Solution

package sumofintegers;public class SumOfIntegers { public SumOfIntegers() { } public static void main(String[] args) { int n = 20; int sum = 0; for (int i =0; i < n; i++) { sum += i*i; } System.out.println ("The sum of integers from 0 to " + n + " is " + sum ); }}

(2 marks: defining a package)

(2 marks: defining class and constructor)

(2 marks: correct main method declaration)

(3 marks: ‘for’ loop syntax)

(2 marks: loop body)

(2 marks: output syntax and string concatenation)

(2 marks: setting up n and sum variables )

Total out of 15

18

Software Engineering Methodology

• Modular(Can split tasks into self contained units that can

be worked on by different groups)

• Reusable(So can be incorporated into future releases of new products)

• Flexible(When requirements are in constant flux it is easier to modify

system)

• Reliable(Less likely to introduce errors and easier to find errors)

19

Objects Oriented Programming

• Language for describing process, ‘things’ and ‘how’ they behave, change, can be used or can be adapted.

• Think of cookery recipe. An Apple Pie recipe tells you what you need, and how to put things together. Neither on there own makes much sense.

Object Data Object Methods

20

Objects - Packaging data and functionality togetherExample:

CGI character in TV drama, Emperor Dalek

Data:• 3d coordinates of geometry• texture properties• shading properties• lighting properties

Methods:• Mapping 3d coords to

pixels•Lighting•Shading•Perspective•Depth testing

• Audio rendering ofvoice

• Physical movementof components

21

Example – Tea the drink

Class: Tea Drinking

Data:• types of tea• kind of tea (bag or leaf)• amount of tea for pot of tea for N people• additional ingredients, milk, sugar, lemon

Methods:Top level method of ‘Making Tea’ breaks

down into many sub methods:• fill kettle with water• boil kettle• WHAT NEXT?

22

There were five primary goals in the creation of the Java language:

1. It should use the object-oriented programming methodology.

2. It should allow the same program to be executed on multiple computer platforms.

3. It should contain built-in support for using computer networks.

4. It should be designed to execute code from remote sources securely.

5. It should be easy to use and borrow the good parts of older Object Oriented languages like C++.

23

Java Example: Azureus BitTorrent Client

24

Java Example: Web Servers

25

Java Example:Open Office, Open Source Microsoft Office Replacement.

As built in Java is portableto:

All LinuxAll UnixAll WindowsMacs

Currently gaining market incash strapped local governments

26

NetBeans, IDE for Java.

27

Summary

• Course outline and structure• Introduction to global enterprise engineering

methods• Realization of complexity of system design