Re: How Big is Too Big?
- From: "Schmidt" <sss@xxxxxxxxx>
- Date: Wed, 29 Nov 2006 14:56:44 +0100
"Michael C" <nospam@xxxxxxxxxx> schrieb im Newsbeitrag
news:efcpQY3EHHA.2176@xxxxxxxxxxxxxxxxxxxxxxx
"Schmidt" <sss@xxxxxxxxx> wrote in message
news:O7ZQWI3EHHA.996@xxxxxxxxxxxxxxxxxxxxxxx
[TypeOf, LateBinding and Common-Interfaces]
No, first you should describe for me, what do you thinkDescribe for me an interface then.Clearly you don't know what an interface is.If you say so...
IDispatch (and IUnknown) are.
Again, working with them is the same.No, working with them is the same. :-)AGAIN, it is similar but NOT the same...
...Are you dense?No, I'm only *patient*. :-)
I hope you remember, where the topic was coming from.If you don't believe me, then look into the MSDN.No, Jim stated it *can* be late bound. There is a big difference
Jim already has posted a link, where is stated, that using the
common Form-interface means LateBinding.
that you clearly don't get.
You was asking, how to access the Forms-Collection of the
MainApp (probably to get the information, if a GUI-Module
already is loaded, to get a reference to it and use its functionality
from other components if so - or to instanciate a new GUI-
Module if not).
In a "NonComponentized", "normal" App you would write:
Dim Frm as Form
For Each Frm in Forms
If TypeOf Frm Is TheNeededType Then
ReturnWithThisReference 'so you can cast and use it
Exit Function
End If
Next Frm
ReturnWithNothing 'signalize, that you have to create a new instance
I was replying, that in a dynamic, OCX-based scenario the
same task could look like this:
Dim Frm as Form
For Each Frm In Parent.FormsCollection
If TypeOf Frm.DynOcx Is TheNeededType Then
ReturnWithThisReference 'so you can cast and use it
Exit Function
End If
Next Frm
ReturnWithNothing 'signalize, that you have to create a new instance
That solves perfectly your problem of getting a reference from
inside B1 to use (E-Mail-)functionality in an (possibly) already
running B8.
That's why I've told you, that I already answered your question(s).
But the GUI-components in B1 to B8 have to be implemented
as OCX's then and not as "Dll-Forms". And that recommendation
was made (even by others in this thread) before too.
Anyway; you replied to the above:
"All looks pretty messy to me. Lots of late binding."
Hmm, first *you* should decide, what holds true now.
Is it LateBinding for you or not.
For me it is, yes.
But after returning from this Forms-Loop you can
cast to your concrete FormType (or OCX-Type).
If you want, you can make the example as "complex" as you can.It *is* simple, but probably you'll be overstrained with this task.You want it to be simple so you can post a simple reply.
I would in either case show you the dynamic pendant.
But as I told you before, that is not needed, because the few
differences to a "normal" Application can be addressed in a
very basic example.
You don't get it.Yep, as I told you before. You will have to split your business-So now we have 10 guid dlls and 10 business logic dlls and 10
logic too into separate Components C1, C2, etc., to avoid
problems using the approach - ergo the approach forces you
to split, wich leads to a better overall-design.
database dlls...
You have to design your business-logic in a way, that you can
reuse the code in your GUI-components without Code-
Duplication.
That does *not* mean, that every GUI-Component B1 to Bn
needs appropriate pendants C1 to Cn.
If you do it right, then e.g.:
B1 to B3 use only C1
B4 to B6 use C1 and C2
B5 uses only C3
B6 to B8 use C2 and C3
(In my thinking, the direction is the opposite, more BL-centric:
C1 uses B1 to B6
...
C3 uses B5 to B8
But if i'd come up with this now, then you'd probably be totally
confused)
But C and D both have many many classes that are sharedIf it is messy, then your design of C and D is wrong.
and duplicated. This is very messy.
You should get a good book about this topic.
If you do it right, then there's no problem, to split your
Business-Layer C into more than one Dll.
If e.g. C3 itself needs something from the already finsihed C1 -
where is the problem, to reference C1 inside C3 and
use the C1-functionality over a stable interface.
I subclass in my application.Whoaa. ;-)
If the usercontrol needs to subclass the form it will need to obtainIf you need the hWnd of the GUI-Component, then use
hWnd etc. This *is* part of the problem ...
UserControl.Hwnd inside the OCX - if you need the hWnd
of the generic HostForm, then use UserControl.ContainerHwnd.
No clue, what your problem is.
Yep - and in a really bad way "crossreferenced", that youCurrently you are in a position, where you can say:I think the real problem with the slow startup time is that too
"Ok, my app needs 50 seconds to start, but it is very well
designed, because I've placed all my Business-Logic in only
one Dll and avoided LateBinding completely."
Sounds somewhat alien, right?
So where do you wanna go today? <g>
much code is in the GUI layer.
cannot split it up with ease into separate Components.
Well designed GUI components shouldn't need to know
much about each other.
Business logic code wasn't farmed out to appropriate dllsYep. Functional Splitting of your BusinessLogic is needed and
well enough.
not a dumb B1-C1, B2-C2, ..., Bn-Cn approach.
Although the *real* root of the problem is that VB6 is notI would say, the real root of the problem is, that your mind seems
*scalable*.
not very scalable. ;-)
SCNR
Olaf
.
- Follow-Ups:
- Re: How Big is Too Big?
- From: Michael C
- Re: How Big is Too Big?
- References:
- Re: How Big is Too Big?
- From: Michael C
- Re: How Big is Too Big?
- Prev by Date: Re: Print to Printer driver or Print to USB printer using open Port
- Next by Date: Re: usb hardware group?
- Previous by thread: Re: How Big is Too Big?
- Next by thread: Re: How Big is Too Big?
- Index(es):