Results 1 to 12 of 12

Thread: Confused...

  1. #1

    Thread Starter
    Addicted Member _Yoyo's Avatar
    Join Date
    Apr 2001
    Location
    Dominican Republic
    Posts
    187

    Unhappy

    Q: When developing an information system, which are the essential things (if they exists that is) i'm suppose to put in a class module?

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Why do you want to use class modules ?
    I avoid the things like the plague personally ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    you normally have a team for this type of thing, or sit down and look at the possibilities for your project.

    There isn't really a simple answer to this one. The idea of a class module is reusing your code. I.e. if you have a button on all your forms that when pressed shows a messagebox, you would put this in the class module :
    Code:
    Public Sub Msg()
       Msgbox "Hello World !"
    End sub
    Then rather than typing out the above under each button, you only need to type the word "Msg" and this class modules sub above is called and the message is shown.
    This is the basic idea of the class module, and will depend on what code you think will benefit your project / you can reuse.

    I would agree with Jamie on this side through, the use of these is maily the same as a normal module, and I'd stick to them

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    Lively Member
    Join Date
    Apr 2001
    Location
    Central NC
    Posts
    75
    You're having that problem because you're trying to deal with an implementation issue while still in the design phase.

    Don't worry about HOW you'll implement something until you know WHAT you'll be dealing with. About the only time that sort of thing arises at design time is when the designer is doing a cost/benefit analysis of a particular feature. In such a case, the designer relies on experience to gauge what is feasible and how dificult it may be to implement

  5. #5
    spetnik
    Guest
    a class module largely differs from a Module, and has many benefits. First off, u can instanciate a class module. It is an object that has properties and methods. It is one of the most powerfull features of VB. It is the essence of Object Oriented Programming. Class Modules can implement each other, and u can have subclasses that derive methods and properties from their parents. A Module on the other hand is just a plain code window. It is usefull for public variables and functions that may be accessed from more than one form only. To create professional object oriented projects, class modules are a must.

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Code:
    class modules are a must
    Admittedly, I didn't go into property let or createobject as I didn't want to get too complicated. Okay, yes you're right that they're different to standard modules, but the reusable code is why they are there.

    With your statement, I would say 100% that this is an option to be considered when designing the functionality and use of the program. If you have a 1 form calculator program, then the "are a must" bit doesn't always need to come into play and I have no idea what he's designing !

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7
    spetnik
    Guest
    Originally posted by spetnik
    To create professional object oriented projects, class modules are a must.
    Thanx for misquotting me I, personally dont c a 1 formed calculator being an object oriented program. But, depending on how fancy this calulator is, yes, it is not to far fetched to be using class modules. For example, you can have a class which extends the command button, and instanciate an array of this class and reference it to the buttons on the form. but yes, u r right, most likely a calculator will not need a class module.

  8. #8
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Thanks for quoting my misquotement

    Appologies for that one, yep, they're a must for OOP & I'm wrong to argue when I can't read the bloody post right
    Just what are you designing anyway Yoyo ?!?!?!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  9. #9
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    an information system.

    duh .... er ....
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  10. #10

    Thread Starter
    Addicted Member _Yoyo's Avatar
    Join Date
    Apr 2001
    Location
    Dominican Republic
    Posts
    187
    I'm trying to develop a system to handle the suscriptions of a News Paper. I've seen other projects like this b4 but written in Visual FoxPro and thise guys use classes but their are more powerfull 'cause if you desing a class based on a form (for instance) you can use it and create subclasses and use those subclasses, etc., but if you decide to make a change to the father class (let's say change the backcolor property), the rest of the classes depending from it will change too. I don't know if you got my point but i'd like to know if that's possible here in VB.

  11. #11
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I think you're talking about inheritance ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  12. #12
    spetnik
    Guest
    Polymorphism and Inheritence are possible with VB, although admittedly, polymorphism is much easier. U can write "Implements ClassName" as the 1st line in a class module. Inheritence, however, requires you to have a Private instance of an object, and then to create Property Get and Let procedures to complete the inheritence. Although this is a pain, this will hopefully be made easier in .NET

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