Академический Документы
Профессиональный Документы
Культура Документы
Workshop Goals
This workshop will enable you to:
Learn object oriented concepts.
Learn the principle of object - oriented
programming.
Learn the application of object
- oriented ABAP.
Course Contents
Methods
Syntax and Visibility
Instance Methods and Static Methods
Constructor
Attributes
Syntax and Visibility
Instance Attributes and Static Attributes
Reference Variables
Creating References
Assigning References
Course Contents
Inheritance
Super classes and Subclasses
Visibility
Inheritance and the (Instance) Constructor
Parameters
Redefining Methods in OOABAP
Compatibility
Principles of the Narrowing Cast
Static and Dynamic Components
Final Classes and Methods
Course Contents
Polymorphism
Advantages Compared to Procedural Programming
Abstract Classes and Methods
Component Namespaces in Classes
Interfaces
Defining and Implementing an Interface
Working with Interface Components
Interface References
Narrowing Cast
Widening Cast
Using Several Interfaces
Polymorphism and Interfaces
Polymorphism and Inheritance
Compound Interfaces
Course Contents
Events
Define and Trigger Events
Handle Events
Register and deregister Events
Receive a reference from Sender
Object Oriented
Concepts
What are Objects ?
What Are Objects?
Real world
Model
House
Tree
Data
Method
Method
Method
Data
Method
Method
Method
Crane
Data
Method
Method
Method
Boat
Data
Method
Method
Method
SAP AG 1999
OOPS
Object Oriented Programming
Encapsulation
Inheritance
Polymorphism
Instantiation
Interfacing
Events
Advantages
Simplicity
Explicitness
Maintainability
Future Orientation
Classes
Classes are the central element of object-orientation.
A Class is an abstract description of an object.
Classes are templates for objects.
The attributes of objects are defined by the components of
the class, which describe the state and behavior of objects.
Classes
You define global classes and interfaces in the Class
Builder (Transaction SE24) in the ABAP Workbench.
They are stored centrally in class pools in the class library
in the R/3 Repository.
All of the ABAP programs in an R/3 System can access the
global classes.
Components in a class
Classes
Defining Local Classes
If you declare methods in the declaration part of a class, you must also write an
implementation part for it.
CLASS c1 IMPLEMENTATION.
.
ENDCLASS.
Attributes
Classes
Defining Local Classes
Methods
Methods : Syntax
Constructor
Constructor : Example
Creating Objects
Reference Variables
Assigning References
Inheritance
Inheritance allows you to derive a new class from an existing class.
You do this using the INHERITING FROM addition in the
CLASS <subclass> DEFINITION INHERITING FROM <superclass>
statement.
The new class <subclass> inherits all of the components of the existing
class <superclass>.
The new class is called the subclass of the class from which it is
derived.
The original class is called the superclass of the new class.
Inheritance
Inheritance :
Syntax
Inheritance and
Visibility
Redefining Methods :
Example
Polymorphism
Polymorphism
Polymorphism
Interface
Interface
Interface
Polymorphism and
Interface
Events
Objects or Classes use events to trigger Event Handler methods in
other objects or classes.
When an event is triggered any number of Event Handler Methods can
be called.
The events of a class can be raised in the same class using the RAISE
EVENT Statement.
Events have only output parameters which are accepted by the Event
Handler Methods as input parameters.
The link between the trigger and the handler is established dynamically
at runtime using the statement SET HANDLER.
Events Overview
Handling Events
Deregistration
Registration/Deregistration :
Handler Table