Application Development 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: 

Differences between Procedural ABAP & OOPs ABAP

Former Member
0 Kudos

Hi Friends,

Can any one explain the differences between Procedural ABAP and OOPs ABAP in brief ? pls explain the most important ( atleast 3 or 4 points ). pls don't give me any other links, i will appreciate for good responses... and will be awarded with full points...

Thanks and Regards

Vijaya

2 REPLIES 2

arun_purohit
Participant
0 Kudos

hi Vijaya

diff. between Procedural ABAP and OOP ABAP is almost the difference between

C language and C++.

In procedural ABAP u will b using function modules, subroutines as normal.

but in OOP ABAP there r lots of classes defined with associated methods or like routines...

to use those associated programs classes shld hv been declared in u r program....

hope this much is suffice....

Former Member
0 Kudos

Let me add some comments about the difference in design between Procedural Programming and OOP. If you are used to writing procedural/imperative code, then it will take a while to adjust to object oriented code, because the design is quite different. These are a few points that may take some time to get used to.

I. In procedural code, you normally think about functionality first and pass the data around to several procedures to be manipulated until eventually you get our result, whatever that may be. In OOP, you think about data first, and attach functionality to the data to which it applies. In this way, you create a virtual object with its own properties and actions that can be performed on it or by it.

II. Objects should always have a consistent and valid interface. What I mean by this is that public attributes and methods should accurately reflect the state of the data at all times. It should not be possible for code that uses an object to call the methods in the wrong order and get invalid results. Each method call should update all data necessary to keep the data that is visible to the user of the object in a valid state. The idea of getter and setter methods is very useful here. If calling code does something that does not make sense, you can always throw an exception, however, when it is possible, you should design the class such that calling code does not even have a chance to misuse it.

III. OOP trades efficiency of execution for efficiency of development. In the past, computers were more expensive than programmers, so it was worth taking a great deal of time to make code as efficient as possible. This is no longer the case. Due to the rapid drop in hardware costs, the precious resource that needs to be conserved is development time. OOP organizes code in a way that is less efficient, but provides a level of modularity that decreases the cost of development/maintenance. Therefore, the focus of the programmer should be on good design first, even if it means compromising efficiency. There are still ways to make OOP efficient, but it will never be as efficient as Procedural.

I hope this is helpful to someone.