IS437: Fall 2004 Instructor: Dr. Boris Jukic Object Oriented Programming.

Slides:



Advertisements
Similar presentations
Module 8 “Polymorphism and Inheritance”. Outline Understanding Inheritance Inheritance Diagrams Constructors in Derived Classes Type Compatibility Polymorphism.
Advertisements

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.
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
12-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
More about classes and objects Classes in Visual Basic.NET.
Introduction To System Analysis and Design
Programming Language Paradigms: summary. Object-oriented programming Objects are the fundamental building blocks of a program. Interaction is structured.
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
Object Oriented System Development with VB .NET
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
Advanced Object-Oriented Programming Features
Object-Oriented Databases
Chapter 13: Object-Oriented Programming
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.
Introduction To System Analysis and design
Object Oriented Software Development
A First Program Using C#
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Introduction to Object-oriented programming and software development Lecture 1.
BCS 2143 Introduction to Object Oriented and Software Development.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Module 7: Object-Oriented Programming in Visual Basic .NET
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Introduction to Objects Adapted from “TEN STEPS TO OBJECT-SPEAK” a CPT Tech Talk by Joy Starks September 17, 1999.
Chapter 9: Getting Comfortable with Object- Oriented Programming.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Object-Oriented Design CSC 212. Announcements This course is speeding up and we are starting new material. Please see me if you feel this is going too.
Object-Oriented Design Justin Callanan CS 597. Object-Oriented Basics ● Data is stored and processed in “objects” ● Objects represent generalized real.
Chapter 12 Support for Object oriented Programming.
Peyman Dodangeh Sharif University of Technology Fall 2014.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
CSCI 3327 Visual Basic Chapter 3: Classes and Objects UTPA – Fall 2011.
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Salman Marvasti Sharif University of Technology Winter 2015.
Object-Oriented Programming Chapter Chapter
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
OO in Context Lecture 13: Dolores Zage. Confused about OO Not alone, there is much confusion about OO many programs are claimed to be OO but are not really.
Object-Oriented Principals Dwight Deugo Nesa Matic
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
ISBN Chapter 12 Support for Object-Oriented Programming.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
Introduction to Object-oriented Programming
Advanced Programming in Java
Modern Programming Tools And Techniques-I
Object Oriented Concepts -II
Types of Programming Languages
Advanced Programming Behnam Hatami Fall 2017.
Inheritance Inheritance is a fundamental Object Oriented concept
Programming Paradigms
CPS120: Introduction to Computer Science
Presentation transcript:

IS437: Fall 2004 Instructor: Dr. Boris Jukic Object Oriented Programming

Learning Objectives Object-oriented concepts Implementation of object-oriented concepts in Visual Basic.Net

Limitations Of Conventional Languages o Small Vocabulary o Highly Procedural o Logic Buried In Long Lines Of Code o Difficult To Re-Use Code o Costly To Build And Modify o Allow Only Simple Data Structures

Object-Oriented Approach PROGRAMMING LANGUAGES : SMALLTALK, C++, Java, Visual Basic.Net

To Achieve Greater Semantic Expressiveness - Complex Structure - A Variety Of Relationships - Natural Representation To Reduce Use of Procedural Blocks of Code To Enhance Re-Usability Goals

Objects Correspond to Real World Constructs studentuniversity cashier carATM radio sales report ….

Object Encapsulation Class Class Hierarchy And Inheritance Message And Polymorphism Key OO Concepts

Everything Is Modeled As Object: Millie Buddy Snoopy Dog Cashier A Tax Return Each Object Has A Name (External Identifier) An Object Has Two Components : - Properties (To Store Information) Can Take On Complex Structure : E.G. : Widget_A (Acquisition_Date, Quantity On Hand) (( 3/10/92 $100) ( 3/20/92 $150) ( 3/25/92 $200)) - Methods (Behavior Encapsulation) Object & Encapsulation

Record structure in COBOL John Smith Swimming Mary Scott Bridge Bill Shoemaker Dancing John Smith Painting Name Social Security # Hobby Records have no common external identifiers. Attributes are single-valued.

DOG Class Example DOG(COLOR, SPEED) MILLEPUPPY SNOOPY instance-of relationship

Class Hierarchy Example ANIMAL BIRDDOG FISH POLLY MILLIEMOBY IS-A-Kind of relationship GENERALIZATION-SPECIALIZATION RELATIONSHIP instance-of relationship

STUDENT UNDER- GRADUATE STUDENT MBA STUDENT PH.D. STUDENT IS-A-Kind of relationship Class Hierarchy: Another Example

Inheritance ANIMAL BIRD DOG FISH POLLY MILLIE MOBY (COLOR, SPEED) (Beak, Fly) (Bark, Ears)

Polymorphism Ability to take on many shapes and forms Many classes can provide the same property or method, without having to worry what type of class it is: Dog class (eat() method) Mosquito class (eat() method)  Of course, same method would be implemented in a very different way Same class can have multiple versions of the method  Overloaded methods

- Greater Semantic Expressiveness Can Represent Is_A Relationships Support Complex Data Structure - Behavior Encapsulation Facilitates The Modeling Of Real-World Objects - Object Library (Re-Use) - Reduce Procedurality Through An Enlarged Vocabulary Benefits Of OO Approach:

Difficulties Different Programming Paradigm  Resistance, Requires a shift in thinking) Increased Complexity:  Takes time to become acquainted with the library of objects

Implementation of OO in Visual Basic.Net Object Encapsulation (property and method) Classes: over 6,000 in number Class hierarchy and inheritance Polymorphism Visual Basic.Net supports all of the key OO concepts. It is a full-fledged OO system.

Textbox TextBox1 instance-of relationship class object Object, Class, Encapsulation in VB.Net New keyword: creates a new instance of an object class

New Method in VB.Net Also called constructor It is the method that classes use to instantiating objects. Dim label1 as Label Label1 = New Label Dim label1 as New Label or

Add a control to a form Me.controls.add(label1) Collections of controls on a form Add to the collection The control to be added Represents this form

A Simplified View of Class Hierarchy in VB.Net Object Component ControlData Adapter Label DateTimePicker PictureBox IS-A-Kind of relationship

Polymorphism in VB.Net Functionally equivalent methods can have the same name VB.Net implements polymorphism in various ways: - overloading - overriding - method hiding

Polymorphism in VB.Net: Overloading Messagebox.Show(“Enter numeric data.”) Messagebox.Show(“Enter numeric data.”, “Data entry error”) Messagebox.Show(“This is a message.”, “This is a title bar”, MessageBoxButtons.OK) … Overloading: methods sharing the same name, for the same object, but with different signatures (argument lists)

MessageBox General Form Messagebox.Show(TextMessage) Messagebox.Show(TextMessage, TitlebarText) Messagebox.Show(TextMessage, TitlebarText, MessageBoxButtons) Messagebox.Show(TextMessage, TitlebarText, MessageBoxButtons, MessageBoxIcons)

Polymorphism in VB.Net: Overriding Animal Dog Snoopy Talk method:“I cannot talk” Talk method: “Bark Bark” Snoopy.Talk “Bark Bark” Parent class and child class may have methods with the same name. The method in child class can override the method in parent class.

Polymorphism: method hiding Button1.Click CustomerForm.Click Checkbox1.Click …

Namespaces Namespaces are file cabinets for classes, similar to the concept of folders. Namespaces can contain classes, other namespaces, etc. Namespaces help organize the vast number of classes into a neat structure. To make use of a class, we need to reference or import the namespace that contains the class.

Namespace Hierarchy System namespace System Windows.Forms namespace System.Windows.Forms Button Label TextBox Data namespace System.Data Drawing namespace System.Drawing OleDb namespace System.Data.OleDb OleDb provides interaction with MS Access.