Warum denn nicht einfach kreativ so
Delphi-Quellcode:
IRead = interface
function Read : Integer;
end;
IWrite = interface
procedure Write( Value : Integer );
end;
IReadWrite = Interface;
function Reader : IRead;
function Writer : IWrite;
end;
TReadWrite = class( TInterfacedObject, IRead, IWrite, IReadWrite )
private
FValue : Integer;
public
// IRead
function Read : Integer;
// IWrite
procedure Write( Value : Integer );
// IReadWrite
function Reader : IRead;
function Writer : IWrite;
end;
function TReadWrite.Read : Integer;
begin
Result := FValue;
end;
procedure Write( Value : Integer );
begin
FValue := Value;
end;
function Reader : IRead;
begin
Result := Self;
end;
function Writer : IWrite;
begin
Result := Self;
end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ea 0a 4c 14 0d b6 3a a4 c1 c5 b9
dc 90 9d f0 e9 de 13 da 60)