>oApp = CREATEOBJECT ("myApplicationClass") --> also instantiates oFormsMgr, oConnMgr >oApp.oFormsMgr.MyMethod() >oApp.oConnMgr.SomeOtherMethod() >>
>oApp = CREATEOBJECT ("myApplicationClass") > >IF NOT oApp.Connect() > MESSAGEBOX( 'Unable to connect' ) > ** do whatever else >ENDIF > >PROCEDURE Connect > LOCAL llResult > oConnMgr = CREATEOBJECT( 'myConnectionMgr' ) > llResult = oConnMgr.Connect() > RETURN lnResult >>
IF This.oConnMgr = .F. THIS.oConnMgr = CREATEOBJECT("ConnMgr") ENDIF RETURN THIS.oConnMgrThat way you can still use code like 'x = app.oConnMgr.Connect()' but without incurring the overhead of creating an instance of ConnMgr unless it is required.