Object Oriented Software Development CIS Today: Object Oriented Analysis

Size: px
Start display at page:

Download "Object Oriented Software Development CIS Today: Object Oriented Analysis"

Transcription

1 Object Oriented Software Development CIS 50-3 Marc Conrad D104 (Park Square Building) Today: Object Oriented Analysis The most single important ability in object oriented analysis and design is to skillfully assign responsibilities to software components. 13/09/04 18:01:07 Marc Conrad - University of Luton 1

2 What is an Object? An object is an entity which consists of a number of operations and a state which remembers the effect of the operations. State is regarded as information which is saved in a set of variables. Operations (aka. methods) read and/or affect the information. The only part that can be seen by an outsider are the operations. For this reason, operations are also known as behaviours. Information is hidden to the outsider. 13/09/04 18:01:07 Marc Conrad - University of Luton 2

3 What is an object? Tangible Things as a car, printer,... Roles as employee, boss,... Incidents as flight, overflow,... Interactions as contract, sale,... Specifications as colour, shape, st Qtr 2nd Qtr 3rd Qtr 4th Qtr East West North An object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain. An "object" is anything to which a concept applies. 13/09/04 18:01:07 Marc Conrad - University of Luton 3

4 Example: A Person as an Object I nformation: Name, Age, Address, Friends,... Behaviour: jump bend legs stretch legs lift arms,... walk talk 13/09/04 18:01:07 Marc Conrad - University of Luton 4

5 UML diagram of the Person class -name: string -yearofbirth: int Person +create(thename: string,theyear: int) +jump() +getage(this year: int):int Name Private data (attributes) Initialisation (constructor) Public behaviour (methods)

6 Java code of the Person class public class Person { private String name; private int yearofbirth; Name Private data (attributes) public Person(String thename, int theyear) { name = thename; yearofbirth = theyear; } public void jump() { System.out.println(name + " jumps"); } public int getage(int thisyear) { return thisyear - yearofbirth; } } Initialisation (constructor) Public behaviour (methods)

7 C++ code of the Person class #include <iostream> class Person{ private: char name[20]; int yearofbirth; public: Person(char *thename, int theyear) { yearofbirth = theyear; sprintf(name, thename); } void jump() { std::cout << name << " jumps" << std::endl; } int getage(int thisyear) { return thisyear - yearofbirth; } }; Name Private data (attributes) Initialisation (constructor) Public behaviour (methods)

8 Basic Terminology: Classes and Instances A Class is a template or abstract description of the same type of objects. It defines the common features of the objects, that is the operations and information structure. An Instance is an object created from a class. An instance s behaviour and information structure is defined in the class. Its current state (values of instance variables) is determined by operations performed on it. 13/09/04 18:01:07 Marc Conrad - University of Luton 8

9 Basic Terminology: Inheritance Inheritance is a way of relating two classes so that one class may use another class's members without redefining them. Inheritance is what separates abstract data type (ADT) programming from OO programming. The basic principle is simple: A class gets the state and behaviour of another class and adds additional state and behaviour. 13/09/04 18:01:07 Marc Conrad - University of Luton 9

10 What is the purpose of Inheritance? Specialisation: Extending the functionality of an existing class. Generalisation: Sharing commonality between two or more classes. Polymorphism. Implementation of different behaviour to the same message (depending on the type of the object). 13/09/04 18:01:07 Marc Conrad - University of Luton 10

11 Inheritance - related Terminology Derived class or subclass or child class. A class which inherits some of its attributes and methods from another class. Base class or superclass or parent class. A class from which another class inherits. Ancestor. A class s ancestors are those from which its own superclasses inherit. Descendant. A class s descendants are those which inherit from its subclasses. 13/09/04 18:01:07 Marc Conrad - University of Luton 11

12 Inheritance vs. Aggregation Inheritance means that one class inherits the characteristics of another class. This is also called a is a relationship: A car is a vehicle Aggregation describes a has a relationship. One object is a part of another object. A car has wheels A student is a person A person has legs 13/09/04 18:01:07 Marc Conrad - University of Luton 12

13 Basic Terminology: Polymorphism Original meaning: Having many forms The sender of a stimulus doesn t need to know the receiver s class. Different receivers can interpret the message in their own way. Consequence: different receivers can response to the same stimulus based on their interpretation. So we can have a variety of objects who process the same piece of data in different ways. Implemented via method overloading and overriding. 13/09/04 18:01:07 Marc Conrad - University of Luton 13

14 Basic Terminology: Encapsulation Encapsulation is the process of hiding the implementation details of an object. The only access to manipulate the object data is through its interface. It protects an object s internal state from being corrupted by other objects. Also, other objects are protected from changes in the object implementation. Encapsulation allows objects to be viewed as black boxes. Communication is achieved through an interface. 13/09/04 18:01:07 Marc Conrad - University of Luton 14

