Re: Architecture question...overthinking again :-)




"MP" <nospam@xxxxxxxxxx> wrote in message
news:OnG$JHRNHHA.1252@xxxxxxxxxxxxxxxxxxxxxxx
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


Hard to advise whether to stop overthinking or to just rethink the whole
thing.

First drop 'decompose' from your vocabulary. That is something that belongs
to structure programming, not OO.

Drop cData. That is obviously leading you into a data-centric design. Again
we are back to structured programming.

As you noted, merely breaking umpteem subs and functions into related
modules (VB classes) doesn't do anything except making it easier to find
stuff. But you could do that with just judicial naming and the Browser.

IMHO, you need to shutdown the IDE and go visit online or in person a book
store and find something on Object Oriented analysis, design, or
programming. Spend some time with a good book and a yellow pad.

-ralph


.



Relevant Pages

  • Architecture question...overthinking again :-)
    ... 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. ... findings in a listview on a form(with the help of cListView) ... somethings happening so I have a frmProgBar to show a progress bar ...
    (microsoft.public.vb.general.discussion)
  • Re: using fujitsu power cobol and crystal reports
    ... > You stated that you're able to put the "embedded designer control onto ... Are you designing the report inside your program? ... Move "CrystalRuntimeApplication" TO WK. ... INVOKE CApplication "OpenReport" USING CReportName RETURNING CReport. ...
    (comp.lang.cobol)
  • CListView listing items in other views but not report view
    ... I'm working on a program that contains a CListView. ... into it, they're visible in all views (icons, list) except in report ... The column headings I created are visible in ... report view though. ...
    (microsoft.public.vc.language)
  • Re: uncleared code
    ... but i cant change the font directly in creport. ... right click the field and format but i cat reflect on report ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: uncleared code
    ... but i cant change the font directly in creport. ... right click the field and format but i cat reflect on report ...
    (microsoft.public.dotnet.languages.csharp)