2007 Sep 23 6:55 AM
Do the Interface can contain static componenets (static methods,attributes).Does the interface contains attributes like that of a class.
2007 Sep 24 3:01 PM
From a technical point of view, interfaces are simply superclasses that cannot be instantiated, do not have an implementation part, and only have public components.
In ABAP Objects, interfaces primarily serve to define uniform interfaces (protocols) for services. Various classes can offer (that is, implement) these services in different ways, but keep the same semantics. Interfaces contain no implementation.
2007 Sep 25 7:03 AM
Hi
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>Interfaces features</b>
Sepearation of external point of contact ( intrafce ) and implementation(class)
- the client defines the protocol , the server implements it
- Black Box Principle client only knows the interface , not the implementation
- lowest linkage between client and server
Polymorphism
- generic handling of objects of different classes
Abstraction
- interface as a generalization of the implementing class
Simulation of multiple inheritance
<b>Working with Interface components</b>
You can access interface components using an object reference, whose class implements the interface. Syntactically this is done with the interface resolution operator, just as with the method definitions in the implementation part of the class.
2007 Sep 25 11:25 AM
Hi ..
Yes
Interfaces can contain Static components.
Interface can contain all the Components like a class:
1. Attributes
2. Methods
3. Events
4. Interfaces.
But all these are PUBLIC components by default.
reward if Helpful.