15 Example: Encapsulation Encapsulation is the practice of including in an object everything it needs hidden from other objects. The internal state is usually not accessible by other objects. But see also: Public: Has an age and can jump. Private: Has a name and a year of birth. 13/09/04 18:01:07 Marc Conrad - University of Luton 15

16 The Analysis Phase In software engineering, analysis is the process of converting the user requirements to system specification (system means the software to be developed). System specification, also known as the logic structure, is the developer s view of the system. Function-oriented analysis concentrating on the decomposition of complex functions to simply ones. Object-oriented analysis identifying objects and the relationship between objects. 13/09/04 18:01:07 Marc Conrad - University of Luton 16

17 Object Oriented Analysis Identifying objects: Using concepts, CRC cards, stereotypes, etc. Organising the objects: classifying the objects identified, so similar objects can later be defined in the same class. Identifying relationships between objects: this helps to determine inputs and outputs of an object. Defining operations of the objects: the way of processing data within an object. Defining objects internally: information held within the objects. 13/09/04 18:01:07 Marc Conrad - University of Luton 17

18 Three ways to do Object Oriented Analysis (there are more ). Conceptual model (Larman) Produce a light class diagram. CRC cards (Beck, Cunningham) Index cards and role playing. Analysis model with stereotypes (Jacobson) Boundaries, entities, control. A good analyst knows more than one strategy and even may mix strategies in order to identify the objects and relationships for the design phase. 13/09/04 18:01:07 Marc Conrad - University of Luton 18

19 Conceptual Model - Overview A conceptual model is a representation of concepts in a problem domain. In UML it is basically a class diagram without operations. It may show: Concepts Associations of concepts Attributes of concepts 13/09/04 18:01:07 Marc Conrad - University of Luton 19

20 The conceptual model: Strategies to Identify Concepts Finding Concepts with the Concept Category List. Finding Concepts with Noun Phrase Identification. A central distinction between object oriented and structures analysis: division by concepts (objects) rather than division by functions. 13/09/04 18:01:07 Marc Conrad - University of Luton 20

21 The Concept Category List physical or tangible objects specifications, designs, descriptions of things places transactions transaction line items roles of people containers of other things things in a container abstract noun concepts organisations events processes rules and policies catalogues records services manuals, books 13/09/04 18:01:07 Marc Conrad - University of Luton 21

22 Finding Concepts with Noun Phrase Identification Identify the noun and noun phrases in textual descriptions of a problem domain and consider them as candidate concepts or attributes. Care must be applied with this method. A mechanical noun-to-concept mapping isn t possible, and words in natural languages are ambiguous (especially English). 13/09/04 18:01:07 Marc Conrad - University of Luton 22

23 The return item Use case. Exercise: Find the Nouns! The system controls a recycling machine for returnable bottles, cans and crates. The machine can be used by several customers at the same time and each customer can return all three types of item on the same occasion. The system has to check, for each item, what type has been returned. The system will register how many items each customer returns and when the customer asks for a receipt, the system will print out what was deposited, the value of the returned items and the total return sum that will be paid to the customer. An operator also (not in return item Use Case) 13/09/04 18:01:07 Marc Conrad - University of Luton 23

24 Case Study: Nouns in The Recycling machine - The return item Use case. The system controls a recycling machine for returnable bottles, cans and crates. The machine can be used by several customers at the same time and each customer can return all three types of item on the same occasion. The system has to check, for each item, what type has been returned. The system will register how many items each customer returns and when the customer asks for a receipt, the system will print out what was deposited, the value of the returned items and the total return sum that will be paid to the customer. An operator also (not in return item Use Case) 13/09/04 18:01:07 Marc Conrad - University of Luton 24

25 Case Study: Nouns found in the description: recycling machine bottles, cans, and crates machine customers, customer types of item, item, type, returned items system receipt return sum 13/09/04 18:01:07 Marc Conrad - University of Luton 25

26 Case Study: Discussion of recycling machine. recycling machine bottles, cans and crates machine customers, customer types of item, item, type, returned items system receipt return sum This concept is the overall system. As we consider only one single use case, it is better to name this concept in the context of this use case, e.g. Deposit item receiver 13/09/04 18:01:07 Marc Conrad - University of Luton 26

27 Case Study: Discussion of bottles, cans, and crates. deposit item receiver bottles, cans, and crates machine customers, customer types of item, item, type returned items plural. system receipt return sum In a conceptual model it is usually better to use singular and multiplicities instead of As bottle, can and crate have much in common (they are processed as items), they could be generalised to an item. We should remember this for later (inheritance). 13/09/04 18:01:07 Marc Conrad - University of Luton 27

28 Case Study: Discussion of machine and system. deposit item receiver bottle, can, crate machine customers, customer types of item, item, type, returned items system receipt return sum Machine and System mean here the same, namely the Recycling machine, i.e. the Deposit item receiver 13/09/04 18:01:07 Marc Conrad - University of Luton 28

