Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Newbie question - 1 or mult. class modules? (http://www.programmingforums.org/showthread.php?t=13245)

ryan79 May 30th, 2007 10:56 AM

Newbie question - 1 or mult. class modules?
 
I'm trying to create a program in VB which will calculate various physical properties for a chemical stream.
I want to make it a function based call where the user can simply type in excel =ViscosityOfStream(highlight cells of the names of the components, highlight cells for the weight percents, temperature).
I want to make this is as easy to understand as possible - and w/ that - easy for someone else to pick up where i leave off on this project.

So to my question - Should i make 1 class module and make everything a subset of that, or would it make more sense to make multiple class modules based on the physical property.

This get's confusing because some calculations will rely on what else is in the stream w/ it rather than just averaging based on the mole fractions or weight percents.

As i read through this post, i'm afraid no one will understand what i'm talking about - BUT we'll give it a try anyhow.

Thanks!

mackenga Jun 10th, 2007 4:31 AM

Well, I for one don't quite understand it! A class roughly corresponds to an entity of interest to your program. Although I'm not at all sure I understand properly what you are trying to achieve, it sounds like a chemical stream is an object of interest so I'd say a class representing one of those with various properties would be the most intuitive to future maintainers and anyone calling your code. So you might end up with:

=MyStream.Viscosity(...)

...in your Excel cell. I haven't actually worked with VBA but that's what I'd volunteer based on my knowledge of VB6.


All times are GMT -5. The time now is 11:23 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC