Architecture question...overthinking again :-)
- From: "MP" <nospam@xxxxxxxxxx>
- Date: Wed, 10 Jan 2007 17:48:56 -0600
warning ... two part question ahead :-)
....I'll blame it on the fact that I'm again re-reading "Code Complete" <g>
Working on an app, trying to "decompose" it into objects.
I don't think it's germane but it happens to be an axdll run from a std exe.
So I have a class(dll) that manages some other classes(to do various jobs),
we'll call it cManager <g>
If I want a report on a database it creates a cData class to handle
accessing a database and cReport to handle reporting on results.
cManager passes cData to cReport ... Set moReport.DataSource = moData
cReport reads the database (with the help of cData) and then reports it's
findings in a listview on a form(with the help of cListView)
cListView handles formatting headers and entering data into a listview on a
ReportForm
which brings us to the first question <g>...you were beginning to wonder
eh?? ...
question 1)
Is this completely stupid to break this all up like this?
It does seem to be helping me keep track of what i'm doing where(with my bad
memory thats important<g>) compared to when it was just umpteen subs and
functions in one module...but i do wonder if breaking out every little job
into it's own class (like setting up a listview) is overdoing it ???
and for the second question....
while all this is going on, I want to give the user indication that
somethings happening so I have a frmProgBar to show a progress bar
cReport creates frmProgBar, sizes up the quantity of data, sets pb.Max and
increments while it's "Reading Data"
then cReport hands off frmProgBar to cListView
... Set moLv.ProgBar = Me.ProgBar
so cListView can increment pb while it's loading the listview(which for some
unknown reason is not instantaneous??)
When cListView is done with it, it can destroy it and show it's
ReportFormWithListView displaying the results of all those conflumerrations
<g>
Then ReportForm.CmdClose_Click event raises Event Done
clistView receives that event and raises it's event Done
cReport recieves that event and raises it's event Done
cManager receives that event and re-shows it's .MainForm to await further
instructions
question 2)...whew...thought we'd never get there ...<bg>
Is this a reasonable structure or is there a better way for two classes to
share a common form instance?
....or should they not... maybe each should create it's own instance and
show/destroy at will?
any advice for a confused amature?
Thanks
Mark
.
- Follow-Ups:
- Prev by Date: Re: What microsoft has to do with...
- Next by Date: Re: Visual Source Safe 6
- Previous by thread: Re: using a keyboard hook VB 6
- Next by thread: Re: Architecture question...overthinking again :-)
- Index(es):
Relevant Pages
|