Results 1 to 7 of 7

Thread: What exactly is a Class Module?

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    I just wanted to know...

    What exactly is a Class Module? and How does it differ from a BAS Module?

    (I need a new thing to start learning so I figured why not Class Mods)


    (and if anyone feels up to it...post some code for some simple class modules and maybe how to implement them)

    Thanks!

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    The idea with Object Orientation is to encapsulate code into Classes which will act as a blueprint for objects. Objects are way to group components and properties, and methods that are put together as an abstract entity. If you already know, user defined types (UDT) are way of doing this, grouping variables into one entity you can work with and pass around as one variable. The difference between them and Classes are that you group methods to act as a interface for the variables. You can't really compare standard module with Classmodules. They are both code repositories but standard module code is global within the project. The classmodules although you have to access them by their name as objects, they can be shared and passed between projects, if you put them in ActiveX Dll's or Exe's.
    There is still much to say about Object Orientation in general, but i'm sure you wouldn't want to have it all at once. There's many topics around the forums about classmodules if you want to read later, you could just search on the topic.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    cool...

    Thanks fors the 'quick' overview...I think I am grasping the idea behind it.

    Thank you very much!

    (The UDT was the perfect way to describe it...I understood that)

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4

  5. #5
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Sydney Australia
    Posts
    804

    Lightbulb

    I found the com course part one a very clear and very easy intro to Classes, check it out and make your own dog class step by step including Enum and Event:
    http://www.vb-world.com/activex/comcourse/

  6. #6

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    good stuff..

    Thanx again!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Dont forget though that true OOP will allow inheritance, polymorphism and encapsulation. VB does not have inheritance and its polymorphism sucks. They have just implemented the easy bit. Try Delphi - that really is OOP.

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width