Skip to content

Instantly share code, notes, and snippets.

@tkovs
Last active August 23, 2018 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkovs/7d56aef5680f391423c1192aae4630d1 to your computer and use it in GitHub Desktop.
Save tkovs/7d56aef5680f391423c1192aae4630d1 to your computer and use it in GitHub Desktop.
Circular reference
unit UnitA;
interface
uses
TUnitB;
type
TUnitARecord = record
...
...
end;
TUnitA = Class
...
private
FExemploB: TUnitB;
...
...
...
End;
implementation
uses
UnitADAO;
...
...
end.
unit UnitADAO;
interface
uses
UnitA;
type
TUnitADAO = Class
function foo(): TUnitARecord;
function bar(): TUnitARecord;
...
...
End;
implementation
uses
UnitB;
...
...
end.
unit UnitB;
interface
uses
TUnitA;
type
TUnitBRecord = record
...
...
end;
TUnitB = Class
...
private
FExemploA: TUnitA;
...
...
...
End;
implementation
UnitBDAO;
...
...
end.
unit UnitBDAO;
interface
uses
UnitB;
type
TUnitBDAO = Class
function foo(): TUnitBRecord;
function bar(): TUnitBRecord;
...
...
End;
implementation
uses
UnitA;
...
...
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment