1 Basic Object-Oriented Concepts  Object-Oriented Paradigm What is an Object?  What is a Class?  Constructing Objects from a class Problem Solving in.

Slides:



Advertisements
Similar presentations
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Advertisements

Object-Oriented Analysis and Design
CS-2135 Object Oriented Programming
Introduction To System Analysis and Design
Object-Oriented Design & Programming Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-Oriented PHP (1)
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
1 Basic Object Oriented Concepts Overview l What is Object-Orientation about? l What is an Object? l What is a Class? l Constructing Objects from Classes.
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
1 CMSC 132: Object-Oriented Programming II Software Development IV Department of Computer Science University of Maryland, College Park.
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Object-oriented Programming Concepts
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
C++ fundamentals.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Introduction To System Analysis and design
TCU CoSc Introduction to Programming (with Java) Getting to Know Java.
Object Oriented Software Development
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
OOP (Object Oriented Programming with AS3) Flash ActionScript 3.0 Introduction to Thomas Lövgren, Flash developer Introduction.
Programming Languages and Paradigms Object-Oriented Programming.
Object Oriented Programming Development
Introduction to Object-oriented programming and software development Lecture 1.
Object Oriented Programming Lecturer: Andreas P. Adi
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
BCS 2143 Introduction to Object Oriented and Software Development.
Chapter 8 More Object Concepts
DATA STRUCTURE Introduction to Systems Programming - COMP 1005, 1405 Instructor : Behnam Hajian
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
CS 350 – Software Design The Object Paradigm – Chapter 1 If you were tasked to write code to access a description of shapes that were stored in a database.
Object Oriented Programming with JAVA Arash N. Kia AlZahra University Definitions – Part 1.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Design Model Lecture p6 T120B pavasario sem.
Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
: Maha Sabri Altememe Lecturer : Maha Sabri Altememe Lecture :1 1.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
CSCI 171 Presentation 15 Introduction to Object–Oriented Programming (OOP) in C++
Introduction to Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Structure A Data structure is a collection of variable which can be same or different types. You can refer to a structure as a single variable, and to.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
JAVA By Waqas.
CHAPTER 5 GENERAL OOP CONCEPTS.
Interface, Subclass, and Abstract Class Review
Object Oriented Concepts -I
Object Oriented Concepts -II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
ITEC 3220A Using and Designing Database Systems
Workshop for Programming And Systems Management Teachers
Object-Oriented PHP (1)
Handout-2(a) Basic Object Oriented Concepts
Presentation transcript:

1 Basic Object-Oriented Concepts  Object-Oriented Paradigm What is an Object?  What is a Class?  Constructing Objects from a class Problem Solving in 00 languages  More 00 Concepts  Strength of Object-Oriented Paradigm

2 Object-Oriented Paradigm  To truly understand Java, we need to understand the paradigm on which it is built on: the Object-Oriented Paradigm (OOP).  OOP is a model where by a problem domain is modeled into objects, so that problem solving is by interaction among objects.  OOP is a more natural model compared to the others since its approach is exactly the way humans view problem solving.  We take a closer look at the main ingredients of the model: Objects and Classes.

3 What is an Object?  An object is an individual, identifiable entity, either real or abstract, that has a well-defined boundary.  An object has two main properties, namely: State: each object has attributes, whose values represent its state. Behavior, each object has a set of behavior.  Example of an object: You, the student following this Lecture, are an object. Your attributes include your name, your GPA, your major, etc. You also have a set of behavior, including attending lectures, solving home works, telling someone your GPA, sleeping, etc.  Other examples of objects are: The instructor delivering this lecture. This room. This lecture. This University. ICS102. Your Bank Account  Try to list some of the attributes and set of behavior for each of the above objects.  Also look around you and identify the objects you can see or imagine.

4 What is a Class?  A class is a general specification of attributes and behavior for a set of objects.  Each object is an instance of a class. It shares the behavior of the class, but has specific values for the attributes.  Thus, a class can be viewed as an abstract specification, while an object is a concrete instance of that specification.  An example of a class is Student, an abstract entity that has attributes and a set of behavior.  However, unless we have an actual student, we cannot say what the ID number is or what the major is.

5 What is a Class? (cont’d)  The following table shows further examples of classes and their instances: ClassesInstances of (or Objects) InstructorBashir Ghandi UniversityKFUPM CourseICS102 Bank AccountAhmad’s Bank Account  Identify the classes for the objects you identified in the exercise on Slide#3.

6 Constructing Objects from a Class  Our main task is to design and implement classes to be used in creating objects.  This involves defining the variables, methods and constructors.  To create an object from a class, we use the new operator, a constructor, and supply construction parameters (if any).  Example, we create an object from the Student class as follows: Student thisStudent = new Student(993546, “Suhaim Adil”, 3.5);  The relationship between the reference variable, thisStudent, and the object created is shown by the following figure:

7 Problem Solving in 00 languages  In the real world, problems are solved by interaction among objects.  If you have a problem with your car, you take it to a mechanic for repair.  Similarly, in 00 programming languages, problems are solved by interactions among objects. Objects interact by sending messages among themselves.   Messages are sent using reference variable dot method name.  To know the GPA of the student object we created, a message is sent as follows: double gpa = thisStudent.getGPA();  We have been sending messages to the System.out object in previous examples. System.out.println(“Salaaam Shabaab”);

8 Encapsulation  Having understood the main ingredients of OOP, we can now take a closer look at its main features.  One of the key features is the bringing together of data and operations - Encapsulation.  Encapsulation, also called information hiding, allows an object to have full control of its attributes and methods.  The following shows how an object encapsulates its attributes and methods.

9 Inheritance  Another powerful feature of OOP is inheritance.  Classes are organized in hierarchical structure. For example, the following shows a Student class and its related sub-classes:  The advantage is code-reusability. After implementing the Student class, to implement the GraduateStudent, we inherit the code of Student.

10 Strength of the OO Paradigm  We conclude this introduction to OOP by summarizing its main advantages: It allows the production of software which is easier to understand and maintain. It provides a clear mapping between objects of the problem domain (real world objects) and objects of the model. It supports code reuse and reduces redundancy. It allows "off the shelf” code libraries to be reused. It allows the production of reliable (secure) software.