Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007.

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

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Classes & Objects Computer Science I Last updated 9/30/10.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
1 CIS601: Object-Oriented Programming in C++ Note: CIS 601 notes were originally developed by H. Zhu for NJIT DL Program. The notes were subsequently revised.
Object-Oriented Analysis and Design
CS-2135 Object Oriented Programming
Introduction To System Analysis and Design
OOP & JAVA. HelloWorld.java /** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */ public class HelloWorld.
Object Oriented System Development with VB .NET
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Object-Oriented Thinking Chapter 1, Object-Oriented Programming in Java, Timothy Budd, 1998 ICS102 Semester
Stéphane Ducasse6.1 Essential Concepts Why OO? What is OO? What are the benefits? What are the KEY concepts? Basis for all the lectures.
Object-oriented Programming Concepts
Software Lifecycle A series of steps through which a software product progresses Lifetimes vary from days to months to years Consists of –people –overall.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
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.
Object Oriented Programming
Introduction To System Analysis and design
Introduction to Object-oriented programming and software development Lecture 1.
BCS 2143 Introduction to Object Oriented and Software Development.
Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing.
An Object-Oriented Approach to Programming Logic and Design
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
Introduction To System Analysis and Design
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Kal Bugrara, Ph.DSoftware Engineering Northeastern University Fundamentals Of Software Engineering Lecture V.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Learners Support Publications Object Oriented Programming.
Abstraction ADTs, Information Hiding and Encapsulation.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
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. Objectives Distinguish between object-oriented and procedure-oriented design. Define the terms class and object. Distinguish.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
S.Ducasse Stéphane Ducasse 1 Essential OO Concepts Stéphane Ducasse.
1 Software Engineering Lecture 15 Object Oriented Software Design in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CSCE 240 – Intro to Software Engineering Lecture 3.
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.
Object-Orientated Programming
Object Oriented Programming
JAVA By Waqas.
The Movement To Objects
OOP What is problem? Solution? OOP
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Advanced Programming Behnam Hatami Fall 2017.
Need for the subject.
Workshop for Programming And Systems Management Teachers
What Is Good Software(Program)?
Object-Oriented Programming
Presentation transcript:

Object-Oriented Programming with Java Lecture 1: Introduction Autumn, 2007

Challenges of Software Development Complexity: Complexity: Longevity and Evolution Longevity and Evolution High User Expectations High User Expectations

1) Complexity The software systems are very large and complex. Complexity is dictated by the problems the systems are intended to solve and the services they are intended to provide. No individual can comprehend every detail of the system. The system must be broken down into manageable parts. The cooperative efforts are required. Methodologies, techniques, and tools that work well for small systems developed by individuals are not effective for large systems developed by teams.

2) Longevity and Evolution Because of economic, political, and other constraints, software systems are often in service for very long periods of time. During their lifetimes, software must constantly evolve to accommodate changes in users’ needs and environments. Making changes to software systems is a difficult task. Furthermore, maintenance not only is costly and time- consuming, but also usually degrades the quality of the system being maintained. far The maintenance cost of the software system over its lifetime is far greater than its initial development cost.

3) High User Expectations In the past: Computers were mainly used in universities, research institutions, and large corporations. The majority of software systems users were engineers and scientists, who had the technical skills to handle the glitches they might encounter while using the system. Today: Computers are used in homes, schools, and business of all sizes, and are used for pleasure as well as for work. Majority of software users are nontechnical, ordinary people. Computer software products are considered as consumer products. The products are expected to perform as household appliance. Software systems are expected to be “bug-free”, but such perfection is next to impossible.

Challenges of Software Development The challenges faced by software development are: to find effective solution to control complexities of software systems; to manage the longevity and evolution of software systems; to deliver software systems with higher reliability and usability.

Two Paradigms of Programming F Program = Code + Data Program can be organized around Data or around Code F Two paradigms of programming: 1) Process-oriented model: around Code (acting on data) Program is defined by sequence of codes Data structures + Algorithms = Program Problem complexity: <25, lines of code 2) Object-oriented model: around Data (Objects) Objects + Messages = Program Data-controlling access to code

OOP five rules of Alan Kay F Everything is an object. messages F A program is a bunch of objects telling each other what to do by sending messages. F Each object has its own memory made up of other objects. F Every object has a type (class). F All objects of a particular type (class) can receive the same messages.

