Hola,
Una traducción del código que copiaste, pensando en derivar la clase de "TComponent" para hacer uso de lo que dice el compañero Walter, podría ser como sigue en Delphi:
Código Delphi
[-]
unit UEcuaciones;
interface
uses
Classes;
type
TEcuaciones = class(TComponent)
private
FNombre, FApellido: string;
public
constructor Create(AOwner: TComponent); override;
function GetNombre : string;
function GetApellido : string;
procedure SetNombre(nombre: string);
procedure SetApellido(apellido: string);
end;
implementation
constructor TEcuaciones.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
function TEcuaciones.GetNombre: string;
begin
Result := Self.FNombre;
end;
function TEcuaciones.GetApellido: string;
begin
Result := Self.FApellido;
end;
procedure TEcuaciones.SetNombre(nombre: string);
begin
if (Self.FNombre <> nombre) then
Self.FNombre := nombre;
end;
procedure TEcuaciones.SetApellido(apellido: string);
begin
if (Self.FApellido <> apellido) then
Self.FApellido := apellido;
end;
end.
Sin embargo, fíjate que los métodos "Gets" y "Sets" no hacen sino asignar un nuevo valor a las variables que nos interesan, por un lado, y por otro devolver el valor de dichas variables. Entonces podríamos simplicar un poco el código en Delphi, gracias a las "propiedades":
Código Delphi
[-]
unit UEcuaciones2;
interface
uses
Classes;
type
TEcuaciones = class(TComponent)
private
FNombre, FApellido: string;
public
constructor Create(AOwner: TComponent); override;
property Nombre: string read FNombre write FNombre;
property Apellido: string read FApellido write FApellido;
end;
implementation
constructor TEcuaciones.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
end.