@CattleRustler
I think you are confusing things a little. You are explaining the VB.NET definition of a class. VB.NET classes are somewhat different to visual C++.
@Moonshine
Think of an object in real life, like say a car. If you made a C++ class out of a car it would have properties: color, number of wheels, shape, and it would have methods: start(), changeGear(), brake()
The reason classes were introduced is because when a project gets very big (say 100,000+ lines of code), it becomes exceedingly difficult to manage with DBPro-like languages, and a tiny change in one place can result in nasty crashes elsewhere. Also, if someone else came to work on your code they would have no idea how to work with it.
Classes effectively "black-box" parts of your program. You can play around with the internals of a class, and as long as you don't change the bit that is exposed to the outside world, it won't affect the rest of your program.
If someone else comes to work on your code, they only need to know what the inputs and outputs of a class are, they don't need to know how it works inside, in much the same way that you don't have to know what happens when you turn a key in the ignition to start the car. You just know that the engine starts.
There are lots of very fancy names which people talk about with classes, but most of them have fairly simple meanings, such as:
Inheritance - You might have several classes that share certain properties, in which case you create a "parent" class that has all of the common stuff in, and then you create a new "derived" class which can do everything that the parent can do, plus more.
For example, you might have an
Animal class which has methods like grow() and fightDisease(). Derived from that could be
Cat and
Dog classes which have everything that the animal class has, plus methods like woof() or meow() and new properties like
numWhiskers.
Polymorphism (Horrible word
) - I use this in my current Blue plugin a lot. The "parent" class for all gadgets is the CGadget class. All gadgets have a create() method which makes the gadget. However, the actual code for create() needs to be different for different types of gadget. Hence I write a create() method for the CGadget class but mark it as
Virtual, this means that classes derived from CGadget have their own create() method, and the program should use that instead if it exists.
BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games. - Plus URL download, win dialogs.
Over 140 new commands