11-29-2007 8:35 AM
11-29-2007 8:40 AM
HI
<b>Instance</b>Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. <b>Each instance (object)</b> of a class has a unique identity and its own set of values for its attributes.
<b>Interface</b>Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.
Interfaces only describe the external point of contact of a class (protocols), they do not contain any implementation.
Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task.
The user never actually knows the providers of these services, but communicates with them through the interface.
In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required. This is known as polymorphism with interfaces.
<b>Reward if useful</b>
11-29-2007 8:40 AM
HI
<b>Instance</b>Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. <b>Each instance (object)</b> of a class has a unique identity and its own set of values for its attributes.
<b>Interface</b>Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.
Interfaces only describe the external point of contact of a class (protocols), they do not contain any implementation.
Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task.
The user never actually knows the providers of these services, but communicates with them through the interface.
In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required. This is known as polymorphism with interfaces.
<b>Reward if useful</b>
11-29-2007 8:57 AM