Object Oriented Programming Intermediate VB Doug Waterman Fox Valley Technical College.

Slides:



Advertisements
Similar presentations
When is Orientated Programming NOT? Mike Fitzpatrick.
Advertisements

4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
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.
Chapter 1 OO using C++. Abstract Data Types Before we begin we should know how to accomplish the goal of the program We should know all the input and.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
CS 211 Inheritance AAA.
12-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
ITEC200 – Week03 Inheritance and Class Hierarchies.
OOP-Creating Object-Oriented Programs
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 Chapter 12 More OOP, Interfaces, and Inner Classes.
OOP: Creating Object-Oriented Programs. VB & Object Oriented Programming Objects have properties, methods, and generate events Classes have been predefined.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
Object Oriented System Development with VB .NET
Basic OOP Concepts and Terms
Creating Object Oriented Programs Object oriented (OO) terminology Class vs. object Instantiate an object in a project Understand Class_Initialize / Terminate.
Object-oriented Programming Concepts
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
BACS 287 Basics of Object-Oriented Programming 1.
Object Based Programming. Summary Slide  Instantiating An Object  Encapsulation  Inheritance  Polymorphism –Overriding Methods –Overloading vs. Overriding.
What is Object-Oriented Programming?. Objects – Variables and Logic inside "Objects", not standalone code – Objects contain related variables and functions.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Design Patterns.
Overview of Previous Lesson(s) Over View  OOP  A class is a data type that you define to suit customized application requirements.  A class can be.
Chapter 4 Objects and Classes.
Microsoft Visual Basic 2005: Reloaded Second Edition
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.
Inheritance and Class Hierarchies Ellen Walker CPSC 201 Data Structures Hiram College.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Object Oriented Software Development
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
Design Model Lecture p6 T120B pavasario sem.
Relationships Relationships between objects and between classes.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
Chapter Object Oriented Programming (OOP) CSC1310 Fall 2009.
1.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction to Object Oriented Programming (OOP) Object Oriented programming is method of programming.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
© 2007 Lawrenceville Press Slide 1 Chapter 9 Inheritance  One class is an extension of another.  Allows a class to define a specialized type of an existing.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Object-Oriented Programming: Inheritance and Polymorphism.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Object-Oriented Programming: Classes and Objects.
Inheritance a subclass extends the functionality of a superclass a subclass inherits all the functionality of a superclass don't reinvent the wheel – "stand.
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-Oriented Modeling
The Movement To Objects
One class is an extension of another.
The Object-Oriented Thought Process Chapter 1
OOP What is problem? Solution? OOP
Table of Contents Class Objects.
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
One class is an extension of another.
Programming with Microsoft Visual Basic 2008 Fourth Edition
Object-Oriented Programming
Understand and Use Object Oriented Methods
Object-Oriented Programming: Classes and Objects
Object-Oriented Programming: Inheritance and Polymorphism
Basic OOP Concepts and Terms
Presentation transcript:

Object Oriented Programming Intermediate VB Doug Waterman Fox Valley Technical College

What is OOP 4 A way of programming based on the things (objects) involved. 4 It’s a way to solve problems.

What is an object? 4 An object is a high-level design item. –If you are an architect, you deal with the following objects working space foundation plumbing HVAC –The architect doesn’t think about how the concrete for the foundation will be poured. This would be a lower level design item.

What is an object in programming? 4 Objects are things. –People –companies –employees –time sheets –ledger entries –business requirements 4 An object refers to the specific thing.

Elements of an Object Oriented System 4 Abstraction 4 Encapsulation 4 Inheritance 4 Polymorphism

Abstraction 4 Abstraction is used to identify the objects involved with a particular application. 4 Allows you to focus on the objects of an application and not on the implementation. 4 It exposes the design of a system without involving the technological issues. 4 Allows the users to become key participants in the design process.

Abstraction Example Sees the tree as a place to perch. Sees the tree as a place to.. well you know! Sees the tree as a fun thing to climb.

Encapsulation 4 Building internal information (properties) and operating procedures (methods) into an object. 4 Internal information is held within the object. External procedures don’t know how a function performs. –Example: How does the cbo.Item.Add Method work for a ComboBox? –We don’t care!

Inheritance 4 There are two types of inheritance.  Interface Inheritance  What properties and methods will you expose to programs that use your class?  Implementation Inheritance  How will programs be able to access your class  Read Only  Read/Write

Polymorphism 4 Two or more classes can have the ability to have behaviors that are named the same, have the same basic purpose but different implementations. –Both an Instructor and a MicrosoftCEO object will have a “CalculatePay” behavior but the implementation (underlying code) can be very different.

What are Classes A class is a group of similar objects. –A cookie cutter would be an example of a class. –The cookies that are made using the cookie cutter are objects. –You eat the cookie (object) but not the cookie cutter (class). –Each cookie starts out exactly like every other cookie. You adjust the size, shape, frosting and topping that go on the cookie. This makes the object unique.

Where Do Properties, Fields and Methods Fit In? 4 An object has properties and methods. The list of properties and methods define the class interface. –A command button in the toolbox is an example of a class. –A command button you place on a form is an example of an object derived from a class. 4 Properties and Fields are the “nouns” of an object, they hold information. 4 Methods are the action items- the “verbs”.

Example Class Customer Class

Example Class: Define Data Elements Last Name First Name Address Phone Fax Web Site Customer Class

Example Class: Define Actions Last Name First Name Address Phone Fax Web Site Call View Send ActionComplete Customer Class

Example Class: Define Default Interface Last Name First Name Address Phone Fax Web Site Call View Send ActionComplete Customer Class Default Interface Incoming Outgoing

Example Class: Instantiate Object from Class Customer Object 1 Last Name First Name Address... Default Interface Incoming Outgoing Customer Object 2 Last Name First Name Address... Default Interface Incoming Outgoing m_Customer1 m_MyCustomer m_Customer2 You can have multiple pointers referencing the same object.

Example Class: Create a Collection of Objects Customer Object 1 Last Name First Name Address... Default Interface Incoming Outgoing Customer Object 2 Last Name First Name Address... Default Interface Incoming Outgoing m_Customer1 m_MyCustomer m_Customer2 You can have multiple pointers referencing the same object. m_ colCustomers

Class Hierarchy Employee InstructorIntern Class Subclass The Intern is a subclass of Employee and inherits all of the behaviors and properties of Employee.

Objects as Containers Objects can be composed of other objects. Employees Intern AlbertIntern BobIntern SueIntern Ann 1/8/99 Timesheet 1/15/99 Timesheet 1/22/99 Timesheet 1/29/99 Timesheet  Collection of Employee  Collection of Timesheet

Terminology 4 Class - a unit of source code with one or many interfaces. Some of these interfaces may be specified as public for external use. 4 Object - a run-time instantiation of a class that is packaged within a component. 4 Properties - data that the class maintains internally. These may be visible for external use (either setting or viewing) or private for use inside the class.

Terminology 4 Fields – Similar to properties – but you can’t control how the user accesses the data. 4 Methods - The actions that are defined for an object. The default events that are part of a VB object are New and Finalize. New is run when an object is instantiated from the base class. Finalize is run prior to releasing the objects memory back to the system.

Terminology 4 Event - A message, broadcast from within an object. 4 Interface - The list of properties and methods available for external use. An object may have more than one interface. 4 Collection - A set of pointers to related objects.