Can I declare a field as static on every descendant class instead of sharing its value for all of them ?
This is the base class:
type
TKpModelViewControllerEntity = class(TInterfacedObject, IKpEntity)
protected
class var ResourceName: string;
procedure Manage;
public
class function Create: IKpEntity;
end;
This is a descendant
unit Customers;
type
TCustomers = class(TKpModelViewControllerEntity)
end;
initialization
TCustomers.ResourceName := 'customers/';
And another one:
unit Articles;
type
TArticles = class(TKpModelViewControllerEntity)
end;
initialization
TArticles.ResourceName := 'articles/';
When I try to create a Customers screen (TCustomers.Create.Manage
) its Resourcename has the "articles/" value instead of "customers/".
Is there a way to indicate for the static fields to hold separate values for every descendant class ?.
Thank you.