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

encapsulation

Former Member
0 Likes
638

can any some detailed information,faq's regarding only encapsulation,abstraction,not other than that.I will be very thankful to those who have done it.

3 REPLIES 3
Read only

Former Member
0 Likes
614

This sap help link will be very useful to understand basic ABAP object concepts.

http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm

Read only

Former Member
0 Likes
614

Hi,

Check with the below link:

/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action

Regards

Sayee

Read only

Former Member
0 Likes
614

Hi Sandeep,

Defining attributes of a class in the private visibility section is called “Information Hiding” or Encapsulation.

<u><b>Advantage</b></u>

If the attributes are defined as public, the risk would be too large since a user might forget to supply value to attribute or specify an inconsistent value to an attribute.

So the attributes are defined as private so that user cannot directly access them but through methods which are defined in the public section. A strict syntax check governs method calls to check that all obligatory parameters are transferred. Methods can also perform a consistency check and raise an exception if an error occurs.

<u><b>Disadvantage</b></u>

Assigning values to attributes through methods instead of direct assignment

(for public attributes) require slightly more runtime.

Award points if found useful.

Regards

Indrajit