🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

2023_S2_IT1050_Lecture 03.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Object Oriented Concepts Object Oriented Concepts Lecture 03 Introduction to Classes 1 SLII...

Object Oriented Concepts Object Oriented Concepts Lecture 03 Introduction to Classes 1 SLIIT - Faculty of Computing Object Oriented Concepts Learning Outcomes At the end of the Lecture students should be able to Understand Abstraction Understand, describe and identify Objects and Classes 2 SLIIT - Faculty of Computing Object Oriented Concepts Object Oriented Programming Object Oriented Programming is a method of implementation in which programs are organized as a collection of objects which cooperate to solve a problem. Allows to solve more complex problems easily. 3 SLIIT - Faculty of Computing Object Oriented Concepts Object Oriented Programming A complex system is developed using smaller sub systems. Sub systems are independent units containing their own data and functions. Can reuse these independent units to solve many different problems. 4 SLIIT - Faculty of Computing Object Oriented Concepts A Computer System 5 SLIIT - Faculty of Computing Object Oriented Concepts Object – General Meaning Oxford Dictionary 6 SLIIT - Faculty of Computing Object Oriented Concepts Objects in the Real World (c) 2017 Monique Snoeck, KU LEUVEN 7 SLIIT - Faculty of Computing Object Oriented Concepts Grouping related things together (c) 2017 Monique Snoeck, KU LEUVEN 8 SLIIT - Faculty of Computing Object Oriented Concepts Classes We can classify objects into concepts. To do this we focus on the essential properties of an Object. Classes are Concepts. Square Triangle Class Class Button Class Fork Spoon Class Class (c) 2017 Monique Snoeck, KU LEUVEN Cup Class 9 SLIIT - Faculty of Computing Object Oriented Concepts Abstraction Distinguish between different Objects Classify Objects into Concepts Focus on the common properties (c) 2017 Monique Snoeck, KU LEUVEN 10 SLIIT - Faculty of Computing Object Oriented Concepts Abstraction Distinguish between different Objects Classify Objects into Concepts Focus on the common properties Cat Class Dog Class (c) 2017 Monique Snoeck, KU LEUVEN 11 SLIIT - Faculty of Computing Object Oriented Concepts Activity 1 – Indentify Objects, Classes Dr. Pradeepa IWT Amali OOC Prof. Chandimal Mihiran SPM Dr. Malitha Heshani 12 SLIIT - Faculty of Computing Object Oriented Concepts Properties A class has a set of properties (attributes). i.e. What do we need to store to describe a student? Activity - 2 What are the properties of a Student? i.e. Name Age ….. 13 SLIIT - Faculty of Computing Object Oriented Concepts Activity - 3 Payroll system Class: Employee What are the properties needed ? Employee number Designation Marital status Age OT Hours Loan Installment Basic Salary Height Name Allowance OT Rate weight Number of children Bonus Address Hobbies Insurance payment Favourite Movie SLIIT - Faculty of Computing Object Oriented Concepts Abstraction Abstraction is the process of removing characteristics from ‘something’ in order to reduce it to a set of essential characteristics that is needed for the particular system. 15 SLIIT - Faculty of Computing Object Oriented Concepts Abstraction 16 SLIIT - Faculty of Computing Object Oriented Concepts Abstraction An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provide crisply defined conceptual boundaries, relative to perspective of the viewer. ( Reference : Grady Booch, eta (2008), Object Oriented Analysis and Design with Applications 3rd Edition, pg 44) 17 SLIIT - Faculty of Computing Object Oriented Concepts Activity 4 – Objects/Classes 18 SLIIT - Faculty of Computing Object Oriented Concepts Reference Chapter 02 & 03 Grady Booch (2008), Object-Oriented Analysis and Design with Application, 3rd Edition Chapter 03 Deitel & Deitel’s (2016), C++ How to Program, 9th Edition 19 SLIIT - Faculty of Computing

Use Quizgecko on...
Browser
Browser