Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

difference between interface pool and class pool

former_member192432
Participant
0 Likes
1,831

Hi,

Can any body tell me the difference between Interface pool and Class pool.

thank you in advance.

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,058

Hi,

Interface Pools (J)

Contain interfaces. Classes and interfaces are managed (administered)

in the Class Builder; program type J cannot be changed in the attributes.

it contains: propporties, intrefaces, attibutes, methods, events types, and aliases

where as class pools have : propporties, intrefaces, attibutes, methods, events types, and aliases

Interfaces

The components of a class are divided into visibility sections, and this forms the external point of contact between the class and its users. For example, the components of the public section form the public interface of the class, since all attributes and method parameters can be accessed by any user. The protected components form an interface between the class and those classes that inherit from it (subclasses

Classes

The type of an object is known as its class. A class is an abstract representation, or, metaphorically speaking, a set of instructions for building objects. So that you can describe the properties of objects, classes contain components, which define the state and behavior of objects.

Global and Local Classes

You can define classes globally in the class library in the repository or locally in an ABAP program.

Global classes are coded in a special ABAP program, a class pool, whereas local classes can be coded in almost every ABAP program. Global classes can be used and are visible in all ABAP programs, which is the case for local classes only in their own program. When a global class is used for the first time, the class pool is loaded into the internal mode of the user. The local classes of a class pool can be used by the pool's global classes.

Class Pools (K)

Contain interfaces. Classes and interfaces are managed (administered)

in the Class Builder; program type K cannot be changed in the attributes.

Class is a description of an object, which contains both definition and implementation of methods which also includes interface methods.

In contrast, Interfaces contains only methods definition with signature but no methods implementation.

Check the link,it's useful.

http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm

Regards,

Raj.

4 REPLIES 4
Read only

Former Member
0 Likes
1,059

Hi,

Interface Pools (J)

Contain interfaces. Classes and interfaces are managed (administered)

in the Class Builder; program type J cannot be changed in the attributes.

it contains: propporties, intrefaces, attibutes, methods, events types, and aliases

where as class pools have : propporties, intrefaces, attibutes, methods, events types, and aliases

Interfaces

The components of a class are divided into visibility sections, and this forms the external point of contact between the class and its users. For example, the components of the public section form the public interface of the class, since all attributes and method parameters can be accessed by any user. The protected components form an interface between the class and those classes that inherit from it (subclasses

Classes

The type of an object is known as its class. A class is an abstract representation, or, metaphorically speaking, a set of instructions for building objects. So that you can describe the properties of objects, classes contain components, which define the state and behavior of objects.

Global and Local Classes

You can define classes globally in the class library in the repository or locally in an ABAP program.

Global classes are coded in a special ABAP program, a class pool, whereas local classes can be coded in almost every ABAP program. Global classes can be used and are visible in all ABAP programs, which is the case for local classes only in their own program. When a global class is used for the first time, the class pool is loaded into the internal mode of the user. The local classes of a class pool can be used by the pool's global classes.

Class Pools (K)

Contain interfaces. Classes and interfaces are managed (administered)

in the Class Builder; program type K cannot be changed in the attributes.

Class is a description of an object, which contains both definition and implementation of methods which also includes interface methods.

In contrast, Interfaces contains only methods definition with signature but no methods implementation.

Check the link,it's useful.

http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm

Regards,

Raj.

Read only

ak_upadhyay
Contributor
0 Likes
1,058

Hi,

Class and Interface Pools

This section discusses the structure and special features of class and interface pools for global classes.

Global Classes and Interfaces

Classes and interfaces are object types. You can define them either globally in the Repository or locally in an ABAP program. If you define classes and interfaces globally, special ABAP programs called class pools or interface pools of type K or J serve as containers for the respective classes and interfaces. Each class or interface pool contains the definition of a single class or interface. The programs are automatically generated by the Class Builder when you create a class or interface.

A class pool is comparable to a module pool or function group. It contains both declarative and executable ABAP statements, but cannot be started on its own. The runtime system can create runtime instances (objects) through a request using the CREATE OBJECT statement. These objects execute the statements of the class pool.

Interface pools do not contain any executable statements. Instead, they are used as containers for interface definitions. When you implement an interface in a class, the interface definition is implicitly included in the class definition.

Structure of a Class Pool

Class pools are structured as follows:

Class pools contain a definition part for type declarations, and the declaration and implementation parts of the class.

Differences From Other ABAP Programs

Class pools are different from other ABAP programs for the following reasons:

· ABAP programs such as executable programs, module pools, or function modules, usually have a declaration part in which the global data for the program is defined. This data is visible in all of the processing blocks in the program. Class pools, on the other hand, have a definition part in which you can define data and object types, but no data objects or field symbols. The types that you define in a class pool are only visible in the implementation part of the global class.

· The only processing blocks that you can use are the declaration part and implementation part of the global class. The implementation part may only implement the methods declared in the global class. You cannot use any of the other ABAP processing blocks (dialog modules, event blocks, subroutines, function modules).

· The processing blocks of class pools are not controlled by the ABAP runtime environment. No events occur, and you cannot call any dialog modules or procedures. Class pools serve exclusively for class programming. You can only access the data and functions of a class using its interface.

· Since events and dialog modules are not permitted in classes, you cannot process screens in classes. You cannot program lists and selection screens in classes, since they cannot react to the appropriate events. It is intended to make screens available in classes. Instead of dialog modules, it will be possible to call methods of the class from the screen flow logic.

Local Classes in Class Pools

The classes and interfaces that you define in the definition part of a class pool are not visible externally. Within the class pool, they have a similar function to local classes and interfaces in other ABAP programs. Local classes can only be instantiated in the methods of the global class. Since subroutines are not allowed in class pools, local classes are the only possible modularization unit in global classes. Local classes have roughly the same function for global classes as subroutines in function groups, but with the significant exception that they are not visible externally

Reward points if useful....

Regards

AK

Read only

Former Member
0 Likes
1,058

Hi,

Class is a description of an object, which contains both definition and implementation of methods which also includes interface methods.

In contrast, Interfaces contains only methods definition with signature but no methods implementation.

U can refer this link

http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm

Regards

Kiran Sure

Read only

former_member192432
Participant
0 Likes
1,058

thanks for reply