Also doch das Gleiche.
Wenn es aufgeteilt werden soll, dann mußt man es auf eine gemeinsame Basis (Base) bringen.
Delphi-Quellcode:
unit BaseUnit;
interface
type
Visitor =
class;
Base =
class
public
procedure Accept(v : Visitor);
virtual;
abstract;
function Zeugs() :
String;
virtual;
abstract;
end;
Visitor =
class
public
procedure Visit(b : Base);
end;
implementation
{ Visitor }
procedure Visitor.Visit(b: Base);
begin
WriteLn(b.Zeugs());
end;
//...
end.
Delphi-Quellcode:
unit AUnit;
interface
uses
BaseUnit;
type
A =
class(Base)
public
procedure Accept(v : Visitor);
override;
function Zeugs() :
String;
override;
end;
implementation
...
Delphi-Quellcode:
unit BUnit;
interface
uses
BaseUnit;
type
B =
class(Base)
public
procedure Accept(v : Visitor);
override;
function Zeugs() :
String;
override;
end;
implementation
...