过渡到面向对象的ABAP?
看来我们大多数 SAP 程序员都在使用旧版本的 ABAP,也就是面向对象之前的版本。我还注意到,面向对象的语言更加干净、更加现代(他们显然借此机会摆脱了不推荐使用的东西)。
由于该系统尚未推出,因此重新设计的时机宜早不宜迟。
是否值得要求将新代码编写为 OO ABAP 程序?如何将其推销给管理层?与非 OO 程序的接口运行良好吗?
(更新后请注意,我正在专门谈论新代码,特别是明年计划的代码)
It appears that most of our SAP programmers are using the old version of ABAP, the one before object-oriented stuff. I also noticed that the language is much cleaner and more modern with OO (they apparently took the opportunity to get rid of deprecated things).
As the system is not rolled out yet, the time to make any redesign is now rather than later.
It is worth requesting that new code be written as OO ABAP programs? How to sell that to management? Does the interface with non-OO programs work well?
(updated to note that I'm talking specifically about the new code, especially planned for the next year)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果它在生产中运行,请不要重写您的代码。不值得花时间和金钱,而且管理层(在一家足够大、能够运行 SAP 的公司)也不会同意这样做。
除非您迁移到全新环境,否则您永远不会用面向对象重写所有内容。 SAP 甚至还没有在其核心 ECC 模块中做到这一点。期望能够用您的自定义东西来做到这一点是不现实的。
我只是阅读 OO ABAP 并开始用它编写新程序。
OO ABAP 和过程 ABAP 可以很好地协同工作。您可以调用类 &来自程序程序的方法,(更有限,但是)反之亦然。
If it's working in production, don't rewrite your code. Not worth the time or money, and no management (at a company big enough to be running SAP) would agree to it.
Unless you move to a green field environment, you're never going to get everything re-written in OO. SAP hasn't even done that with their core ECC modules. Expecting to be able to do it with your custom stuff is unrealistic.
I would just read up on OO ABAP and start writing new programs with it.
OO ABAP and procedural ABAP work together just fine. You can call classes & methods from procedural programs and (more limited, but) vice versa.
我们为客户开发了许多新的、新鲜的 ABAP 代码,ABAP OO 的使用增长缓慢,但仍在增长。
说服新开发人员使用 ABAP OO 更容易,因为需要学习的东西少得多。此外,使用 OO ABAP 编写代码可以正确使用设计模式、高效的单元测试、UI 抽象(例如 SAPgui 和 WebDynpro 或 SAP Console),并大量减少文档。
另外,正如一些人之前所说,SAP 并没有将他们的代码库重写为 ABAP OO。但他们确实尝试过,从ME51重写ME51N,从ME21重写ME21N,从SO01重写SBWP。
此外,SAP 的所有新 API,如 ABAP Unit、ABAP Proxy、新的 ALV、ABAP 的 WebDynpro 以及全新的增强和切换框架都是很好的例子(我认为),说明为什么您应该给予一些关注。
We develop a lot of new, fresh, ABAP code to our customers, and the use of ABAP OO is growing slowly, but still growing.
It's easier to convince new developers to work with ABAP OO, because there is a lot less to learn. Also, writing code using OO ABAP enables the correct use of design patterns, highly effective unit testing, UI abstraction (eg SAPgui and WebDynpro or SAP Console), and reduces documentation a lot.
Also, as some people said before, SAP isn't rewriting their codebase to ABAP OO. But they surely given a try by rewriting ME51N from ME51, ME21N from ME21 and SBWP from SO01.
Also, all the new APIs from SAP, like ABAP Unit, ABAP Proxy, the new ALV, WebDynpro for ABAP and the all-new Enhancement and Switch Framework are good examples (I think) on why you should give some attention to it.
这取决于要编写的程序的大小。如果是一个大型“系统”,没有太多的数据库交互,可能会有一些好处。对于较小的程序,我没有看到“对象化”代码有任何优势。
它还取决于开发人员的技能和偏好。如果他们想“OO”,可能会有更好的环境。如果他们陷入“旧的过程”思维方式,除了转向面向对象之外,可能还有其他方法可以改进代码。
我经常看到的一个例子是“数据库应该做什么”(例如联接、排序、分组)与“我应该在代码中做什么”的讨论。
It depends on the size of the programs to be written. If it is a large "system" without too much database interaction, there may be some benefits. For smaller programs, I don't see any advantages of "objectifying" the code.
It also depends on the skill and preferences of the developers. If they want to "OO", there may be better environments. If they're stuck in their "old procedural" ways of thinking, there may be other ways to improve the code than switching to OO.
One example I'm commonly seeing is the discussion of "what should the database do" (e.g. joins, sorting, grouping) vs. "what should I do in code".
我刚刚找到了 SAP SDN 中提到的 Esti 白皮书的副本:尚未使用ABAP对象?每个 ABAP 开发人员应该重新审视的八个原因
本文简要介绍了使用 ABAP OO 的好处。
I just found a copy of the white paper Esti mentioned at the SAP SDN: Not Yet Using ABAP Objects? Eight Reasons Why Every ABAP Developer Should Give It a Second Look
This paper gives a brief insight in the benefits of using ABAP OO.
尝试查找白皮书的副本:
尚未使用 ABAP 对象?每个 ABAP 开发人员应该重新审视的八个原因,作者:Horst Keller 和 Gerd Kluger。
SAP OO 的一些最大优势(尤其是对于新 SAP 开发人员而言)是,它迫使您比过程 ABAP 更加明确。它使编写的代码更易于维护,并且来自更主流背景的程序员可能会感觉更熟悉。
Try finding a copy of the white paper:
Not Yet Using ABAP Objects? Eight Reasons Why Every ABAP Developer Should Give It a Second Look by Horst Keller and Gerd Kluger.
Some of the biggest advantages for SAP OO, particularly with new SAP developers is that it forces you to be a lot more explicit that procedural ABAP. It makes written code a lot more maintainable and may feel more familiar to programmers coming from a more mainstream background.
旧的经典报告通常包含冗余编码。通过大量的“复制和粘贴”构建了不同的报告。尝试找出哪些内容是多余的,然后逐步将它们从这些报告中拉出到新的全局、可重用、设计良好的类中,并通过用中央定义的“调用方法”替换现有代码来使旧报告更加紧凑。以及经过充分测试的 OO 逻辑。
Old, classic reports often contain redundant codings. Different reports have been built with much "copy and paste". Try to find which things are redundant and then pull them - step by step - out of these reports into new global, reusable, well-designed classes and make the old reports more tight by replacing existing code with "call method"s to central definied and well-tested OO-logic.