Open delphidabbler opened 2 years ago
There's no need for the user to change any fields of TPJEnvironmentVar, so we can make the record invariant by hiding the fields, adding read only properties and providing a constructor:
TPJEnvironmentVar
TPJEnvironmentVar = record strict private var fName: string; fValue: string; public constructor Create(const AName, AValue: string); /// <summary>Environment variable name.</summary> property Name: string read fName; /// <summary>Environment variable value.</summary> property Value: string read fValue; end;
The constructor will have have the obvious simple implementation.
Wherever the records fields are directly set in the code the constructor will need to be called instead.
There's no need for the user to change any fields of
TPJEnvironmentVar
, so we can make the record invariant by hiding the fields, adding read only properties and providing a constructor:The constructor will have have the obvious simple implementation.
Wherever the records fields are directly set in the code the constructor will need to be called instead.