29 Case Study: Discussion of customers and customer. deposit item receiver bottle, can, crate They are outside of the system. customers, customer We establish a concept, that types of item, item, type, returned interfaces with the customer (and items is inside the system): receipt return sum The customer has already been identified as an actor. Customer panel 13/09/04 18:01:07 Marc Conrad - University of Luton 29

30 Case Study: Discussion of item (etc.). deposit item receiver bottle, can, crate customer panel types of item, item, type, returned items receipt return sum The items that are inserted in the machine. Good candidate as superclass for bottle, can, crate. Let s call it Deposit item 13/09/04 18:01:07 Marc Conrad - University of Luton 30

31 Case Study: Discussion of receipt. deposit item receiver bottle, can, crate customer panel deposit item receipt return sum The concept that remembers all items inserted in the machine. To distinguish it from the piece of paper returned to the customer, call it Receipt basis 13/09/04 18:01:07 Marc Conrad - University of Luton 31

32 Case Study: Discussion of return sum. deposit item receiver bottle, can, crate customer panel deposit item receipt basis return sum The sum that it is returned to the customer is actually computed by adding up all values of the items stored in the receipt basis. The sum itself is only a primitive data value, and may therefore not be considered as a concept. 13/09/04 18:01:07 Marc Conrad - University of Luton 32

33 Case Study: Discussion of other concepts. deposit item receiver bottle, can, crate customer panel deposit item receipt basis These are the concepts identified by nouns. Did we forget something? Check the Concept Category List! The system interfaces with the physical object printer, so we add an interface concept Receipt printer 13/09/04 18:01:07 Marc Conrad - University of Luton 33

34 Case Study: Summary of concepts identified in the analysis deposit item receiver bottle, can, crate customer panel deposit item receipt basis receipt printer So far we have identified: Concepts A generalisation relationship. Next step: Finding associations. 13/09/04 18:01:07 Marc Conrad - University of Luton 34

35 How to make a conceptual model. Find the concepts Draw them in a conceptual model Add associations Add attributes 13/09/04 18:01:07 Marc Conrad - University of Luton 35

36 Drawing of Concepts Customer panel Deposit item receiver Receipt basis Deposit item Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 36

37 Adding Associations If one concept needs to know of a another concept for some duration they should be linked by an association. Also use the following list in order to identify associations. 13/09/04 18:01:07 Marc Conrad - University of Luton 37

38 Common Association List A is a part of B A is contained in B A is a description for B A is a line item of a transaction or report B A is known or reported in B A is a member of B A is a organisational subunit of B A uses or manages B A communicates with B A is related to a transaction B A is a transaction related to another transaction B A is next to B A is owned by B 13/09/04 18:01:07 Marc Conrad - University of Luton 38

39 Adding associations The Customer panel communicates to the receiver when an item is inserted. Also when the receipt is requested. Customer panel initiates action Deposit item receiver Receipt basis Deposit item Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 39

40 Adding associations The Deposit item receiver manages Deposit items: The items are classified. Customer panel initiates action Deposit item receiver Receipt basis Deposit item classifies Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 40

41 Adding associations The Deposit item receiver communicates to Receipt basis: Items received and classified are stored. It also creates the receipt basis when it is needed for the first time. Customer panel initiates action Deposit item receiver creates & notifies Receipt basis Deposit item classifies Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 41

42 Adding associations The Receipt basis collects Deposit items. Customer panel initiates action Deposit item receiver creates & notifies Receipt basis captures Deposit item classifies Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 42

43 Adding associations On request by the Customer Panel the Deposit item receiver initiates printing of a receipt on the printer. Customer panel initiates action Deposit item receiver creates & notifies captures Deposit item classifies prints on Receipt basis Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 43

44 Adding associations Adding multiplicities Only one association here is a 1 to many relationship All others are 1 to 1. Customer panel initiates action Deposit item receiver creates & notifies Receipt basis captures 1..* Deposit item classifies prints on Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 44

45 Adding Attributes An attribute is a logical data value of an object. Attributes in a conceptual model are simple data values as Boolean, Date, Number, String (Text), Time, Address, Colour, Price, Phone Numbers, Product Codes, etc. Sometimes it is difficult to distinguish between attributed and concepts E.g. Concept Car vs. attribute Reg. Number. 13/09/04 18:01:07 Marc Conrad - University of Luton 45

46 Adding attributes The Deposit item has a value. Also it will be assigned a number that shows later on the receipt. Customer panel initiates action Deposit item receiver creates & notifies Receipt basis captures 1..* Deposit item number value classifies prints on Receipt printer Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 46

47 Adding attributes In order to be classified by the Deposit item receiver each item has also a weight and a size. However this is the same for each type of item, but different between the types. Customer panel initiates action Deposit item receiver creates & notifies Receipt basis captures 1..* Deposit item number value classifies prints on Receipt printer Can weight size Bottle weight size Crate weight size 13/09/04 18:01:07 Marc Conrad - University of Luton 47

