|
FoxDataObjects |
Object-Relational Mapping Tool for Visual FoxPro® |
|
|
CreateObject Method |
||
|---|---|---|
|
Creates an object instance from a class definition. For persistent classes, it also labels the object and initializes references and collections.
|
|||||||||
|
Parameters |
|||||||||
|
|||||||||
|
Return Value |
|||||||||
|
|||||||||
|
Remarks |
|||||||||
|
This method tries to instantiate an object instance and returns the object pointer if successful, or the .Null. value instead. For not persistent or mapped classes, this method behaves exactly like the CreateObject() native Visual FoxPro Function. For persistent classes this method enhance the native CreateObject() function by performing additional steps like:
The use of the Session.CreateObject method instead of the native CreateObject() function is encouraged because your business objects are labeled and linked to the Session object right after they are created, allowing them to access all the persistence services at any time. Moreover, using class events like OnCreate, AfterCreated, OnRetrieve, AfterRetrieved, etc. on your business classes, simplifies all your class code whenever your business objects are created or retrieved from the database providing a powerful and robust "framework" for your business classes. For a complete reference on persistent class events, please see this reference index.
|
|||||||||
|
See Also |
|||||||||
| Session.GetObject method | Session.DeleteObject method | |||||||||
| Applies to: Session object | |||||||||
|
Send feedback on this topic to RunAhead Technologies For Technical support and product issues please contact us at support@foxdataobjects.com or visit http://www.foxdataobjects.com |
Copyright (c) 2000-2005 RunAhead Technologies