SlideShare a Scribd company logo
Buliding Object-Oriented Applications in PowerBuilder  Module 2: Objects And Classes
Objectives Define Object and Classes Use Edit Source (system tree) / Export Syntax (Iibrary painter) to view the definition of classes Add Properties and Methods to a class
Topics:  Objects and Classes Definitions Defining Classes Viewing Class Definitions What Can Be Added to a Class Adding Properties to a Class Adding Methods to a Class
Objects — Definition An object is represented by its: Properties:  Visible, color, height Property values (data):  George, red, 5'8" Methods (behaviors):  Pitches a baseball, eats anchovy pizza
Classes — Definition A class defines a set of objects Each object is an instance of its class Class  Definition Object Instance
Defining Classes Done in Painters Window Menu User-Object Application Based on Inheritance
New Objects Created Through Inheritance
Defining Classes Stored in PBLs, PBDs, DLLs, and EXEs
Syntax — Window Subclass of window class Class properties changed
Defining Classes User-defined classes of applications, menus, user objects, and windows can:  Have new properties (instance variables) Have new methods (events, object functions, and local external functions)
Adding Properties — Instance Variables
Methods of a Class Methods are object behaviors Represented by scripts associated with: Events Functions
System Methods Mapped to specific event ids. You cannot add / change arguments Show/Hide Prototype Cannot Modify Arguments
Adding Methods — Events An event is a notification that an action has occurred System events are operating system or PowerBuilder events Examples:  Clicked, Open, Constructor, RButtonDown, RetrieveStart, DBError User-defined events can be: Added to windows, user objects, and window controls Mapped to system events or unmapped
User-Defined Events
Mapped Events Predefined events Dependent on operating system ue_downkey ---> pbm_dwnkey Arguments and return data type are predefined
Unmapped Events An unmapped event: Is independent of system and PowerBuilder events Is invoked via scripts only Supports user-defined arguments and a user-specified return data type
User-Defined Events Mapped or Unmapped  Events Determined
Adding Methods — Functions Built-in functions: System (Global) functions Class functions User-defined functions: Object functions External functions
Adding Methods — Object Functions Functions defined for a class are methods A function definition consists of: Name Return data type (optional) Arguments and their data types (optional) Script (optional) Access privilege Can be defined for Application, Menu, Window, and UserObject classes
Adding Functions
Adding Functions
Adding Methods — External Functions Reside in DLLs or EXEs Created outside of PowerBuilder (for example, using C++) Must be declared to PowerBuilder Can be called as any other function Can be global or local Can be defined at the object level for menus, user objects, and windows
Adding Methods — External Functions
Summary Events Yes (v8) Yes (v8) Yes Yes Yes Class Application Menu UserObject Window Window control Instance  Variables Yes Yes Yes Yes No Object  Function Yes Yes Yes Yes No External  Function No Yes Yes Yes No
Summary A class has a name, properties, and methods.  A class is the definition of a set of objects.  An object is an instance of a class. The four main PowerBuilder painters are:  Application, Menu, User Object, and Window. PowerBuilder class definitions are stored in libraries: PBLs for development PBDs, DLLs and EXEs for an executable
Summary Questions
Lab Setup What you will need to do the lab: Set the application search path Connect to the Database Add properties to a class as instance variables  Add function methods to a class Preview a window
Lab Debriefing Created two instance variables: is_action and il_key
Lab Debriefing Created two methods to set properties
Lab Debriefing Created two methods to get properties
Lab Debriefing But we have not fully encapsulated these properties. (more in later chapters) Can you access these properties using direct access? Should you?  But can you? What are some disadvantages of  not fully encapsulating these?

More Related Content

Similar to Booa8 Slide 02

BIS08 Application Development - II
BIS08 Application Development - IIBIS08 Application Development - II
BIS08 Application Development - II
Prithwis Mukerjee
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
Jalpesh Vasa
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
 
