Although I'm not sure why you'd return Object. You'd be as well returning the top-most Super class.
You mean use Create:A()? Probably would work just as well in my example. I was just trying to spit out an example of how you can change the initializing order of extended types and Object is a base Type that is common to every one.
Of course, returning Object makes more sense if you could be extending more than one base class. Suppose you have a Type which works with OpenGL and another that works with DirectX and you need to extend whichever one you need, then you couldn't just return TMyOpenGL or TMyOpenDirectX because then they all would have to return the same thing or you will run into a compiler error.
Type TMyDirectX Method Create:Object() 'Do Stuff End Method End Type Type TMyOpenGL Method Create:Object() 'Do stuff End Method End Type Type TMyGraphics Extends TMyDirectX 'Extend TMyOpenGL for OGL programs Method Create:Object() Super.Create() Return Self End Method End Type Local MyGraphics:TMyGraphics = TMyGraphics(New TMyGraphics.Create())
Of course, I could just create a base TGraphicsDriver class, abstract everything that is needed to be implemented by TMyDirectX and TMyOpenGL, then return TGraphicsDriver. Not sure though, how adding an extra abstracted layer would affect performance (I would imagine that performance wouldn't be affected at all).