48 Summary NOT in a conceptual model: arrows dotted lines methods, operations, functions Customer panel initiates action Deposit item receiver creates & notifies Receipt basis captures 1..* Deposit item number value classifies prints on Receipt printer Can weight size Bottle weight size Crate weight size 13/09/04 18:01:07 Marc Conrad - University of Luton 48

49 CRC cards & Role playing Not part of the UML design process but useful in detecting responsibilities of objects are CRC cards (developed by Kent Beck and Ward Cunningham). CRC stands for Class-Responsibility- Collaborator. They look like: Name Responsibilities Collaborators 13/09/04 18:01:07 Marc Conrad - University of Luton 49

50 CRC cards & Role playing CRC cards are index cards, one for each class, upon which the responsibilities and collaborators of a class are written. They are developed in a small group session where people role play being the various classes. Each person holds onto the CRC cards for the classes that they are playing the role of. 13/09/04 18:01:07 Marc Conrad - University of Luton 50

51 Example: Recycling machine CRC cards Customer panel receive items Deposit item receiver receive print request Dep. item receiver Printer Deposit Item Receipt Basis classify items create Receipt Basis print receipt Etc. 13/09/04 18:01:07 Marc Conrad - University of Luton 51

52 The Object Oriented Analysis Model (Jacobson) An analysis model is used to represent the system specification. To achieve robustness and stability the model must be implementation environment independent. Any change in the implementation environment will not affect the logical structure of the system. The model must be able to capture information, behaviour (operations) and presentation (inputs and outputs). 13/09/04 18:01:07 Marc Conrad - University of Luton 52

53 Behaviour - Information - Presentation The model is defined in information - behaviour - presentation space. behaviour information presentation 13/09/04 18:01:07 Marc Conrad - University of Luton 53

54 Syntax of the Object Oriented Analysis Model Within an use case, we employ three types of objects (in Rational Rose, they are known as three types of entities or stereotypes): Entity On information behaviour plane and incline to information axis Boundary / Interface Control On the presentation axis On information behaviour plane but incline towards behaviour axis 13/09/04 18:01:07 Marc Conrad - University of Luton 54

55 Entity, Control, Interface behaviour information presentation 13/09/04 18:01:07 Marc Conrad - University of Luton 55

56 Semantics of the Object Oriented Analysis Model An entity object models information that shows the state of a system. This information is often used to record the effects of operations and therefore is related to the behaviours of the system. A boundary/interface object models inputs and outputs and operations that process them. A control object models functionality/operations regarding to validate and decide whether to process and pass information from the interface object to the entity object or the way around. 13/09/04 18:01:07 Marc Conrad - University of Luton 56

57 Pragmatics of the Object Oriented Analysis Model Identifying interface objects functions directly related to actors. Identifying entity objects information used in an use case and functions of processing the information. Identifying control objects functions that link interface objects and entity objects 13/09/04 18:01:07 Marc Conrad - University of Luton 57

58 Example: The Recycling machine Identifying interface objects Printer, Customer Panel Identifying entity objects Long term information: Crate, Bottle, Can Superclass: Deposit item Short term information: Receipt basis Identifying control objects Deposit item receiver 13/09/04 18:01:07 Marc Conrad - University of Luton 58

59 The Recycling machine Interface Objects Customer panel Receipt printer 13/09/04 18:01:07 Marc Conrad - University of Luton 59

60 The Recycling machine Entity Objects Receipt basis Deposit items Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 60

61 The Recycling machine Link Interface and Entity Objects by a Control Object Deposit item receiver Customer panel Receipt printer Receipt basis Deposit items Can Bottle Crate 13/09/04 18:01:07 Marc Conrad - University of Luton 61

62 Summary - Object Oriented Analysis The main task is identifying the objects. Also: Relationships between objects. Three strategies: Conceptual Model (concepts as objects) CRC cards (index cards as objects) Analysis Model (Stereotypes as objects) Next step: Design. 13/09/04 18:01:07 Marc Conrad - University of Luton 62

Patterns and Testing

Patterns and Testing and Lecture # 7 Department of Computer Science and Technology University of Bedfordshire Written by David Goodwin, based on the lectures of Marc Conrad and Dayou Li and on the book Applying UML and (3

More information

Chapter 5: Structural Modeling

Chapter 5: Structural Modeling Chapter 5: Structural Modeling Objectives Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. Understand the processes used to create CRC cards, class

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

OO System Models Static Views

OO System Models Static Views OO System Models Static Views UML Class & Object Diagrams Software Engineering OO Models Class Diagram Slide 1 Objective Introduces the evolutionary approach for building classes Explain how to identify

More information

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel Enn Õunapuu enn.ounapuu@ttu.ee What is a domain model? A domain model captures the most important types of objects in the context

More information

Object-Oriented Systems Analysis and Design Using UML

Object-Oriented Systems Analysis and Design Using UML 10 Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design, 8e Kendall & Kendall Copyright 2011 Pearson Education, Inc. Publishing as Prentice Hall Learning Objectives Understand

