Because the Custom page is generic in format, I can customize the subheadings and text below to fit any purpose and any subject.
A Class inherits from another class or acts as original class.
1 * A Class inherits from another class or act as original class.
Object oriented language use Class to indicate it's relationship and where it's come (originate) from. Class can be abstract or inheritance, and in Delphi Class begin with "T"
Sample below is an original class. Type ........TOrginalClass = Class End; |
Sample below is an inheritance class. Type ........TDescendantClass = Class(TAncestor) End; |
* Any deviation from ancestor causes polymorphism
* Any deviation from ancestor causes polymorphism.(1/4)
Any changes from ancestor even very small is call "polymorphism". Normally we inherit old Class and modify it to improve it's performance.
For example. Type ..........TAnyClass = Class(TOriginalClass) .... ..........Procedure DoThis; (polymorphism in original class) End;
Type ..........TAnyNewClass = Class(TAnyClass) ......... (polymorphism TAnyNewClass to be different from original class) ..........Procedure DoThis; End; |
Therefore our new class can change method (procedure) DoThis
Procedure TAnyNewClass.DoThis; ..........Begin ..........Inherited; <from ancestor> ........................... <then do this new> End; |
Or
Procedure TAnyNewClass.DoThis; ..........Begin ..........If <condition> then <do this new> ..........Else Inherited; <do the old> End; |
Or
Procedure TAnyNewClass.DoThis; ..........Begin ...................... <do this new> ..........Inherited; <follow the old> End; |
* Descendant Class is always greater than or equal to its' ancestor
2 * Descendant Class is always greater than or equal to its' ancestor.(1/2)
Class which inherit from ancestor class always got the SAME ancestor gene, or ENHANCED MORE than features than ancestor gene (in human can be less features of course). It's as clear in plain English as it is and simply as below. Example , if we take another programmer class, we can create a better and smarter class (don't forget license from that programmer too).
Insert Another Sub Header Here
Insert descriptive text which supports the above header. Insert descriptive text which supports the above header.Insert descriptive text which supports the above header. Insert descriptive text which supports the above header.
* Object can consist of two elements (Data and Method)
3 * Object can consist of two elements (Data and Method)
When combine these 2 elements we called "Encapsulation". Data contains property of that object (in English language would be adjective)
In Delphi, we call data as "Property"
Method is how thing is done (in English would be action or verb, or adverb)
In Delphi, we call Method as "Procedure" or "Function"
Type ..........TAnyClass = Class(TOriginalClass) .... ..........Data = (Object, Real, Extended) ..........Procedure ..........Function End; |
Insert Another Sub Header Here
Insert descriptive text which supports the above header. Insert descriptive text which supports the above header.Insert descriptive text which supports the above header. Insert descriptive text which supports the above header.