SlideShare a Scribd company logo
Custom Classes CIS-166
Objects VB allows the creation of new object types by creating a class. Classes may have properties, methods, and events and describe  what’s possible . Objects are particular things such as an Add button, and describe  what is . Button is a class exitButton is an instance of the class. A class type may be used to create many objects (instances).
Cookie Analogy Class = Cookie cutter (what cookie will look like) Instantiate = Make a cookie using cookie cutter (use the  NEW  keyword) Instance = Newly made cookie (object) Properties of different Instances may have different values. One cookie may have icing, another not Each cookie can have a different flavor Methods = Eat, Bake, or Crumble Events = Cookie crumbling
Reusability Reusability is a major advantage of OOP over traditional programming New classes created can be used in multiple projects. Each object created from the class can have its own property values.
Object-Oriented Terminology  Encapsulation : Object is complete by itself  Inheritance : One class can serve as the starting point for a second class Polymorphism : One word/name may be used in different places, and operates correctly for its context
Encapsulation Combination of characteristics of an object along with its behavior in "one package" Cannot make object do anything it does not already "know" how to do. Cannot make up new properties, methods, or events for an object. Sometimes referred to as data hiding, an object can expose only those data elements and procedures that it wishes.
Inheritance Ability to create a new class from an existing class Original class is called Base Class, Superclass, or Parent Class. Inherited class is called Subclass, Derived Class, or Child Class. Example: each form created is inherited from the Form class and customized to current needs Purpose of inheritance is  reusability . 
Inheritance Example Can create a class that describes a person Firstname, Lastname, Birthday properties Can create a derived class that starts from person class and adds properties, methods of a student Major, Student ID Common phrasing: “IS A” “ A student  IS A  person” denotes student as derived class from person
Polymorphism Methods having identical names, but different implementations Radio button, check boxes, and list boxes all have a Select method—the Select method operates appropriately for its class. Messagebox has multiple ways to Show, depending on arguments
Polymorphism in Practice Overloading  — Several procedures have the same name with different argument lists Argument list creates a  signature Overriding  — Refers to a method that has the same name as its base class Method in subclass takes precedence, replaces the method from the parent class.
Instance Variables Instance variables or properties store data specific to one object Separate memory locations for the variables and procedures for each instance (copy) of the object
Shared Variables, Properties Single memory location that is available for ALL objects of a class Can be accessed without instantiating an object of the class Use the Shared keyword to create 
Constructors & Destructors Constructor : Method that automatically executes when an object is instantiated Create by writing a Public Sub New procedure Destructor : Method  that automatically executes when an object is destroyed Create by writing a Finalize procedure

More Related Content

PPTX
Is2215 lecture2 student(2)
PDF
Big data europe 2012 brochure (3)
PDF
Fitting Social Media Into Your Marketing May - Fort Wayne
PPT
Milieu
PPT
Milieu
PDF
Web Marketing 101 for Local Economic Development
PPT
Social media Stichting Zeldzame Huisdierrassen
PDF
BIME: Saca el mayor partido a las herramientas de promocion online
Is2215 lecture2 student(2)
Big data europe 2012 brochure (3)
Fitting Social Media Into Your Marketing May - Fort Wayne
Milieu
Milieu
Web Marketing 101 for Local Economic Development
Social media Stichting Zeldzame Huisdierrassen
BIME: Saca el mayor partido a las herramientas de promocion online

Similar to Coding Objects (20)

