Devtoberfest
Find out what's happening, and when, in the Devtoberfest schedule – don't miss out!
cancel
Showing results for 
Search instead for 
Did you mean: 

🟢 Introduction to ABAP Object Oriented Patterns

Devtoberfest

Although not a new topic in the #ABAP space, Object Oriented patterns continues to be a hotly requested topic. Therefore, we thought to start off the ABAP topic in #Devtoberfest with an interactive session on this very topic. We will look at some of the basics of object-oriented design in the ABAP language but also discuss some of the common design patterns that are most often used in ABAP. From the Factory pattern to dependency injection, we will look at different patterns implemented in ABAP. 



Event has ended
You can no longer attend this event.

Starts:
Ends:
37 Comments
thomas_jung
Developer Advocate
Developer Advocate

The source code from today's session is now available in GitHub: https://github.com/SAP-samples/abap-oo-basics/tree/main/src/zabap_oo_patterns

Andreas_Rother
Explorer

Very well explained, as always.
I needed a refresher definetely after just doing maintenance programming during my last projects 🙂

SpedyHD
Discoverer

Nice introduction to these basics. Thank you!

I found it sad, that the dependency injection was not shown, this is a topic that interests me the most when i read the content summary of this session.

thomas_jung
Developer Advocate
Developer Advocate

We'll have to come back and do a separate dependency injection session in the future. Maybe post-Devtoberfest and TechEd just because we are really booked up.  I just got into creating the content and the section on Dependency Injection took like 45 minutes to cover. There's a lot to do there, especially if you want to include a primer on Unit Tests in general (which I think is necessary for a beginner's session).  I just couldn't fit that much into one session. 

VeenaMurali
Explorer

@thomas_jung , why do you use a ! in the attribute names? 

thomas_jung
Developer Advocate
Developer Advocate

Mostly that's a holdover from the form based SE80 where it inserts those automatically.  Their purpose is to be a variable/parameter identifier. It serves as an escape character and it allows you to use ABAP reserved words as variable/parameter names and can be used in code as well.

Hi @thomas_jung 

i completed the tutorials and  badges are reflected in my community,

but , when i checked my gameboard  there are no points are updated.

shaiksadeek_0-1665135120402.png

please share a solution for this issue.

thanks &regards

shaik sadeek

thomas_jung
Developer Advocate
Developer Advocate

@former_member16808 - what is the community id that you are trying in the gameboard?  I can research. And when did you register for Devtobefest? It does take a day or two for the registration badge to get loaded and therefore you show up in the Gameboard. 

Community id::- shaiksadeek

thomas_jung
Developer Advocate
Developer Advocate

@former_member16808 - It's there now in the gameboard

kartefact
Participant

This was an excellent refresher on intro to OO patterns as expected from @thomas_jung. Thank you for your efforts. Have always been a fan of your sessions.

I'd highly recommend checking out his original ABAP Freakshow available as SWF downloads in this git: https://github.com/kartefact/afs_oo_videos

which I had uploaded long ago (with his permission, of course) before it was buried in the interwebs. It is an excellent introduction to ABAP OO. 

Although the tooling has changed quite a bit over the years, the concepts are fundamentals which remain pretty much the same even today and hence, still very relevant. So, if you are new or need to brush up your OO basics, this is a great place to start.

KR
Flavio
Active Contributor

Thanks for sharing the link

thomas_jung
Developer Advocate
Developer Advocate

I did redo those OO videos a little while back. Same concepts just updated with the modern tooling and now available on YouTube. Source code and links to the videos here: SAP-samples/abap-oo-basics: In support of the YouTube video series on ABAP Object Oriented basics, t... or playlist: (3) ABAP Object Oriented Concepts - YouTube

SugguSandeep
Active Participant

Hi @thomas_jung ,

I followed the tutorial : https://developers.sap.com/tutorials/abap-environment-trial-onboarding.html

& While I Create SAP BTP Trail Account I am facing an issue 

Attached Screenshot :

1.jpg

2.jpg

 

Thank You,

Suggu Sandeep.

 

 

TMNielsen
Contributor

Hi  @SugguSandeep  and @Berinath 

I think this is same issue discussed in other tutorial thread (🟢 Get Your Eclipse ADT installed - SAP Community Groups) it is a problem with the Booster and the solution is to create the instance manually and when you do that you must enter an email address in the json file - so you just enter your email address between the " " 

Berinath
Participant

Hi @thomas_jung ,

I am facing the same issue as @SugguSandeep facing.  while trigger creation manually, I don't know which JSON file I have to insert.1.png

 

2.png

 Regards,

Berinath Ulisi.

thomas_jung
Developer Advocate
Developer Advocate

For general questions onboarding to the trial or free tier, this isn't the best place to put those. No one from the trial team is monitoring here. You should really post those in the ABAP forum of the Community Q&A.   As far as parameters you specifiy during the new instance creation - just type in your email address that you used to create your BTP account in that editor. You don't need to upload a JSON file. 

scottlawton
Explorer

Thanks for the overview of these patterns, @thomas_jung! I did want to note that I think you misspoke about FRIENDS, so your description was not quite accurate. FRIENDS is generally not necessary for a subclass to access methods and attributes of its superclass, unless the subclass needs to access something in the private section of the superclass. But in that case, the superclass would need to grant friendship to the subclass. In the presentation example, FRIENDS was being used to give the superclass the ability to instantiate the subclass (which was necessary because the subclass was defined as CREATE PROTECTED). 

Thanks again, I always enjoy your presentations!

Scott Lawton