A previous question asked why some other methods are public instead of protected, and the answer was that they at some point needed to be called by utility functions that weren't attached to the class.
TObject.AfterConstruction
is called by just such a utility function, System._AfterConstruction
. If it were (strict) protected, then that standalone function wouldn't have access to the method.
All the methods of TObject
are public.* We can probably find rationales to explain why each method is public, but at a certain point, I suspect that the underlying reason for any given method being public is that all the others are, too.
Once Delphi was released with those methods public, any reduction in their visibility would have risked breaking existing code.
* Except for GetDisposed
and CheckDisposed
, for some reason. They're relatively new, compared to the bulk of TObject
.
it's been
aboutTObject.InitInstance
, and does not directly answer what you ask. But as you can see, there's more that should've been protected but it's not. Taking back my initial comment... – Plummerprotected
back then. – MoravianTVirtualMethodInterceptor
– Charissacharisse