Модератор: Модераторы
Unit UnitA;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassA = Class
Public
// тут должен быть класс B
End;
Implementation
End.
Unit UnitB;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassB = Class
Public
// тут должен быть класс A
End;
Implementation
End.
Unit UnitA;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassA = Class
Public
// тут абстрактный предок класса B с нужным функционалом
End;
Implementation
End.
Unit UnitB;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassB = Class
Public
// тут абстрактный предок класса А с нужным функционалом
End;
Implementation
End.
это скорее ошибка проектирования программы
Unit Unit1;
Interface
Uses
Classes, SysUtils, Unit2;
Type
TGrade = Class
Private
fPupils: TPupil;
Public
Property Pupils: TPupil Read fPupils;
End;
Implementation
End.
Unit Unit2;
Interface
Uses
Classes, SysUtils, Unit3;
Type
TPupil = Class
Private
fHead: TPupilHead;
fLegs: TPupilLegs;
Public
Property Head: TPupilHead Read fHead;
Property Legs: TPupilLegs Read fLegs;
End;
Implementation
End.
Unit Unit3;
Interface
Uses
Classes, SysUtils, Unit1;
Type
TPupilHead = Class
Private
fGrade: TGrade;
Public
Property Grade: TGrade Read fGrade;
End;
Implementation
End.
Unit UnitA;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassA = Class
Public
// тут абстрактный предок класса B с нужным функционалом
End;
Implementation
End.
Unit UnitB;
{$mode objfpc}{$H+}
Interface
Uses
Classes, SysUtils;
Type
{ ClassB }
ClassB = Class
Public
// тут абстрактный предок класса А с нужным функционалом
End;
Implementation
End.
Unit School;
Interface
Uses
fgl;
Type TGrade = Class;
Type TGrades = Specialize TFPGList<TGrade>;
Type TPupil = Class;
Type TPupils = Specialize TFPGList<TPupil>;
Implementation
End.
Unit School.Grade;
Interface
Uses
Classes, SysUtils;
Type TGrade = Class
Strict Private
fPupils: TPupils;
Public
Property Pupils: TPupils Read fPupils;
End;
Implementation
End.
Unit School.Pupil;
Interface
Uses
Classes, SysUtils;
Type TPupil = Class
Strict Private
fGrade: TGrade;
Public
Property Grade: TGrade Read fGrade;
End;
Implementation
End.
Unit School;
{$namespace school.grade}
{$namespace school.pupil}
Interface
Uses fgl;
Type TGrade = Class;
Type TGrades = Specialize TFPGList<TGrade>;
Type TPupil = Class;
Type TPupils = Specialize TFPGList<TPupil>;
Implementation
End.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 16