WPF - Controls & Data
WPF - Controls & DataWPF - Controls & Data
WPF - Controls & Data
Sharada Gururaj
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
vamshimahi
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
Azhar Satti
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
cesarmendez78
 
(An Extended) Beginners Guide to Object Orientation in PHP
(An Extended) Beginners Guide to Object Orientation in PHP(An Extended) Beginners Guide to Object Orientation in PHP
(An Extended) Beginners Guide to Object Orientation in PHP
Rick Ogden
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
Synapseindiappsdevelopment
 
Software Design Document
Software Design DocumentSoftware Design Document
Software Design Document
Nadia Nahar
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
Greg Sohl
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptx
rani marri
 
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPBeginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
Rick Ogden
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
Akhil Mittal
 
Ibm cognos-build-data-marts-reports-and-dashboards
Ibm cognos-build-data-marts-reports-and-dashboardsIbm cognos-build-data-marts-reports-and-dashboards
Ibm cognos-build-data-marts-reports-and-dashboards
Amit Sharma
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
dplunkett
 
Qtp Training
Qtp TrainingQtp Training
Django
DjangoDjango
M03_1_Structur alDiagrams.ppt
M03_1_Structur                         alDiagrams.pptM03_1_Structur                         alDiagrams.ppt
M03_1_Structur alDiagrams.ppt
nesarahmad37
 

Similar to Booa8 Slide 02 (20)

BIS08 Application Development - II
BIS08 Application Development - IIBIS08 Application Development - II
BIS08 Application Development - II
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
WPF - Controls & Data
WPF - Controls & DataWPF - Controls & Data
WPF - Controls & Data
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Cognos Software Development Kit
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
 
(An Extended) Beginners Guide to Object Orientation in PHP
(An Extended) Beginners Guide to Object Orientation in PHP(An Extended) Beginners Guide to Object Orientation in PHP
(An Extended) Beginners Guide to Object Orientation in PHP
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
 
Software Design Document
Software Design DocumentSoftware Design Document
Software Design Document
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptx
 
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPBeginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
Ibm cognos-build-data-marts-reports-and-dashboards
Ibm cognos-build-data-marts-reports-and-dashboardsIbm cognos-build-data-marts-reports-and-dashboards
Ibm cognos-build-data-marts-reports-and-dashboards
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
Qtp Training
Qtp TrainingQtp Training
Qtp Training
 
Django
DjangoDjango
Django
 
M03_1_Structur alDiagrams.ppt
M03_1_Structur                         alDiagrams.pptM03_1_Structur                         alDiagrams.ppt
M03_1_Structur alDiagrams.ppt
 

More from oswchavez

Html Y Javascript
Html Y JavascriptHtml Y Javascript
Html Y Javascript
oswchavez
 
Booa8 Slide 12
Booa8 Slide 12Booa8 Slide 12
Booa8 Slide 12
oswchavez
 
Asp .Net Parte 1
Asp .Net Parte 1Asp .Net Parte 1
Asp .Net Parte 1
oswchavez
 
Html Y Javascript
Html Y JavascriptHtml Y Javascript
Html Y Javascript
oswchavez
 
Booa8 Slide 11
Booa8 Slide 11Booa8 Slide 11
Booa8 Slide 11
oswchavez
 
Booa8 Slide 03
Booa8 Slide 03Booa8 Slide 03
Booa8 Slide 03
oswchavez
 
Pb11 002 1 Metodologia
Pb11 002 1 MetodologiaPb11 002 1 Metodologia
Pb11 002 1 Metodologia
oswchavez
 
Pb11 002 0 Problematica
Pb11 002 0 ProblematicaPb11 002 0 Problematica
Pb11 002 0 Problematica
oswchavez
 
Pb11 003 Overview
Pb11 003 OverviewPb11 003 Overview
Pb11 003 Overview
oswchavez
 
P B11 001 Intro
P B11 001  IntroP B11 001  Intro
P B11 001 Intro
oswchavez
 
Pb110021 Metodologia
Pb110021 MetodologiaPb110021 Metodologia
Pb110021 Metodologia
oswchavez
 
