ABAP的直升机观 [英] Helicopterview of ABAP
问题描述
我对 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.
- 它(总是)编译了吗?
- Typestem :它是强类型的吗?它是否使用类型推断?
- 继承:单个/多个,类似接口的结构?
- Collections : 除了数组还有其他的集合吗?它有通用集合吗?它是否使用列表理解?
- 数组、返回类型、参数类型、覆盖中的 (con/contra/in) 方差如何?
- 任何异常处理?
- 是否有合同支持的内置设计?
- 与其他知名语言相比,有什么特别之处吗?
- ...
基本上欢迎任何关于特性的一般信息!
Any general info about characteristics basically would be welcome!
推荐答案
它(总是)编译了吗?
Is it (always) compiled?
ABAP 被编译"成一种字节码(由于历史原因称为加载"),然后由内核内的虚拟机执行.您可以将其与 Java 进行比较,但有一个很大的不同:负载不是独立于机器的,而是针对目标机器类型进行了优化.这意味着在具有多种不同类型应用程序服务器的系统环境中,您可能对单个程序有多个预编译负载.并不是说您永远不会看到任何这些 - 整个编译过程都是自动处理的.
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:它是强类型的吗?它是否使用类型推断?
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 ?
单一继承.支持接口,包括复合接口和实现组件重命名(IF_FOO和IF_BAR两个接口都可以定义一个方法BAZ,实现两个接口的类就会有两个方法IF_FOO~BAZ和IF_BAR~BAZ).
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 : 除了数组还有集合吗?它有通用集合吗?它使用列表理解吗?
Collections : Has it collections apart from arrays? Has it generic collections? Does it use List comprehension?
您在其他编程语言中所知道的数组"在 ABAP 中并不真正存在——您通常会使用所谓的内部表"来代替.想想类似数据库的结构化内存表.有一些集合类的想法分布在不同的模块中,但这样做的规范方法是使用内部表 - 定义所谓的表类型的行,表示对实例的引用或包含此类引用的结构.
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.
数组、返回类型、参数类型、覆盖中的 (con/contra/in) 方差如何?
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.
任何异常处理?
是的.不止一种方式 - 再次出于历史原因(向后兼容性).支持基于类的异常.
Yes. More than one way - again for the historical reasons (backward compatibility). Class-based exceptions are supported.
是否有合同支持的内置设计?
Any build in design by contract support?
我不知道.
与其他知名语言相比,有什么特别之处吗?
Anything remarkable as oposed to other well known languages?
很多东西.您可能需要查看 http://www.volker-wegert.de/en/node/17 和 http://www.volker-wegert.de/en/node/21 对于公认有偏见的概述:-)
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 :-)
这篇关于ABAP的直升机观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!