More information

MechEng SE3 Lecture 7 Domain Modelling

MechEng SE3 Lecture 7 Domain Modelling MechEng SE3 Lecture 7 Domain Modelling Simon Gay (slides by Phil Gray) 17 February 2010 1 This week s supplementary reading Zero Balances and Zero Responsibility Michael Bolton http://www.developsense.com/essays/zero.html

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M Introduction to UML Part I 1 What is UML? Unified Modeling Language, a standard language for designing and documenting a system in an object- oriented manner. It s a language by which technical architects

More information

Object-Oriented Design. Module UFC016QM. and Programming. Objects and Classes. O-O Design Unit 2: Faculty of Computing, Engineering

Object-Oriented Design. Module UFC016QM. and Programming. Objects and Classes. O-O Design Unit 2: Faculty of Computing, Engineering Module UFC016QM Object-Oriented Design and Programming O-O Design Unit 2: Objects and Classes Faculty of Computing, Engineering and Mathematical Sciences Schedule Quick recap on Use Case diagrams UWE Flix

More information

An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram

An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram After studying this chapter you should be able to: Define an object. Understand the terms

More information

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models CS 494 Object-Oriented Analysis & Design UML Class Models Overview How class models are used? Perspectives Classes: attributes and operations Associations Multiplicity Generalization and Inheritance Aggregation

More information

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far University of Calgary Department of Electrical and Computer Engineering SENG 609.23: Object Oriented Analysis and Design Behrouz Homayoun Far Evaluation Test () 20:00 20:30 PM Instructions: 1. This booklet

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

CMSC201 Computer Science I for Majors

CMSC201 Computer Science I for Majors CMSC201 Computer Science I for Majors Lecture 25 Classes All materials copyright UMBC and Dr. Katherine Gibson unless otherwise noted Run time Last Class We Covered Run time of different algorithms Selection,

More information

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D Today s Objectives To explain the basic concepts of OO(A)D To describe some best practices regarding to OO(A)D What is NOT UML? The UML

More information

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay Computer Science and Engineering Indian Institue of Technology Bombay November 27, 2004 What is Object Oriented Programming? Identifying objects and assigning responsibilities to these objects. Objects

More information

SE 1: Software Requirements Specification and Analysis

SE 1: Software Requirements Specification and Analysis SE 1: Software Requirements Specification and Analysis Lecture 9: UML Class (Concept), Object, Communication Diagrams Nancy Day, Davor Svetinović http://www.student.cs.uwaterloo.ca/ cs445/winter2006 uw.cs.cs445

More information

UML Primer. -Elango Sundaram

UML Primer. -Elango Sundaram UML Primer -Elango Sundaram About UML UML Can be thought of as a blue print for Software Graphical notation for expressing underlying OOA&D ideas Can be used to design any type of application, hardware,

More information

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge LECTURE 3: SOFTWARE DESIGN Mike Wooldridge 1 Design Computer systems are not monolithic: they are usually composed of multiple, interacting modules. Modularity has long been seen as a key to cheap, high

More information

Object Oriented Analysis & Design (OOAD)

Object Oriented Analysis & Design (OOAD) Object Oriented Analysis & Design (OOAD) 1 OOAD It focuses on objects where system is broken down in terms of the objects that exist within it. Functions (behaviour) and data (state) relating to a single

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Classes, objects, methods and properties

Classes, objects, methods and properties Learning Object 1. African Virtual University Template for extracting a learning object Main Learning Objective Nature of learning object Key concept (s) Source Module information Access source module

More information

Exam Duration: 2hrs and 30min Software Design

Exam Duration: 2hrs and 30min Software Design Exam Duration: 2hrs and 30min. 433-254 Software Design Section A Multiple Choice (This sample paper has less questions than the exam paper The exam paper will have 25 Multiple Choice questions.) 1. Which

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Object-Oriented Design

Object-Oriented Design Software and Programming I Object-Oriented Design Roman Kontchakov / Carsten Fuhs Birkbeck, University of London Outline Discovering classes and methods Relationships between classes An object-oriented

More information

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright Java Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Java Concepts Syntax, Grammar, Formatting, Introduce Object-Orientated Concepts Encapsulation, Abstract Data, OO Languages,

More information

2D1358 Object Oriented Program Construction in C++ Exercises & Labs. Course Registration / Accounts. Course Literature

2D1358 Object Oriented Program Construction in C++ Exercises & Labs. Course Registration / Accounts. Course Literature 2D1358 Object Oriented Program Construction in C++ Exercises & Labs Lecturer: Frank Hoffmann hoffmann@nada.kth.se Assistents: Danica Kragic danik @nada.kth.se Anders Orebäck oreback @nada.kth.se Peter

