Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Delphi Pendant zu "move corresponding" in ABAP (https://www.delphipraxis.net/203980-pendant-zu-move-corresponding-abap.html)

Blackpit 12. Apr 2020 16:17

Pendant zu "move corresponding" in ABAP
 
Hallo,
als ehemaliger ABAP-Developer vermisse ich immer öfter das in ABAP verfügbare "move corresponding".
Gibt es in Delphi was vergleichbares?
Wie könnte man sonst diese Funktionalität bekommen, könnte man das evtl mit einem Classhelper lösen?

Gruß BP

jfheins 12. Apr 2020 21:05

AW: Pendant zu "move corresponding" in ABAP
 
Das gibt es fast nirgends standardmäßig. In C# gibt es Automapper, aber auch das ist eine Erweiterung.

Allgemein würde ich aber eher davon abraten, sowas zu nutzen. Das führt ja tendenziell dazu, dass gewisse Fehler statt Compile- nun zu Runtime-Fehler sind.

TigerLilly 13. Apr 2020 12:06

AW: Pendant zu "move corresponding" in ABAP
 
:-) COBOL kann das auch.

In Delphi kannst du sowas via RTTI machen. Ich kann grad nicht nachsehen, aber Spring4D könnte sowas haben oder QuickLib https://github.com/exilon/QuickLib

TurboMagic 13. Apr 2020 17:34

AW: Pendant zu "move corresponding" in ABAP
 
Zitat:

Zitat von TigerLilly (Beitrag 1461924)
:-) COBOL kann das auch.

Was glaubst du woher ABAP das kann? ;-)
Wenn ich mich richtig erinnere ist ABAP sehr stark von COBOL beeinflusst,
wenn man man die objektorientierte Erweiterung weglässt, die zumindest anfänglich
dummerweise beim Methodenaufruf die Anleihe beim Funktionsbaustein (sowas wie eine Prozedur/Funktion)
Aufruf genommen hat. Problem: Funktionsbausteinaufrufe sind sehr Syntax/Zeilenverschwenderisch,
zumal da fast nix optional ist. Gibt's keine Übergabeparameter muss man das trotzdem explizit
so formulieren, auch für fehlende Rückgabeparameter usw.
Damals kostete so ein Aufruf schnell mal 1/3 bis 1/2 Bildschirmseite im Editor...

Ansonsten: ja mittels RTTI müsste man sowas vermutlich bauen können. Ist vermutlich nicht gerade
laufzeiteffizient, aber sollte denke ich technisch machbar sein.

Grüße

TurboMagic

hoika 14. Apr 2020 05:19

AW: Pendant zu "move corresponding" in ABAP
 
Hallo,
die unbehandelten Ausnahmen sollten einem schon zu Denken geben ...
https://help.sap.com/doc/abapdocu_75...e/abapmove.htm

Ich hätte gern mal ein Beispiel (in Delphi),
was den Wunsch veranschaulicht..

TigerLilly 22. Apr 2020 09:12

AW: Pendant zu "move corresponding" in ABAP
 
Ja, QuickLib hat sowas + heisst dort "Mapping" bzw "AutoMapping".



Zitat:

**QuickLib**
--------

Small delphi/Firemonkey(Windows, Linux, Android, OSX & IOS) and fpc(Windows & Linux) library containing interesting and quick to implement functions, created to simplify application development and crossplatform support and improve productivity.

**Areas of functionality:**

* **Mapping**: Map fields from a class to other class, copy objects, etc..
* **Config**: Use your config as an object and load/save from/to file (Json/Yaml) or Windows Registry.
* **Serialization**: Serialize objects to/from json/Yaml.
* **Scheduling**: Schedule tasks launching as independent threads with retry policies.
* **Threading**: Simplify run and control of multithread background tasks, Thread-safe Lists, queues, etc
* **Data**: Flexible data interchange and storage, allowing several input-output types.
* **Cloud**: Simplify cloud Azure/Amazon file management, send emails and more.
* **Querying**: Indexed Lists, Searchable Lists and Linq query system for generic lists and arrays.
* **Benchmark**: Time elapsed control and benchmark functions.
* **Filesystem**: Process and Services control, file modify monitors and helpers, etc...
* **FailControl**: Fail and Retry policies.
* **Caching:**: Cache string or objects to retrieve fast later.


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:36 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz