Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewObject() vs AddObject()
Message
From
14/02/2008 12:27:02
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01292009
Message ID:
01292680
Views:
24
>>>>There's no AddObject() function in VFP. I guess you're refering to NewObject() and AddObject() methods. If that the case than NewObject() method is very similar to the NewObject() function and AddObject() method to the CreateObject() function.
>>>
>>>Sorry, I was referring to the methods. Any relevant difference between .AddObject() and .NewObject()?
>>
>>The .AddObject() and CreateObject() rely on SET CLASSLIB and SET PROCEDURE (non-visual classes) to find a class to instantiate. The NewObject()/.NewObject() allow to specify a class library/.FXP as parameter.
>
>So why ever use AddObject() again? Why not always use NewObject(), as it seems more flexible?

The most flexible of all approaches is the object factory. We always have to balance performance against programming time.

http://weblogs.foxite.com/andykramek/archive/2007/08/04/4508.aspx
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform