Skip to Content
-1

What should an excellent OO course contain?

Jan 03 at 10:20 AM

310

avatar image

What helps you to master Object Orientation (OO) in ABAP?

As an ABAP Coach, I'm giving from time to time lessons in OO. Of course, it helps me that I'm a Trainer for the BC401 (ABAP Objects) and WDE401 (Practical ABAP Objects).

My goal is to create the best possible Course in ABAP OO (Intro-Course and applying OO to ABAP), what the content should contain?

Here is my actual structure:

  • Intro to OO Terms, and History
  • Overview of the 20% of Knowledge, that we need to getting things done in ABAP OO
  • Small Exercises from the scratch (aka Code Kata)
  • Analyzing examples, good vs. evil and transformation from "non-oo" to oo
  • Medium Exercises with a data model different to the 'Flight-Model'. For example more like the new procurement model

Please extend the list!

What should an excellent OO course contain?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Uladzislau Pralat Jan 03 at 11:24 AM
1

Hi Damir,

I would also mention OO Design Patterns, for example, Singleton etc.

Regards, Uladzislau

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi @Uladzislau Pralat,

ok thanks!

Only as a theoretical input or in which form?

BR Damir

0

Hi Damir,

just an example, report data retrieval logic can be wrapped into singleton class. The class is instantiated from the class itself and only executed once.

Regards, Uladzislau

1
Jacques Nomssi Jan 06 at 05:54 PM
3

Hello Damir,

1) About Patterns: IMO the book "Elemental Design Patterns" by Jason Smith presentation can be used in a course, showing intent, motivation, applicability, structure and participants of OO paterns like:

  • Create Object - How to make sure a variable is initialized usage/assertions are fullfilled before usage
  • Retrieve - how use/access an object from a non local scope
  • Inheritance - how to reuse another class's interface, implementation, behavior with alterations
  • Abstract Interface - how to provide a common interface for applying a behavior in a family of objects
  • Delegation - how to parcel out a portion of the current work to another method in another object
  • Extend Method - how to supplement, not replace behavior

The benefit for me was to understand that OO has limits, it is all about a good design, and using OO enables or enforces best pratices.

2) in a course you will be programming in the small most of the time to introduce ABAP OO features. I found it beneficial to understand the motivation/benefits of designing with objects in the large. There a now one useful real world example: ABAP Git is over 50000 lines of code that is accessible and readable with practical examples for many concepts.

my 2 cents

JNN

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Jacques Nomssi

thanks for your answer!

Some time ago I had read the Book "Elemental Design Patterns", and i found it very interesting! Afterwards I´d researched if anything ground breaking happend with this topic... But i found only silence ;-/ Nevertheless: YES, of course the intro part is great! Thanks for this suggestion!

I also started to think about the examples topic. The course should contain good OO Examples to learn from. If possible they should be real-life examples from SAP Standard or something home-made. In the ABAP Open Source World we have a couple of good examples...

BR Damir

0
Tomas Buryanek Jan 03 at 03:01 PM
1
  • Designing sample object model/s (no programming yet).
  • Showcase of some real and solid OO ABAP solution, which is robust but easy to demonstrate design advantages.
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi @Tomas Buryanek,

thanks for your suggestion!

Do you have any examples in mind for your points? Have you seen something in SAP Standard Modules or anywhere else?

BR Damir

0

Hi, I can't share customer OO solution/s which would be nice example. But I am sure you can find some standard :)

0
Matthew Billingham
Jan 03 at 12:30 PM
1

I learned OO programming through Head First Java - I then applied what I'd learn to ABAP OO. If you modelled your course on that, you wouldn't go far wrong.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi @Matthew Billingham,

thanks for your comment.

It hadn´t read the book so far. But what especially helped you to master OO? Did you have any OO experience before reading this book. What makes this book so benefitial to you? Do you suggest anything else, that could support an ABAP Dev to learn and apply OO in his work?

Cheers, Damir

0
Nic Teunckens Jan 07 at 12:54 PM
1

I would definately show some of the new ABAP Syntax (ABAP 7.40+) as to show that the (overall OO-)inspired New Syntax can actually be "compact". I feel the non OO-Guys need to be convinced that it can actually be quite concise and 'pretty' whilst all the initial declarations and "CALL METHOD"s etc. felt like a lot of extra work to some people previously.

I say this because I really feel there is a need to adequately show how fast and readable the OO-code can be to a reluctant non-OO ABAP'er ...

I've seen some 'SFLIGHT"-sample OO-programs (e.g. in the SAP Wiki), but some comparison to the New Syntax (and OO principles) as a comparison to the Classic FORM-written samples could be nice.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 08 at 09:38 AM
1

Hello Damir,

assuming the course is for a beginner, I would start with main principles and concepts of OO programming to build some foundation and understanding.

Than I would create a practical use case which is easy, but complex enough to show practical use of OO. Just create a sample program which read some data, transforms the read data and finally process the the transformed data.

For the selection part, you can show how to use polymorphism to read the data from different origins, e.g. read the data from directly from SAP tables, or read the data from text file, etc. Just show the possibility to get the data from different sources, with different instances of classes/interfaces without changing main program. You could include factory pattern for example in this part (even factory can be used in every part).

For the transformation part you could show some more patterns if you like (it's not really necessary, but good to know), e.g. template or strategy pattern which are easy to understand. You can show how the program should behave based on different input data, let's say actual and plan, something like this. In this part you could also introduce TDD and how to mock data as input, but actually I consider this as a more advanced feature and would include it in a advanced section/course (even it is very important). In an advanced section you could also introduce, how to replace own developed functionality with maybe BRF rules (not directly OO related but useful).

For the process part, you can show again how to use polymorphism, e.g. post data based on actual/plan with different BAPI'S for plan/actual or update an own table. Also something like creating a log after BAPI call with e.g. decorator pattern.

Finally I would show what will happen if some requirements change (we all know this, right ;-) ). For example you should not only create a log, in addition a message should be send to an user or you should trigger some additional process/workflow, something like this. You can show how easy you can extend functionality with decorator pattern to apply additional functionality without changing main program.

At the end of the course, the students have a full working example which they can just pull out of the bag and use it as a template for a lot of use cases in daily work.

That's how I would create a course. What do you think?

Best regards, Tapio

P.S.: The best book I read so far (and I read a lot of books), when it comes to OO programming is "Agile Principles, Patterns and Practices in C#" by Robert C. Martin and Micah Martin. C# is easy enough to understand the coding examples, but the important part are the explanation of underlying concepts. It covers almost everything, which is important for OO programming. But I guess it's some kind of personell taste.

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Jan 09 at 11:39 AM
1

I think an SALV report using MVC pattern would be a great example that teaches real-world reusable skills. You can go to town and add detail views using OO events and stuff, all in a relatively compact report that provides a lot of OO bases.

Share
10 |10000 characters needed characters left characters exceeded