More information

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin Chapter 10 Object-Oriented Analysis and Modeling Using the UML McGraw-Hill/Irwin Copyright 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Objectives 10-2 Define object modeling and explain

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects Lecture 4: Fundamentals of Object Technology Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Credit where Credit is Due Some material presented in this lecture

More information

CS-202 Introduction to Object Oriented Programming

CS-202 Introduction to Object Oriented Programming CS-202 Introduction to Object Oriented Programming California State University, Los Angeles Computer Science Department Lecture III Inheritance and Polymorphism Introduction to Inheritance Introduction

More information

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L Inheritance Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 9.1 9.4 1 Inheritance Inheritance allows a software developer to derive

More information

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized around the notion of procedures Procedural abstraction

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 4: OO Principles - Polymorphism http://courses.cs.cornell.edu/cs2110/2018su Lecture 3 Recap 2 Good design principles.

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized

More information

Object-Oriented Design (OOD) and C++

Object-Oriented Design (OOD) and C++ Chapter 2 Object-Oriented Design (OOD) and C++ At a Glance Instructor s Manual Table of Contents Chapter Overview Chapter Objectives Instructor Notes Quick Quizzes Discussion Questions Projects to Assign

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

Object-oriented basics. Object Class vs object Inheritance Overloading Interface Object-oriented basics Object Class vs object Inheritance Overloading Interface 1 The object concept Object Encapsulation abstraction Entity with state and behaviour state -> variables behaviour -> methods

More information

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design Overview Introduction to Object Oriented Design Understand Classes and Objects. Understand some of the key concepts/features in the Object Oriented paradigm. Benefits of Object Oriented Design paradigm.

More information

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Design issues for objectoriented. languages. Objects-only pure language vs mixed. Are subclasses subtypes of the superclass? Encapsulation Encapsulation grouping of subprograms and the data they manipulate Information hiding abstract data types type definition is hidden from the user variables of the type can be declared variables

More information

Inheritance. OOP components. Another Example. Is a Vs Has a. Virtual Destructor rule. Virtual Functions 4/13/2017

Inheritance. OOP components. Another Example. Is a Vs Has a. Virtual Destructor rule. Virtual Functions 4/13/2017 OOP components For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Data Abstraction Information Hiding, ADTs Encapsulation Type Extensibility Operator Overloading

More information

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci) Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci) Sung Hee Park Department of Mathematics and Computer Science Virginia State University September 18, 2012 The Object-Oriented Paradigm

More information

Inheritance and Substitution (Budd chapter 8, 10)

Inheritance and Substitution (Budd chapter 8, 10) Inheritance and Substitution (Budd chapter 8, 10) 1 2 Plan The meaning of inheritance The syntax used to describe inheritance and overriding The idea of substitution of a child class for a parent The various

More information

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay Object Oriented Processes R.K.Joshi Dept of Computer Science and Engg. IIT Bombay Life Cycle Models Waterfall Spiral Fountain Extreme Model Driven Phases and their relations with object orientation requirements

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

MSO Lecture 3. Wouter Swierstra. September 14, 2015

MSO Lecture 3. Wouter Swierstra. September 14, 2015 1 MSO Lecture 3 Wouter Swierstra September 14, 2015 2 Haven t found a lab partner yet? Come talk to me in the break. 3 LAST LECTURE How can I manage the process of constructing complex software? How do

More information

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes CS111: PROGRAMMING LANGUAGE II Lecture 1: Introduction to classes Lecture Contents 2 What is a class? Encapsulation Class basics: Data Methods Objects Defining and using a class In Java 3 Java is an object-oriented

More information

Building custom components IAT351

Building custom components IAT351 Building custom components IAT351 Week 1 Lecture 1 9.05.2012 Lyn Bartram lyn@sfu.ca Today Review assignment issues New submission method Object oriented design How to extend Java and how to scope Final

More information

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011 UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011 1 Goals of the Lecture Review the material in Chapter 2 of the Textbook Cover key parts of the UML notation

More information

System Analysis and Design/ Object-Oriented System Modeling

System Analysis and Design/ Object-Oriented System Modeling 9.1 Computer systems are designed by a. simplifying requirements of system b. breaking of the system into smaller self-contained co-operating subsystems c. breaking up the systems into independent parts

More information

Object-Oriented Programming in C++/Handout 01 Page 1 of 8

Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Table of Contents Table of Contents... 1 Learning Objectives... 2 Object-Oriented Approach... 2 Advantages of Object-Oriented Approach... 2 Principles

More information

Programming I. Course 9 Introduction to programming

Programming I. Course 9 Introduction to programming Programming I Course 9 Introduction to programming What we talked about? Modules List Comprehension Generators Recursive Functions Files What we talk today? Object Oriented Programming Classes Objects

More information

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

May Comp-B 11, Advanced Software Design. 3 hours duration

May Comp-B 11, Advanced Software Design. 3 hours duration May 2016 98-Comp-B 11, Advanced Software Design 3 hours duration NOTES: 1. If doubt exists as to the interpretation of any question, the candidate is urged to submit, with the answer paper, a clear statement

