DEV Community

Cover image for Let's talk about OO ABAP with a junior DEV!
Sadullah TANRIKULU
Sadullah TANRIKULU

Posted on

Let's talk about OO ABAP with a junior DEV!

  • What is OOP?

OOP stands for Object Oriented Programming as you all know. Object is a thing that has own completency like wood, wheel, towel etc. At software programming, we make it appearable on screens or it may be a hardworker employee at backyard and all those are like how it is in real life, e.g web pages, stylings, colors etc. OOP allows you have objects as software developer and you can manipulate them. Classes are as templates, then create objects from classes, add new features using methods, interfaces and such things. I hope this is sufficient for a general view.

  • Does ABAP supports OOP?

SAP ABAP supports OOP, it means, I can create object, inherit from parent class, can have static methods and variables, define interfaces in class, specify the visibility using public, protected and private sections. SAP has global pool to create global classes such that any developer reach it and call its methods in a report/function/method.

As far as I know ABAP does not support multiple inheritance e.g a subclass can't inherit from multiple super classes. So, to succeed it, I can use multiple interfaces in a certain class.

  • Why should I prefer classes, functions instead?

Actually every kinda tech stack has pros and cons. OOP has its own structure that I don't think you can break it down easily while increasing your code lines, but it needs a good plan at the start. Once you write your code script for example in an abstract method, then you can use it whereever you want, but that abstract class has to be at the top like grand grand grandpa 😊. When I created a class, it takes place in memory, thus, memory reminds me performance. In contrast to OOP, functions are quick solutions to perform a specific job and after then it has nowhere to live in memory or not need to live there. May be it's struggling that build a clear architecture with functions. Because in my project they look like clothes are everywhere in the room.

For brevity, memory is one of the main sources at software development, I can't ignore it. Architecture, fast reponse times, amount of database requests are all also very important at software development life cycle. Now it's your choice dude! OOP or Functions?

Top comments (1)

Collapse
 
sadullah profile image
Sadullah TANRIKULU

I'm a jr ABAP developer, so may be I made mistakes in my blog. But I know mistakes come from more practice and more practice takes you to succeed. I'm open to advices to improve my tech writings and software knowledge. ❤️