|
-
Apr 19th, 2001, 08:45 AM
#1
Thread Starter
Addicted Member
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?
-
Apr 19th, 2001, 08:58 AM
#2
Retired VBF Adm1nistrator
Why do you want to use class modules ?
I avoid the things like the plague personally ...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Apr 19th, 2001, 08:59 AM
#3
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
-
Apr 19th, 2001, 09:00 AM
#4
Lively Member
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
-
Apr 19th, 2001, 10:25 AM
#5
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.
-
Apr 19th, 2001, 10:45 AM
#6
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 !
-
Apr 19th, 2001, 10:59 AM
#7
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.
-
Apr 19th, 2001, 11:02 AM
#8
-
Apr 19th, 2001, 11:07 AM
#9
Retired VBF Adm1nistrator
an information system.
duh .... er ....
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Apr 19th, 2001, 08:49 PM
#10
Thread Starter
Addicted Member
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.
-
Apr 20th, 2001, 01:52 AM
#11
Retired VBF Adm1nistrator
I think you're talking about inheritance ...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Apr 20th, 2001, 06:37 AM
#12
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|