More information

1. Write two major differences between Object-oriented programming and procedural programming?

1. Write two major differences between Object-oriented programming and procedural programming? 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do:

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java

Object-Oriented Software Engineering Practical Software Development using UML and Java Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes Lecture 5 5.1 What is UML? The Unified Modelling Language is a standard graphical

More information

06. Analysis Modeling

06. Analysis Modeling 06. Analysis Modeling Division of Computer Science, College of Computing Hanyang University ERICA Campus 1 st Semester 2017 Overview of Analysis Modeling 1 Requirement Analysis 2 Analysis Modeling Approaches

More information

Chapter 2: The Object-Oriented Design Process

Chapter 2: The Object-Oriented Design Process Chapter 2: The Object-Oriented Design Process In this chapter, we will learn the development of software based on object-oriented design methodology. Chapter Topics From Problem to Code The Object and

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

Data Abstraction. Hwansoo Han

Data Abstraction. Hwansoo Han Data Abstraction Hwansoo Han Data Abstraction Data abstraction s roots can be found in Simula67 An abstract data type (ADT) is defined In terms of the operations that it supports (i.e., that can be performed

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak CSE 403: Software Engineering, Spring 2015 courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams Emina Torlak emina@cs.washington.edu Outline Designing classes Overview of UML UML class diagrams

More information

JAVA: A Primer. By: Amrita Rajagopal

JAVA: A Primer. By: Amrita Rajagopal JAVA: A Primer By: Amrita Rajagopal 1 Some facts about JAVA JAVA is an Object Oriented Programming language (OOP) Everything in Java is an object application-- a Java program that executes independently

More information

Software Engineering II - Specimen Exam Answers Page 1 of 10

Software Engineering II - Specimen Exam Answers Page 1 of 10 Software Engineering II - Specimen Exam Answers Page 1 of 10 A1(a) Encapsulation adopts the principle of "information hiding" so that the objects state can only be accessed through the objects operations.

More information

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay Object Oriented Processes R.K.Joshi Dept of Computer Science and Engg. IIT Bombay Life Cycle Models Waterfall Spiral Fountain Extreme Model Driven Phases and their relations with object orientation requirements

More information

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides 1B1b Inheritance Agenda Introduction to inheritance. How Java supports inheritance. Inheritance is a key feature of object-oriented oriented programming. 1 2 Inheritance Models the kind-of or specialisation-of

More information

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java

More information

Modelling with Classes. CITS1220 Software Engineering

Modelling with Classes. CITS1220 Software Engineering Modelling with Classes CITS1220 Software Engineering Lecture Overview Classes and UML Associations between classes Special types of association: is-a, has-a, is-part-of Modelling Example Implementing associations

More information

Basic Structural Modeling. Copyright Joey Paquet,

Basic Structural Modeling. Copyright Joey Paquet, Basic Structural Modeling Copyright Joey Paquet, 2000 1 Part I Classes Copyright Joey Paquet, 2000 2 Classes Description of a set of objects sharing the same attributes, operations and semantics Abstraction

More information

22/09/2012 INFO2110. Copyright Warning. Revision of class diagram. Overview. Purpose of class diagram. Generalization Relationship

22/09/2012 INFO2110. Copyright Warning. Revision of class diagram. Overview. Purpose of class diagram. Generalization Relationship 22/09/202 INFO20 Copyright Warning System Analysis and Modelling Semester 2, 202 Lecture 8, Structural Modelling (II) COMMONWEALTH OF AUSTRALIA Copyright Regulations 969 WARNING This material has been

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017 Programming Language Concepts Object-Oriented Programming Janyl Jumadinova 28 February, 2017 Three Properties of Object-Oriented Languages: Encapsulation Inheritance Dynamic method binding (polymorphism)

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Introduction to Object-Oriented Programming Objects and classes Abstract Data Types (ADT). Encapsulation OOP: Introduction 1 Pure Object-Oriented Languages Five rules [Source: Alan Kay]: Everything in

More information

Object oriented Programming

Object oriented Programming Object-Oriented Programming Chapter 4 Object oriented Programming 91 Chapter 4 Object oriented Programming Chapter 4 Object oriented Programming System modelling helps the analyst to understand the functionality

More information

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Introduction to OOP. Procedural Programming sequence of statements to solve a problem. Introduction to OOP C++ - hybrid language improved and extended standard C (procedural language) by adding constructs and syntax for use as an object oriented language. Object-Oriented and Procedural Programming

More information

Requirements & Domain Models. Lecture 13: Object Oriented Modelling. Nearly anything can be an object. Object Oriented Analysis

Requirements & Domain Models. Lecture 13: Object Oriented Modelling. Nearly anything can be an object. Object Oriented Analysis Lecture 3: Object Oriented Modelling Object Oriented Analysis Rationale Identifying Classes Attributes and Operations Class Diagrams Associations Multiplicity Aggregation Composition Generalization Easterbrook

More information

Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson

Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson January 13, 2005 January 18, 2005 1 of 38 Lecture Goals Introduce the basic concepts of object-oriented analysis/design/programming

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation Module Outline Fundamentals of Object Positioning Object Oriented Analysis Fundamentals of Object 1. Encapsulation 2. Abstraction 3. Inheritance 4. Polymorphism The need of Modeling Unified modeling language

More information

Why use inheritance? The most important slide of the lecture. Programming in C++ Reasons for Inheritance (revision) Inheritance in C++

Why use inheritance? The most important slide of the lecture. Programming in C++ Reasons for Inheritance (revision) Inheritance in C++ Session 6 - Inheritance in C++ The most important slide of the lecture Dr Christos Kloukinas City, UoL http://staff.city.ac.uk/c.kloukinas/cpp (slides originally produced by Dr Ross Paterson) Why use inheritance?

More information

1. Introduction to Object Oriented Software Development

1. Introduction to Object Oriented Software Development 1. Introduction to Object Oriented Software Development a) Object: A set of data together with some operations that can be performed on that data. Eg. Bank Account. Data can be account number, name of

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

