CS288 Object-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
3 Overview Outline of course Introduction to business development process Motivation for Object Oriented Programming
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 GroupsFeatureSystem Enterprise Development Process Technical Marketing High Level Designs Detailed Designs Architecture Requirements 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 Interface Java Game Menu Network Infrastructure Java Game Repository
8 Initial Customer Requirements UserHandsetNetwork Menu Key Options Select Fetch Resource Java GameConfirmation
9 Technical Requirements SignalBattery 06:00:12 Jed Sneed B1B2B3 B4B5B6 PowerJavaAck Usage Scenarios determine functional elements within the interface. UI ( Screen ) Specific interface methods (buttons) Ph. BkMenuHold Context dependant public methods (on screen menus) Abstract representation of screen elements
10 Technical Marketing Scenarios SignalBattery Default Screen Display B1B2B3 B4B5B6 PowerJavaAck Ph. BkMenuHold Java Key Press Each event modifies functionality and UI configuration SignalBattery Java Games B1B2B3 B4B5B6 PowerJavaAck BackMenuSelect Doom 8 Quake 9 etc Customer Scenario broken down into sequence of atomic events, which change interface 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 UserUINetwork Marketing Requirements 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 UINetworkSystem 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 UIPhone_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 parameters Process 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* *20 2.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 mins NOT assessed To 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 DataObject Methods
20 Objects - Packaging data and functionality together Example: 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 of voice Physical movement of 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 portable to: All Linux All Unix All Windows Macs Currently gaining market in cash 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