Class F A class defines the abstract characteristics of a thing (object), including the thing's characteristics (its attributes) and the thing's behaviors (the things it can do or methods).  For example, the class Dog would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark (behavior). F Classes provide modularity and strcture in an object-oriented program.

Objects problem space F OOP model is to work in the problem space F Objects can be described in terms of: –Their attributes; –Their behaviors F Object’s attributes and behaviors are encapsulated together a data type (class). F Objects are independent entities. F Objects respond to messages.

Message passing F Message passing is the process by which an object sends data to another object or asks the other object to invoke a method. F Also known to some programming languages as interfacing.

Objects Interfaces F An object has to have an interface. F The interface will –Provide a way to let other objects to communicate with it. –Hide the details of the object implementation. F An example: Light bulb and Car. On()Off()Brighten()Dim() Light

Class Dog and Object Lassie F Object is a particular instance of a class.  The class of Dog defines all possible dogs by listing the characteristics (data, states) and behaviors (methods) they can have.  The object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur, Lassie has brown-and-white fur.  In programmer jargon, the object Lassie is an instance of the Dog class.

Methods  An object's abilities. Lassie, being a Dog, has the ability to bark. So bark() is one of Lassie 's methods. She may have other methods as well, for example sit() or eat().  Within the program, using a method should only affect one particular object; all Dogs can bark, but you need one particular dog, Lassie, to do the barking.

Three Principles of OOP (PIE) F Encapsulation F Inheritance F Polymorphism

1) Encapsulation principle F Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. F Binding data and functionality (methods) together produces self contained units which are more maintainable, reusable and deployable. F Implementation hiding: encapsulation is as a protective wrapper that prevents data from being arbitrarily accessed by other code defined outside the wrapper. data operations (methods) class F The collective term for data and operations (methods) bundled together with access restrictions is a class.

1) Encapsulation principle F For a programming unit to be truly effective, the barrier between interface and implementation must be absolute. F Breaks up the playing field into: u Class creators (those who create new data types) u Client programmers (those who use these types for their own tasks. They only deal with the interfaces.) u The goal of the class creator is to build a class that exposes only what’s necessary to the client programmer and keeps everything else hidden. F Two reasons for controlling the access: * To keep client programmers’ hands off portions they shouldn’t touch. * To allow the library designer to change the internal workings of the class without worrying about how it will affect the client programmer.

2) Inheritance principle F Inheritance involves building upon an existing class so that additional or more-specialised functionality is added. F Subclasses are more specialized versions of a class, which inherit attributes and behaviors from their superclasses, and can introduce their own. F Inheritance should be used to capture hierarchical relationships integral to the problem being modelled.

2) Inheritance principle F Object-oriented programming languages permit you to base a new class definition on a class already defined. F The base class is called a superclass; the new class is its subclass. F The subclass definition specifies only how it differs from the superclass; everything else is taken to be the same. F Nothing is copied from superclass to subclass. Instead, the two classes are connected so that the subclass inherits all the methods and instance variables of its superclass.

3) Inheritance principle  For example, the class Dog might have sub-classes called Collie, Chihuahua, and GoldenRetriever. In this case, Lassie would be an instance of the Collie subclass.  Suppose the Dog class defines a method called bark() and a property called furColor. Each of its sub-classes (Collie, Chihuahua, and GoldenRetriever ) will inherit these members, the programmer only needs to write the code for them once. is-a  In fact, inheritance is an "is-a" relationship: Lassie is a Collie. A Collie is a Dog. Thus, Lassie inherits the members of both Collies and Dogs.

3) Polymorphism principle F The word originates from the Greek language, and means ‘many shapes’. one name F Within object oriented languages it is used to denote one name referring to several different methods F Polymorphism allows you to make the derived types behave differently from their base type. Bird Move() Goose Move() Penguin Move()

3) Polymorphism principle F This ability of different objects to respond, each in its own way, to identical messages is called polymorphism. F The main benefit of polymorphism is that it simplifies the programming interface. It permits conventions to be established that can be reused in class after class. F Instead of inventing a new name for each new function you add to a program, the same names can be reused. The programming interface can be described as a set of abstract behaviors, quite apart from the classes that implement them, receive messages from them, and perhaps make the different objects composing the class interact with each other.