> Please redirect me if there's a better location for general architectural
> issues re: object oriented design
"comp.object" probably comes as close as any in posting questions concerning
"general architectural issues", but it is low traffic, and if you suggest
using VB you will get no response or a lecture on the requirements for a
language to be considered an OOPL. Other Forums are academic and you better
know GOF, Fowler, Meyer, etc., forward and backwards, else again you will
either be ignored, lectured, or told to get a good book. (Corollary to being
told to RTFM. <g>)
So give comp.object a shot, but leave VB out of your post.
Most newsgroups (the useful ones anyway) are all dedicated to a specific
language, platform, or design tool. AFAIK there isn't a highly populated one
for classic VB.
-ralph
MP - 15 Sep 2008 21:26 GMT
>> Please redirect me if there's a better location for general architectural
>> issues re: object oriented design
[quoted text clipped - 4 lines]
> using VB you will get no response or a lecture on the requirements for a
> language to be considered an OOPL.
Yes, well, of course my inclusion of vb6 was merely a sleazy attempt to make
it look slightly on topic so you would respond <g> with your usual OO
wisdom...
guess it was too transparent <g>
mark
> Please redirect me if there's a better location for general architectural
> issues re: object oriented design
[quoted text clipped - 4 lines]
> one that wraps database functionality IDBController.cls (either ado or
> sqlite implementations)
IMHO - This is where is all goes wrong.
When doing OOA/OOD I suggest you drop the terms "...Data" or "...Database"
from your vocabulary. "Object-Oriented" analysis and design is the opposite
from "Data-Centric" analysis and design. Those terms are filled with
subjective connotation which can taint your solution.
I suspect that is what has happened here. Objects that need to be stored
likely need the services of IDBController. It is also easy to visualize why
IDBController needs to be versioned (Specialization). But it is not clear
why any object would need the services of a "Block of Data". Objects are
methods(rules) AND data.
I think you will find that cBlockData is an unnecessary abstraction, not a
first-class object, and is not useful within your domain.
But then I don't really know squat about your domain.
-ralph
> currently it seems i have two options for passing info from one to
> other If i give the cBlockData object the responsibility to "Push info into
> " a database, I pass a db object into the blockData object
> in cBlockData
> Sub ToDatabase(oDbController as IDBController)
The good choice...
> ....
> but if i give the responsibility to the dbController to "Pull info
> from " a source object I pass the cBlockData obj to the cDB obj
> in cDbController.cls
> Sub ProcessBlockData(oBD as cBlockData)
> ....
The bad choice.
Asking all implementations of IDBController to know all about how to store any
objects that might be passed to them is nutty. The place for code that knows how
to store a particular kind of object is in the class definition of that object.
> either way I couple two objects that sometimes belong together and
> sometimes don't have to both live in a given project.
Oh, my, that would be ... perfectly normal. Do all your VB apps use all the
classes defined in VB?
Particularly since the name IDBController implies it is an interface, and would
carry virtually no baggage for an app that was only using cBlockData. Even if
you only had the actual class, and it added 200K of unneeded code, well so what.
MP - 16 Sep 2008 03:12 GMT
>> currently it seems i have two options for passing info from one to
>> other If i give the cBlockData object the responsibility to "Push info
[quoted text clipped - 24 lines]
> Oh, my, that would be ... perfectly normal. Do all your VB apps use all
> the classes defined in VB?
:-) good point...
sometimes i just overthink things <g>
> Particularly since the name IDBController implies it is an interface, and
> would carry virtually no baggage for an app that was only using
> cBlockData. Even if you only had the actual class, and it added 200K of
> unneeded code, well so what.
Thanks for the input. By sheer dumb luck that was the choice I had made and
how it's structured.
I just wasnt' sure if I was going in the right direction.
...the reason I had considered the other way around is I realized my current
design has
cBlockData.ToDatabase(oDbController) writing a record for each object in a
collection....
where i have some hundreds of objects each writing a single record it makes
more sense to collect them all and write once
so I just need to resturcture my "supply side"
'instead of the current version...
'................................................................
in Documents.ToDatabase (oDbController)
For Each oDoc in oDocs
oDoc.ToDatabase (oDbController)
Next
...and...
in Document.ToDatabase (oDbController)
For Each oBlkData in oDoc
oBlkData.ToDatabase(oDbController)
Next
'................................................................
I should do something like
oDocuments.ToDatabase (oDbController)
'gather all data from all docs and send once to db
AllDataFromAllDocuments.ToDatabase(oDbController)
Thanks
mark
Steve Gerrard - 16 Sep 2008 03:32 GMT
> ...the reason I had considered the other way around is I realized my
> current design has
[quoted text clipped - 3 lines]
> makes more sense to collect them all and write once
> so I just need to resturcture my "supply side"
I think that should be the job of the DBController. It is quite common for the
DB object to gather up the various records, then set about actually saving them
in whatever way is suitable for the actual database. I would probably just have
some method on the DBController called SaveChanges, which would indicate that I
was done writing things, and now would be a good time to actually commit them to
the database. Depends what DBController is actually doing, of course.