1B1b Classes in Java Part I

1B1b Classes in Java Part I 1B1b Classes in Java Part I Agenda Defining simple classes. Instance variables and methods. Objects. Object references. 1 2 Reading You should be reading: Part I chapters 6,9,10 And browsing: Part IV chapter

More information

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1 Object-Oriented Languages and Object-Oriented Design Ghezzi&Jazayeri: OO Languages 1 What is an OO language? In Ada and Modula 2 one can define objects encapsulate a data structure and relevant operations

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

2. The object-oriented paradigm!

2. The object-oriented paradigm! 2. The object-oriented paradigm! Plan for this section:! n Look at things we have to be able to do with a programming language! n Look at Java and how it is done there" Note: I will make a lot of use of

More information

Object-oriented development. Object-oriented Design. Objectives. Characteristics of OOD. Interacting objects. Topics covered

Object-oriented development. Object-oriented Design. Objectives. Characteristics of OOD. Interacting objects. Topics covered Object-oriented development Object-oriented Design Object-oriented analysis, design and programming are related but distinct. OOA is concerned with developing an object model of the application domain.

More information

Inheritance, Polymorphism, and Interfaces

Inheritance, Polymorphism, and Interfaces Inheritance, Polymorphism, and Interfaces Chapter 8 Inheritance Basics (ch.8 idea) Inheritance allows programmer to define a general superclass with certain properties (methods, fields/member variables)

More information

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed CREATED BY: Muhammad Bilal Arslan Ahmad Shaad JAVA Chapter No 5 Instructor: Muhammad Naveed Muhammad Bilal Arslan Ahmad Shaad Chapter No 5 Object Oriented Programming Q: Explain subclass and inheritance?

More information

CSCU9T4: Managing Information

CSCU9T4: Managing Information CSCU9T4: Managing Information CSCU9T4 Spring 2016 1 The Module Module co-ordinator: Dr Gabriela Ochoa Lectures by: Prof Leslie Smith (l.s.smith@cs.stir.ac.uk) and Dr Nadarajen Veerapen (nve@cs.stir.ac.uk)

More information

Introduction to Inheritance

Introduction to Inheritance Introduction to Inheritance James Brucker These slides cover only the basics of inheritance. What is Inheritance? One class incorporates all the attributes and behavior from another class -- it inherits

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1. Programming Paradigms OBJECT ORIENTED PROGRAMMING A programming methodology defines the methodology of designing and implementing programs using the key features and other building blocks (such as key

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes 5.1 What is UML? The Unified Modelling Language is a standard graphical language

More information

CS 251 Intermediate Programming Inheritance

CS 251 Intermediate Programming Inheritance CS 251 Intermediate Programming Inheritance Brooke Chenoweth University of New Mexico Spring 2018 Inheritance We don t inherit the earth from our parents, We only borrow it from our children. What is inheritance?

More information

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Lecturer: Sebastian Coope Ashton Building, Room G.18   COMP 201 web-page: Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Lecture 17 Concepts of Object Oriented Design Object-Oriented

More information

Inheritance CSC9Y4. Inheritance

Inheritance CSC9Y4. Inheritance Inheritance CSC9Y4 1 Inheritance We start with a superclass from which a subclass can be derived. New attributes and methods can be defined in a subclass and existing methods re-defined. How do we know

More information

Goal: build an object-oriented model of the realworld system (or imaginary world) Slicing the soup: OOA vs. OOD

Goal: build an object-oriented model of the realworld system (or imaginary world) Slicing the soup: OOA vs. OOD Domain analysis Goal: build an object-oriented model of the realworld system (or imaginary world) Slicing the soup: OOA vs. OOD OOA concerned with what, not how OOA activities focus on the domain layer

More information