Pb11002 Problematica
Pb11002 ProblematicaPb11002 Problematica
Pb11002 Problematica
oswchavez
 
IntroduccióN A Visual C
IntroduccióN A  Visual  CIntroduccióN A  Visual  C
IntroduccióN A Visual C
oswchavez
 
Net Windows Developer Parte 1
Net  Windows  Developer  Parte 1Net  Windows  Developer  Parte 1
Net Windows Developer Parte 1
oswchavez
 
Clase01 Generalidades De Las Estructuras
Clase01   Generalidades De Las EstructurasClase01   Generalidades De Las Estructuras
Clase01 Generalidades De Las Estructuras
oswchavez
 
Microsoft Ado
Microsoft AdoMicrosoft Ado
Microsoft Ado
oswchavez
 
IntroduccióN A Sql Server 2005
IntroduccióN A Sql Server 2005IntroduccióN A Sql Server 2005
IntroduccióN A Sql Server 2005
oswchavez
 
IntroduccióN A Visual C
IntroduccióN A Visual CIntroduccióN A Visual C
IntroduccióN A Visual C
oswchavez
 
Net Windows Developer Part 1
Net  Windows  Developer    Part 1Net  Windows  Developer    Part 1
Net Windows Developer Part 1
oswchavez
 
Expo Adrenalinux
Expo AdrenalinuxExpo Adrenalinux
Expo Adrenalinux
oswchavez
 

More from oswchavez (20)

Html Y Javascript
Html Y JavascriptHtml Y Javascript
Html Y Javascript
 
Booa8 Slide 12
Booa8 Slide 12Booa8 Slide 12
Booa8 Slide 12
 
Asp .Net Parte 1
Asp .Net Parte 1Asp .Net Parte 1
Asp .Net Parte 1
 
Html Y Javascript
Html Y JavascriptHtml Y Javascript
Html Y Javascript
 
Booa8 Slide 11
Booa8 Slide 11Booa8 Slide 11
Booa8 Slide 11
 
Booa8 Slide 03
Booa8 Slide 03Booa8 Slide 03
Booa8 Slide 03
 
Pb11 002 1 Metodologia
Pb11 002 1 MetodologiaPb11 002 1 Metodologia
Pb11 002 1 Metodologia
 
Pb11 002 0 Problematica
Pb11 002 0 ProblematicaPb11 002 0 Problematica
Pb11 002 0 Problematica
 
Pb11 003 Overview
Pb11 003 OverviewPb11 003 Overview
Pb11 003 Overview
 
P B11 001 Intro
P B11 001  IntroP B11 001  Intro
P B11 001 Intro
 
Pb110021 Metodologia
Pb110021 MetodologiaPb110021 Metodologia
Pb110021 Metodologia
 
Pb11002 Problematica
Pb11002 ProblematicaPb11002 Problematica
Pb11002 Problematica
 
IntroduccióN A Visual C
IntroduccióN A  Visual  CIntroduccióN A  Visual  C
IntroduccióN A Visual C
 
Net Windows Developer Parte 1
Net  Windows  Developer  Parte 1Net  Windows  Developer  Parte 1
Net Windows Developer Parte 1
 
Clase01 Generalidades De Las Estructuras
Clase01   Generalidades De Las EstructurasClase01   Generalidades De Las Estructuras
Clase01 Generalidades De Las Estructuras
 
Microsoft Ado
Microsoft AdoMicrosoft Ado
Microsoft Ado
 
IntroduccióN A Sql Server 2005
IntroduccióN A Sql Server 2005IntroduccióN A Sql Server 2005
IntroduccióN A Sql Server 2005
 
IntroduccióN A Visual C
IntroduccióN A Visual CIntroduccióN A Visual C
IntroduccióN A Visual C
 
Net Windows Developer Part 1
Net  Windows  Developer    Part 1Net  Windows  Developer    Part 1
Net Windows Developer Part 1
 
