I dont see nothing! just a inheriting in many places! in fact, "words / names" nothing means to computers! only for human! at end, all is bits! 0 and 1
ShortName is an "ALIAS" to long_names ShortName.Hello "would can hides if was inheriting not overrided" long_names....procedure
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
Yes ,that is nothing to computer, but always make my brain and eye balls pain .....
And,what do you think with below codes ?
type TTypeA=class class function A:String; end;
TTypeB=class class function B:string; end;
TTypeC=record Data:String; end;
TypeX=class type TypeA=TTypeA; TypeB=TTYpeB; TypeC=TTypeC; end;
procedure test; type xc=TypeX.TypeC; var x,y:string; z:xc; begin x:=TYpeX.TypeA.A; y:=TypeX.TypeB.B; z.data:='TypeXTypeC'; end;
----------------------------------------------
z@S7
Since such code is, in fact, bad, and it indicates that the programmer is not a programmer, but a would-be candidate for a programmer vacancy in a computer science entrance exam, then,....
I would say, without any arrogance , that:
--- do not use something like that! --- Unless you want to play crazy at certain moments in your life, (without using illicit intoxicants).
Sumary: this code is nothing, at all! confuse and unnecessary!
type TTypeA = class class function A: String; // this function belongs to "class" of of type!!! not to the object/instance!!! end;
TTypeB = class class function B: String; // this function belongs to "class" of of type!!! not to the object/instance!!! end;
TTypeC = record Data: String; end;
TypeX = class // all "new" types is "PUBLIC" in this class! ==> it's "ALIASes" from "real-TYPES above"... nothing more! type TypeA = TTypeA; // TRY VERIFY THE "POINTER" ON MEMORY IF THE SAME OR NOT (IF NOT ASSIGNED ANY VALUE BEFORE) TypeB = TTypeB; TypeC = TTypeC; end;
procedure test; type xc = TypeX.TypeC; var x, y: String; z : xc; begin x := TypeX.TypeA.A; // just "getting" a "string-value" produced in "A function" y := TypeX.TypeB.B; z.Data := 'TypeXTypeC'; // just storing a string end;
{ TTypeA }
class function TTypeA.A: String; begin
end;
{ TTypeB }
class function TTypeB.B: String; begin
end;
end.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
use "names" that explains your usage, and type! ---------- type TCustomerName = string;
var LCustomerID : integer; = integer type to "customer IDs'
function GetCustomer(const AID:string):TCustomerName; // accept only a "string", understanding is "ID" (as string) from customer begin result := '....'; // result in "string", understanding that is "customer name" end;
NOTE: you can use any name, any type, that "IT DONT CONFLICT WITH INTERNAL USAGE FROM LANGUAGE"!!!
@yxsoft ,Thanks for your reply . @emailx45,Thanks a lot for your suggestion.
All above codes I wrote was start from human side view ,about to organize types define in many units(.pas).
When I have Unit_A.Type1..Type10, Unit_Z.Type_991...Type...999(like some orm class defines stage), Under normal conditions, I will write Uses Unit_A,...Unit_Z to use them.
So I consider to define a Unit_0.Type_?, and define type alias to all other types in other units.
likes a tree
Unit_0; Type_?=class type Type_1=Unit_A.Type_1; ... Type_999=Unit_Z.Type_999; end;
or
Unit_0; Type_?=class type Catalog_A=class type Type_1=Unit_A.Type_1; ... end; ... Catalog_Z=class type ... Type_999=Unit_Z.Type_999; end; end;
So,i can just "uses unit_?" when i want use these types (with Code Insight);
After learned :
from floor 1 Type Alias Like "TypeA=TypeB", Method of "TypeA" "would can hides if was inheriting not overrided" from floor 6 "MyTTypeA" and "MyTypeA" is not same position (in memory ?).
Honestly, your way of "seeing things" is, at the very least, a mistake!
Even Embarcadero units don't use that many types in their declarations. And, having 1000 types defined is something you should never dream of wanting! = 1000.DCus in disk!!!
Just remembering that, when defining this type of usage, you will be compiling all the referenced units. Even use it only one or two!
I think you're heading for chaos! Think about it!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
I'm getting out of here! I was overcome by an intelligence greater and far superior to mine!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
This "见仁见智" is the simple version of Chinese Idioms "仁者见仁,智者见智",it come from 《Zhou Yi》 , means different person see the same thing from different point of view. this word is no means "who is much much intelligence greater and far superior than others".
It is "neutral word"(中性词), not just from the word itself(字面意义). I use this word to explain to @dalas "why someone make codes into chaos."
I hope to explain this word will not make things turn into another chaos ......
----------------------------------------------
z@S7
I only said that: my mind cannot follow the proposed train of thought! -- translating: I can't imagine the practical use of this elaboration!
I see that perspectives are closely related to the position in which the observer is. So I can't find this observation point.
And therefore, I prefer to leave the room so as not to occupy a place that does not belong to me.
Anyway, point of view is always tricky to debate! But if it's ok for all parties, then ok!
Note: any translation errors are GOOGLE's fault... not mine! :_)))
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3