Object-Orientated Design: Part 1

Slides:



Advertisements
Similar presentations
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 9 Classes.
Advertisements

Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Introduction to Object Oriented Programming Java.
Introduction to Information and Computer Science Computer Programming Lecture e This material (Comp4_Unit5e) was developed by Oregon Health and Science.
UML – Class Diagrams.
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
J. Michael Moore Object Oriented Programming: An Introduction CSCE 110.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
“Object-orientation” – what is it all about? Gill Harrison, Innovation North.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.
Java Classes Using Java Classes Introduction to UML.
CSCI 3328 Object Oriented Programming in C# Chapter 3: Introduction to Classes and Objects UTPA – Fall
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Java Classes Methods Objects. Classes Classes We have been using classes ever since we started programming in Java Whenever we use the keyword class.
Object-Oriented Programming in C++
UML DIAGRAMS Unified Modeling Language for Object Oriented Programming Unified Modeling Language for Object Oriented Programming.
Prepared by: Elsy Torres Shajida Berry Siobhan Westby.
CSE 1301 Lecture 5 Writing Classes Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Objects. The Heart of the Matter - The "Black Box" Object-oriented software is all about objects. An object is a "black box" which receives and sends.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5.
Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented.
Introduction to Classes, Objects, Methods and Attributes Lecture # 5.
Algorithms and Computer Programming. Algorithms algorithm is an ordered sequence of instructions for solving a problem. Look at it as a building blocks.
April 20022CS3X1 Database Design The relational model John Wordsworth Department of Computer Science The University of Reading
 To explain why the context of a system should be modelled as part of the RE process  To describe behavioural modelling, data modelling and object modelling.
Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the.
Software development For large and complex software use divide and conquer rule. Software design methods: Structured design Object-Oriented design.
BTS430 Systems Analysis and Design using UML Domain Model—Part 3: Association Classes.
1 Design Object Oriented Solutions Object Oriented Analysis & Design Lecturer: Mr. Mohammed Elhajj
IB Computer Science Content developed by Dartford Grammar School Computer Science Department UML.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object-Orientated Design (Summary)
What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.
Object-Orientated Programming
Objects as a programming concept
Object-oriented and Structured System Models
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Sachin Malhotra Saurabh Choudhary
DATA REQIREMENT ANALYSIS
The Movement To Objects
Object-Orientated Design: Part 2
Classes and OOP.
Objects as a programming concept
Mastering UML with Rational Rose 2002
Object-Oriented Databases
A first Look at Classes.
Inherited and Acquired Traits
Object-Orientated Programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Abstract descriptions of systems whose requirements are being analysed
The Entity-Relationship Model
Procedural Abstraction Object-Oriented Code
Chapter 7 Classes & Objects.
Modeling Classes with UML
Accounting System Design
Chapter 9 Classes & Objects.
OBJECT-ORIENTED PROGRAMMING
Need for the subject.
Accounting System Design
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Extended Learning Module G
Object-Oriented Programming Concepts
Behavioral Modeling with UML
2.1 Introduction to Object-Oriented Programming
Lecture 1 Introduction to Software Construction
Presentation transcript:

Object-Orientated Design: Part 1 Damian Gordon

Object Orientation An object is any tangible thing we can see touch and manipulate.

Object Orientation

Object Orientation Software objects are models are similar in the sense that they have certain features and can do certain things.

Object

Features Behaviours

Attributes Methods

A Collection of variables Attributes: A Collection of variables Attributes Methods

Attributes Methods Attributes: A Collection of variables Methods: A Collection of procedures

Dog Height Weight Eye Colour Hair Colour Length Fetch( ) Lie Down( ) Roll Over( ) Sit( ) Bark( )

Encapsulation Attributes Methods

Object Orientation To create an object what we typically do is first create the general class that a specific object comes from, and then we create a specific object of that class. For example, if a want to model a specific dog, first create the general CLASS of DOG, and then create a specific instance of that class, an OBJECT, called TINY the dog.

Tiny

Object Orientation Sometimes it’s easier to model things as an OBJECT, but often it’s easier to model a collection of things as a CLASS, and then create instances (‘OBJECTS’) of that CLASS. We can use UML (the Unified Modelling Language) to model Object-Orientated programs, and one modelling tool within UML is called a CLASS DIAGRAM.

Object Orientation Let’s imagine we wanted to create a CLASS DIAGRAM for the following scenario: We work in a greengrocer, we sell APPLES and ORANGES; APPLES are stored in BARRELS and ORANGES are stored in BASKETS.

Object Orientation APPLES are stored in BARRELS and ORANGES are stored in BASKETS.

Object Orientation APPLES are stored in BARRELS and ORANGES are stored in BASKETS. Apple

Object Orientation APPLES are stored in BARRELS and ORANGES are stored in BASKETS. Apple Barrel

Object Orientation APPLES are stored in BARRELS and ORANGES are stored in BASKETS. Apple Barrel Orange

Object Orientation APPLES are stored in BARRELS and ORANGES are stored in BASKETS. Apple Barrel Orange Basket

Object Orientation Let’s add in more rules to the scenario: Many APPLES are stored in one BARREL and many ORANGES are stored in one BASKET.

Object Orientation Many APPLES are stored in one BARREL and many ORANGES are stored in one BASKET. Apple Barrel * 1 * 1 Orange Basket

Object Orientation Many APPLES are stored in one BARREL and many ORANGES are stored in one BASKET. Apple Barrel go in > * 1 go in > * 1 Orange Basket

Object Orientation Let’s add some attributes:

Object Orientation Apple Barrel go in > * 1 go in > * 1 Orange +colour +weight +size go in > * 1 go in > * 1 Orange Basket +weight +orchard +date_picked +location

Object Orientation Apple Barrel go in > * 1 go in > * 1 Orange +colour: string +weight: float +size: int go in > * 1 go in > * 1 Orange Basket +weight: float +orchard: string +date_picked: date +location: string

Object Orientation Apple Barrel go in > * 1 go in > * 1 Orange +colour: string +weight: float +barrel: Barrel +size: int +apples: list go in > * 1 go in > * 1 Orange Basket +weight: float +orchard: string +date_picked: date +basket: Basket +location: string +oranges: list

Object Orientation Now let’s add some methods:

Object Orientation Apple Barrel go in > * 1 +colour: string +weight: float +barrel: Barrel +size: int +apples: list +pick(backet: Basket) +squeeze( ): juice +sell(cust: Customer) +discard( ) go in > * 1

Object Orientation go in > * 1 Orange Basket +weight: float +orchard: string +date_picked: date +basket: Basket +location: string +oranges: list +pick(backet: Basket) +squeeze( ): juice +sell(cust: Customer) +discard( )

etc.