Expo Adrenalinux
Expo AdrenalinuxExpo Adrenalinux
Expo Adrenalinux
 

Booa8 Slide 02

  • 1. Buliding Object-Oriented Applications in PowerBuilder Module 2: Objects And Classes
  • 2. Objectives Define Object and Classes Use Edit Source (system tree) / Export Syntax (Iibrary painter) to view the definition of classes Add Properties and Methods to a class
  • 3. Topics: Objects and Classes Definitions Defining Classes Viewing Class Definitions What Can Be Added to a Class Adding Properties to a Class Adding Methods to a Class
  • 4. Objects — Definition An object is represented by its: Properties: Visible, color, height Property values (data): George, red, 5'8" Methods (behaviors): Pitches a baseball, eats anchovy pizza
  • 5. Classes — Definition A class defines a set of objects Each object is an instance of its class Class Definition Object Instance
  • 6. Defining Classes Done in Painters Window Menu User-Object Application Based on Inheritance
  • 7. New Objects Created Through Inheritance
  • 8. Defining Classes Stored in PBLs, PBDs, DLLs, and EXEs
  • 9. Syntax — Window Subclass of window class Class properties changed
  • 10. Defining Classes User-defined classes of applications, menus, user objects, and windows can: Have new properties (instance variables) Have new methods (events, object functions, and local external functions)
  • 11. Adding Properties — Instance Variables
  • 12. Methods of a Class Methods are object behaviors Represented by scripts associated with: Events Functions
  • 13. System Methods Mapped to specific event ids. You cannot add / change arguments Show/Hide Prototype Cannot Modify Arguments
  • 14. Adding Methods — Events An event is a notification that an action has occurred System events are operating system or PowerBuilder events Examples: Clicked, Open, Constructor, RButtonDown, RetrieveStart, DBError User-defined events can be: Added to windows, user objects, and window controls Mapped to system events or unmapped
  • 16. Mapped Events Predefined events Dependent on operating system ue_downkey ---> pbm_dwnkey Arguments and return data type are predefined
  • 17. Unmapped Events An unmapped event: Is independent of system and PowerBuilder events Is invoked via scripts only Supports user-defined arguments and a user-specified return data type
  • 18. User-Defined Events Mapped or Unmapped Events Determined
  • 19. Adding Methods — Functions Built-in functions: System (Global) functions Class functions User-defined functions: Object functions External functions
  • 20. Adding Methods — Object Functions Functions defined for a class are methods A function definition consists of: Name Return data type (optional) Arguments and their data types (optional) Script (optional) Access privilege Can be defined for Application, Menu, Window, and UserObject classes
  • 23. Adding Methods — External Functions Reside in DLLs or EXEs Created outside of PowerBuilder (for example, using C++) Must be declared to PowerBuilder Can be called as any other function Can be global or local Can be defined at the object level for menus, user objects, and windows
  • 24. Adding Methods — External Functions
  • 25. Summary Events Yes (v8) Yes (v8) Yes Yes Yes Class Application Menu UserObject Window Window control Instance Variables Yes Yes Yes Yes No Object Function Yes Yes Yes Yes No External Function No Yes Yes Yes No
  • 26. Summary A class has a name, properties, and methods. A class is the definition of a set of objects. An object is an instance of a class. The four main PowerBuilder painters are: Application, Menu, User Object, and Window. PowerBuilder class definitions are stored in libraries: PBLs for development PBDs, DLLs and EXEs for an executable
  • 28. Lab Setup What you will need to do the lab: Set the application search path Connect to the Database Add properties to a class as instance variables Add function methods to a class Preview a window
  • 29. Lab Debriefing Created two instance variables: is_action and il_key
  • 30. Lab Debriefing Created two methods to set properties
  • 31. Lab Debriefing Created two methods to get properties
  • 32. Lab Debriefing But we have not fully encapsulated these properties. (more in later chapters) Can you access these properties using direct access? Should you? But can you? What are some disadvantages of not fully encapsulating these?