PPT
Chapter 12
PPTX
Ruby object model
ODP
(An Extended) Beginners Guide to Object Orientation in PHP
PDF
Object_oriented_programming_OOP_with_PHP.pdf
PPTX
Object oriented javascript
ODP
Beginners Guide to Object Orientation in PHP
PDF
oops-123991513147-phpapp02.pdf
PPTX
Computer programming 2 Lesson 3
DOCX
Question and answer Programming
PDF
Demystifying Object-Oriented Programming - PHP UK Conference 2017
PDF
Lect 1-java object-classes
PDF
Python Programming - Object-Oriented
PPTX
object oriented programming and methodology.pptx
PPTX
OOPs in Java
PPTX
c91632a4-2e92-4edf-b750-358da15ed1b1.pptx
PPTX
CSharp_03_Inheritance_introduction_with_examples
PPT
Introduction to OOP with PHP
PPTX
Pj01 x-classes and objects
Chapter 12
Ruby object model
(An Extended) Beginners Guide to Object Orientation in PHP
Object_oriented_programming_OOP_with_PHP.pdf
Object oriented javascript
Beginners Guide to Object Orientation in PHP
oops-123991513147-phpapp02.pdf
Computer programming 2 Lesson 3
Question and answer Programming
Demystifying Object-Oriented Programming - PHP UK Conference 2017
Lect 1-java object-classes
Python Programming - Object-Oriented
object oriented programming and methodology.pptx
OOPs in Java
c91632a4-2e92-4edf-b750-358da15ed1b1.pptx
CSharp_03_Inheritance_introduction_with_examples
Introduction to OOP with PHP
Pj01 x-classes and objects
Ad

More from Randy Riness @ South Puget Sound Community College (20)

Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PPTX
Cell Types and Its function , kingdom of life
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Lesson notes of climatology university.
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Cell Structure & Organelles in detailed.
Institutional Correction lecture only . . .
Cell Types and Its function , kingdom of life
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O7-L3 Supply Chain Operations - ICLT Program
TR - Agricultural Crops Production NC III.pdf
Classroom Observation Tools for Teachers
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Lesson notes of climatology university.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Final Presentation General Medicine 03-08-2024.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPH.pptx obstetrics and gynecology in nursing
Cell Structure & Organelles in detailed.

Coding Objects

  • 2. Objects VB allows the creation of new object types by creating a class. Classes may have properties, methods, and events and describe what’s possible . Objects are particular things such as an Add button, and describe what is . Button is a class exitButton is an instance of the class. A class type may be used to create many objects (instances).
  • 3. Cookie Analogy Class = Cookie cutter (what cookie will look like) Instantiate = Make a cookie using cookie cutter (use the NEW keyword) Instance = Newly made cookie (object) Properties of different Instances may have different values. One cookie may have icing, another not Each cookie can have a different flavor Methods = Eat, Bake, or Crumble Events = Cookie crumbling
  • 4. Reusability Reusability is a major advantage of OOP over traditional programming New classes created can be used in multiple projects. Each object created from the class can have its own property values.
  • 5. Object-Oriented Terminology Encapsulation : Object is complete by itself Inheritance : One class can serve as the starting point for a second class Polymorphism : One word/name may be used in different places, and operates correctly for its context
  • 6. Encapsulation Combination of characteristics of an object along with its behavior in "one package" Cannot make object do anything it does not already "know" how to do. Cannot make up new properties, methods, or events for an object. Sometimes referred to as data hiding, an object can expose only those data elements and procedures that it wishes.
  • 7. Inheritance Ability to create a new class from an existing class Original class is called Base Class, Superclass, or Parent Class. Inherited class is called Subclass, Derived Class, or Child Class. Example: each form created is inherited from the Form class and customized to current needs Purpose of inheritance is reusability . 
  • 8. Inheritance Example Can create a class that describes a person Firstname, Lastname, Birthday properties Can create a derived class that starts from person class and adds properties, methods of a student Major, Student ID Common phrasing: “IS A” “ A student IS A person” denotes student as derived class from person
  • 9. Polymorphism Methods having identical names, but different implementations Radio button, check boxes, and list boxes all have a Select method—the Select method operates appropriately for its class. Messagebox has multiple ways to Show, depending on arguments
  • 10. Polymorphism in Practice Overloading — Several procedures have the same name with different argument lists Argument list creates a signature Overriding — Refers to a method that has the same name as its base class Method in subclass takes precedence, replaces the method from the parent class.
  • 11. Instance Variables Instance variables or properties store data specific to one object Separate memory locations for the variables and procedures for each instance (copy) of the object
  • 12. Shared Variables, Properties Single memory location that is available for ALL objects of a class Can be accessed without instantiating an object of the class Use the Shared keyword to create 
  • 13. Constructors & Destructors Constructor : Method that automatically executes when an object is instantiated Create by writing a Public Sub New procedure Destructor : Method that automatically executes when an object is destroyed Create by writing a Finalize procedure

Editor's Notes

  • #3: 02/19/10 CIS-166 Classes and Objects