Delphi 8 provides an easy way to serialize any VCL.NET or any NET framework object.
The following code fragment shows how easy it is to serialize a .NET framework class object, a System.Windows.Forms.Button.
In Delphi speak, it's known as streaming, and it's been available in Delphi since 1994 or 1995. Now, the power of streaming any VCL.NET object is in your hands!
Note that the format of VCL streaming and .NET serialization is different and you should not mixed them together!
var F: TFileStream; MyButton: Button;begin F := TFileStream.Create('C:\TEMP\SERIALIZE.TXT', fmCreate); MyButton := Button.Create; F.WriteComponent(MyButton); MyButton.Free; F.Free;end;
In 2017, with the release of Delphi 10.2 Tokyo, Embarcadero introduced a specialized implementation of the Observer pattern into the System.Classes unit. While it has been in the wild for 9 years, it remains a "hidden" architecture for many, primarily because it serves as the invisible engine behind LiveBindings. Other than live bindings, you can also use the Observer pattern as a way to update component settings to the Windows registry, an .ini file, or persist it elsewhere.
System.Classes