VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Classes vs UDTs David Goodlad (4 replies, 0 views) (2000-Jul-21) Well, first thing: data encapsulation. With a class, all the data is only modifiable by the object that owns it; therefore, you have functions that 'get' and 'set' the data in the object, but verify all the data, and do any necessary converstions or whatever on it before it gets stored or sent to the user.
Secondly, expandability. With a true class system (with inheritance; this is coming in vb7), you can expand on base classes that you wrote already, and add 'features' to it but only for specific purposes. It's kinda hard to explain, as I'm not a complete OOP guru, but I have it clear in MY head :P
Other than that, there are all sorts of design reasons and stuff that support the use of classes. There have been many discussions about this type of thing in C++ over on places like gamedev.net.
HTH :)
David
|