Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helicopterview of ABAP [closed]

Tags:

abap

I don't know a thing about ABAP, apart from it has an OO side, and I would like to have some kind of helicopterview of it before I start to look at it in detail. I know I can find all of this when studying it , but like I said for starters I like to know what I am dealing with.

  • Is it (always) compiled?
  • Typestem : Is it strongly typed? Does it use type inference?
  • Inheritance : single / muliple, interface-like structures ?
  • Collections : Has it collections apart from arrays ? Has it generic collections? Does it use List comprehension ?
  • How about (con/contra/in)variance in arrays, returntypes, parametertypes, overriding?
  • Any Exceptionhandling?
  • Any build in design by contract support?
  • Anything remarkable as oposed to other well known languages?
  • ...

Any general info about characteristics basically would be welcome!

like image 892
Marc Avatar asked Jan 26 '10 08:01

Marc


1 Answers

Is it (always) compiled?

ABAP is "compiled" into a sort of byte-code (called "load" for historical reasons) that is then executed by a virtual machine inside the kernel. You can compare this with Java, with one big difference: The load is not machine-independent, but optimized for the target machine type. This means that in a system landscape with several different types of application servers, you might have multiple pre-compiled loads for a single program. Not that you'll ever see any of this - the entire compilation process is handled automatically.

Typestem : Is it strongly typed? Does it use type inference?

Strongly typed with a system of generic types on top. Note that there's a complete data dictionary that is integrated into the language - very handy.

Inheritance : single / multiple, interface-like structures ?

Single inheritance. Interfaces are supported, including composite interfaces and implementation component renaming (two interfaces IF_FOO and IF_BAR can both define a method BAZ, and a class implementing both interfaces will then have two methods IF_FOO~BAZ and IF_BAR~BAZ).

Collections : Has it collections apart from arrays? Has it generic collections? Does it use List comprehension?

What you know as "array" in other programming languages does not really exist in ABAP - you'll usually use so-called "internal tables" instead. Think database-like structured in-memory tables. There are some ideas of collection classes spread out through different modules, but the canonical way to do this is to use internal tables - define a so called table type of lines that either represent references to instances or structures that contain such a reference.

How about (con/contra/in)variance in arrays, returntypes, parametertypes, overriding?

Arrays: see above. Overriding: You can not change the method signature when implementing interface method or overriding superclass methods. As for the parameters - that depends on whether you transfer data (or data references) or object references. In general, upcasting may happen implicitly while you have to perform the downcasting explicitly.

Any Exceptionhandling?

Yes. More than one way - again for the historical reasons (backward compatibility). Class-based exceptions are supported.

Any build in design by contract support?

None that I'm aware of.

Anything remarkable as oposed to other well known languages?

Lots of stuff. You might want to check http://www.volker-wegert.de/en/node/17 and http://www.volker-wegert.de/en/node/21 for an admittedly biased overview :-)

like image 56
vwegert Avatar answered Nov 29 '22 00:11

vwegert