#1 2012-04-17 14:24:01

coblongpamor
Member
From: Bali-Indonesia
Registered: 2010-11-07
Posts: 130
Website

Data Domain

Is it possible to implement Data Domain like this with the framework:

TSQLDomainCode = class/Record?
	Type: RawUT8;
	Size: 10;//max 10 character
	Filter/Pattern/constrain: TSynFilterUpperCase;
	DisplayWidth:100; //in pixel
	..
	..
end;

TSQLDomainNumber = class
	Type: RawUT8;
	Size: 4;//max 4 character
	Filter/Pattern/constrain:'[0-9][0-9][0-9][0-9]';
	DisplayWidth:50; //in pixel
	..
	..
end;

TSQLDomainNumber4 = class(TSQLDomainNumber);

TSQLDomainNumber3 = class(TSQLDomainNumber)
	Size: 3;//max 3 character
	Filter/Pattern/constrain:'[0-9][0-9][0-9]';
	..
end;

TSQLDomainNumber2 = class(TSQLDomainNumber)
	Size: 2;//max 2 character
	Filter/Pattern/constrain:'[0-9][0-9]';
	..
end;

//SQLRecord

TSQLBaseNumber = class(TSQLRecord)
private
	fCode: TSQLDomainCode;
published
	property Code: TSQLDomainCode read fCode write fCode;
end;

TSQLNumber4 = class(TSQLBaseNumber)
private
	fNumberText: TSQLDomainNumber4;
published
	property NumberText: TSQLDomainNumber3 read fNumberText write fNumberText;
end;

TSQLNumber3 = class(TSQLBaseNumber)
private
	fNumberText: TSQLDomainNumber3;
published
	property NumberText: TSQLDomainNumber3 read fNumberText write fNumberText;
end;

TSQLNumber2 = class(TSQLBaseNumber)
private
	fNumberText: TSQLDomainNumber2;
published
	property NumberText: TSQLDomainNumber2 read fNumberText write fNumberText;
end;

thank you.

Offline

#2 2012-04-18 05:27:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,167
Website

Re: Data Domain

The framework is domain-driven, from the group up.

You can't define your own type of data as such: it does not make sense from the Delphi point of view.
All those class definitions do not refer to anything valid, from the Delphi perspective.
So you do not have such a class definition, but what you need is, as stated by the documentation, includes Validation and Filtering within the database model, shared on both client and server side.

We recommend using a global function for creating the TSQLModel of the application, then add filters and validators to each kind of TSQLRecord, at this step.

Then, additional User Interface related elements can be defined in TSQLRibbonTabParameters constants.
This is all explained in the framework documentation.

Offline

#3 2012-04-18 06:00:24

coblongpamor
Member
From: Bali-Indonesia
Registered: 2010-11-07
Posts: 130
Website

Re: Data Domain

ok. thank you.

Offline

Board footer

Powered by FluxBB