Whats the advantage of all classes derive from a main one

Hi guys.

.

My doubt is about the advantage of all classes of my application be derived from a main one, I saw this in the first time in delphi where all class derives from TObject, I never saw this in books I read.

Thank you in advance.

tcpbox
Last edited on
It's not an "advantage" so much as it is a design consideration. Polymorphism allows you to call member functions of derived classes form a pointer to the base class they came from. This can greatly simplify your code, but it is not always 100% appropriate everytime.
Topic archived. No new replies allowed.