Objected Oriented Programming & Design JAVA Shishir Gupta (704) 947 2181 (704) 944 8864.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Classes & Objects Computer Science I Last updated 9/30/10.
ACM/JETT Workshop - August 4-5, :Inheritance and Interfaces.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 24: Dynamic Binding COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos.
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
Chapter 10 Classes Continued
C++ fundamentals.
OOP Languages: Java vs C++
Object Based Programming. Summary Slide  Instantiating An Object  Encapsulation  Inheritance  Polymorphism –Overriding Methods –Overloading vs. Overriding.
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
JAVA Introduction ● One of the main JAVA design goal is reducing complexity for programmer – Development time is half or less comparing to equivalent C++
1 Chapter 10: Data Abstraction and Object Orientation Aaron Bloomfield CS 415 Fall 2005.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
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.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Chapter 12 Support for Object oriented Programming.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Simple Classes. ADTs A specification for a real world data item –defines types and valid ranges –defines valid operations on the data. Specification is.
Learners Support Publications Object Oriented Programming.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
Inheritance. Inheritance - Introduction Idea behind is to create new classes that are built on existing classes – you reuse the methods and fields and.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Salman Marvasti Sharif University of Technology Winter 2015.
Object-Oriented Programming Chapter Chapter
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
Object Oriented Programming
ISBN Object-Oriented Programming Chapter Chapter
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Classes, Interfaces and Packages
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
1 Lecture 23: Dynamic Binding (Section ) CSCI 431 Programming Languages Fall 2002 A compilation of material developed by Felix Hernandez-Campos.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
CSCI-383 Object-Oriented Programming & Design Lecture 17.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
1 Welcome Alireza Humber College Lecture 1 Game 540 Alireza
ISBN Chapter 12 Support for Object-Oriented Programming.
Introduction to Objects Abstraction:The object-oriented approach Everything is an object. A program is a bunch of objects telling each other.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
OOP What is problem? Solution? OOP
Polymorphism.
Object Oriented Programming in Java
JAVA Introduction ការណែនាំពី Java
Week 4 Object-Oriented Programming (1): Inheritance
Object Oriented Analysis and Design
MSIS 670 Object-Oriented Software Engineering
Advanced Programming Behnam Hatami Fall 2017.
Support for Object-Oriented Programming
CISC/CMPE320 - Prof. McLeod
CPS120: Introduction to Computer Science
Object-Oriented Programming
Lecture 10 Concepts of Programming Languages
Presentation transcript:

Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)

AGENDA F Text F Setup for the class. F Quick Introduction. –Your Name –Your Job –Any Past Programming Experience F Information on the course. F Course Policies F Course Evaluation F Calendar (Tentative) F Introduction OOP & Java.

TEXT Thinking In Java Bruce Eckel

Setup F Create “temp” directory on the D: drive. F Copy all the files from the CD. F Install JDK & Forte. F Install JDK Documentation. F Install Examples from the Text.

Introduction F Your Name F Your Job F Any Past Programming Experience. F Your Expectations from this course. F Your Address

Course Policies F Honor Code F Attendance F Assignments F Class –Interactive/Responsive. –Make sure that you know everything that is said in the class before you leave. –Feel free to ask when in doubt. –There is no limit to asking questions.

Evaluation – Assignment (60%) F Grades will be awarded on assignments and the Final Project. F Assignments will be given at the beginning of the Week and will be based on the course to be covered that week. F The assignments will be due beginning the following week F Late Submission will not be accepted. F Assignments will be graded as follows: –100% : Program that compiles and runs correctly. – 80% : Program compiles but does not run correctly. – 60% : program that compiles but does not run. – 40% : Programs that do not compile.

Evaluation – Project (40%) F Should be a full fledged JAVA application. F The application should use the following programming features. –JDBC –SWING –CORBA or RMI F Groups may choose to implement the Work they had done in Software Engineering Class last Semester (Fall). F Maximum of 3 people per group. F The final presentation of the project should consist of the following: –10 minutes PowerPoint Presentation & demo of the application developed. –3 Minutes for answering questions after the presentation. –All members of the team must participate in the presentation and demonstration of the application. –The final submission of the project document should consist of a copy of your presentation and your application on a floppy diskette. F Extra credit will be given to groups who choose to implement their software using Rational Rose.

Calendar (Tentative)

Introduction to OOP Abstraction –Describe the solution in terms of the problem rather than the Computer on which where the solution runs. –Allows user to define his/her own data type and use them as they were a basic language type. This user defined type can be anything e.g. TABLE, CHAIRS etc. –Programmers define their own type and provide a full set of operation with each type. –Thinking in terms of types one wants, an object is just not data & functionality bundled together in any fashion, but it is tightly related to the idea of ADT: a user defined type. –Abstract data type work's the same way like built in types (CLASS). You can create a variable of this type and mani

Introduction to OOP Characteristics : –Everything is an Object. –A program is a bunch of objects telling each other what to do by sending messages. –Each object has its own memory made up of other objects. –Every Object has a Type. –All Objects of a particular type can receive the same messages.

Introduction to OOP Class –Definition of the object. –Class describes a set of objects that have identical characteristics and behavior. Object –Instantiation of the class.

Introduction to OOP Interface –Request you can make to a specific object. –There must be code to satisfy the request. Implementation –Interface with Hidden Data

Introduction to OOP The hidden Implementation F The access specifiers determine who can use the definition that follows. –PUBLIC –PRIVATE –PROTECTED F If not specified “FRIENDLY” (default) access is used.

Introduction to OOP Reusing the Implementation –Reuse a class as an object of another class. –Also called Aggregation or Composition. –Composition is also referred to as “HAS-A” relationship. –The member object of the new class is usually “private” which make them unavailable to outside classes. –Is generally a preferred choice over “Inheritance”

Introduction to OOP Inheritance –Cloning an existing Class and making modifications to the Clone. –Inheriting class inherits the functionality of the Parent. –The Inheriting class is of “Parent” Type. –Can take all the message the parent can take plus more. BASE DERIVED

Introduction to OOP Inheritance –When inherit from an existing type, you create a new type. –Duplicates the interface of the base class. –Messages that can be sent to the base class can also be sent to the derived class. –Derived Class is the same type as the base class (Circle is a Shape).

Introduction to OOP Inheritance (what to do with the derived class) –Add a brand new function to the derived class. –Change the existing behavior also known as overriding that function. –“Extends” keyword is used in Java to inherit from a existing base class.

Introduction to OOP Inheritance (IS-A vs LIKE-A Relationship) –If the Derived Class only overrides function of the base class. The derived class is exactly like the Base Class. Any message that can be sent to the derived class can also be sent to the Base class. –Adding new Interface elements to the derive class extends the interface and creates a new type. The new type can still substitute the base type, but the new functions are not accessible from the base type.

Introduction to OOP Polymorphism –Treat a Derived Type as a Base type. –Late Binding. There is no way to determine the address of the code until runtime. –The ability to extend a program easily by deriving new subtypes is important because it greatly improves design while reducing the cost of S/W Maintenance. –Upcasting.

Introduction to OOP (Concepts) Abstract Class and Interface F Provide only an interface for the derived class. F We do not want to create an object of the base class; only to upcast it so that the interface can be used. F Derived classes must implement methods that are abstract or they become abstract class themselves. F Interface does not provide any method definition at all. F Many Interface can be inherited together in Java.

Object Landscapes & Lifetime F Object Creation and Destruction. F Objects stored in Heap rather than on Stack. F Objects are created with “new” keyword. F Objects are destroyed using Garbage Collector.