AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Delphi-PRAXiS - Lounge Klatsch und Tratsch Eure besten Quellcode Kommentare...
Thema durchsuchen
Ansicht
Themen-Optionen

Eure besten Quellcode Kommentare...

Ein Thema von Relicted · begonnen am 20. Jul 2007 · letzter Beitrag vom 1. Okt 2022
 
freimatz

Registriert seit: 20. Mai 2010
1.520 Beiträge
 
Delphi 11 Alexandria
 
#11

AW: Eure besten Quellcode Kommentare...

  Alt 5. Jul 2018, 12:38
Heute darübergestolpert (ßßß von mir ersetzt)
Delphi-Quellcode:
unit ßßß;
{******************************************************************************
  PROJECT    : ßßß
  SUBPROJECT : ßßß
.............................................................................
  DESCRIPTION:
    Contains DTOs (Data Transfer Objects) for carriage manager testautomation services. All DTOs
    contain are fields of data - there is no logic implemented in here. I did my best
    to prevent 'mistakes' of this sort, but please please do not implement logic in the
    DTOs.

    ---- WARNING ---- WARNING ---- WARNING ---- WARNING ---- WARNING ---- WARNING ---- WARNING ---- WARNING ----
    *************************************************************************************************************
    *  If you want to use the Embarcadero JSON classes, there is one braindead implementation                  *
    *  detail you NEED to know about, before implementing your classes. They absolutely require                *
    *  your fields to be in the form:                                                                          *
    *                                                                                                          *
    *    FSomeField : String;                                                                                  *
    *    property SomeField : String read FSomeField write FSomeFields;                                        *
    *                                                                                                          *
    *  The reason for this is that they hardcoded add a 'F' character to the field names coming in from        *
    *  JSON. So if the JSON code says the field's name is 'foobar', they change that to 'Ffoobar', without      *
    *  any checks, without any choice, without any error message if (when) that braindead hack kills inter-    *
    *  operability. Anything not in that form (for example a member variable called m_something) will NOT      *
    *  be reconstituted back into the object, even though the parser DOES find the field in the JSON code,      *
    *  since THAT TOO WILL BE RENAMED to Fm_something! They do NOT check whether a field is a property before  *
    *  messing up the name! Furthermore, subsequent calls of serialization / deserializatoin lead to field      *
    *  names like FFFFFMyField. So please, just follow embarcadero's religion about how field names gotta      *
    *  look.                                                                                                    *
    *                                                                                                          *
    *  This is literally the worst JSON implementation I've ever seen and shows the complete lack of skill of  *
    *  embarcadero's 'engineers'.  -- ßßß                                                                      *
    *                                                                                                          *
    *************************************************************************************************************

    If you want to see where that hack is located, it's in the unit REST.JsonReflect, the function
    TJSONUnMarshal.ConvertFieldNameFromJson starting at line 2446 ff.
}


interface
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz