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?

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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. ❤️

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay