QB45 Forums
Party like you didn't do in 1999.

Programming Talk - View Post
Anything related to programming under the sun

Brass Orchid
NORMAL

Posts: 75
Classes and Object Design -quote
Posted by Brass Orchid, on Aug 28th, 2005
note: structs in C are like TYPEs in QB

Classes are like structs in C, but they include interesting
things for OOD, such as functions and overloaded operators.
They also embody the principles of inheritance, polymorphism,
and encapsulation, upon which the OOP concept is based.
Classes are like control objects on a form in VB. The control
objects available for placement on a form in VB actually ARE
C++ class objects in a .DLL file accessible via VB. If you have
the entire Visual Studio, then you have the source for most of
the control objects found in VB. In a C struct, you can include
whatever data types you need, and even pointers for functions to
control the data flow and alteration. C++ allows functions to be
part of a struct called a class. A class may be based on another
class already in existence, inheriting all its properties and
functionality. Further data, properties, and functionality may
also be added to or replace existing elements, which is known as
polymorphism. Data encapsulation is achieved by making all data
within the class private so that no other code may obtain scope
for it to read or alter it. All interaction must be through the
functions built into the class.
Classes are OOP data modules.
Methods are functions to access the data modules.
The draw method for a form is a function to access the API code
to interact with the data which comprises the rectangular area
of the form in the GDI. (Graphical Device Interface)
The form itself is a class data object.
Control objects within the form are polymorphic additions to the
form object.

Back to Programming Talk


We will shun all technology, remove all memory of our flawed elders, and create a new world and man in our own perfect image!
Replies:
There are no replies to this message

Post a reply:







All content copyrighted 2004, All rights reserved.