Mike Yearwood
Toronto, Ontario, Canada
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Catégorie:
Programmation Orientée Object
Versions des environnements
>>>So, NewObject can be used in either case. AddObject is only used with a container. CreateObject would be used in a non-visual, non-container class. I can use either NewObject or CreateObject in my case then. Why even have CreateObject if NewObject can do the same thing?
>>
>>The NewObject() allows to specify class library as second parameter. The CreateObject() requires SET CLASSLIB beforehand. You could find that from the help though.
>
>Sure, but then what the hell would you do with your time?
Newobject came about long after createobject. All of this is beside the point though. Hard coding classnames with newobject or createobject limits your flexibility. Use an abstract factory object. You give it a name and it looks up the name in a table and gets the classlib and classname from the table.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement