Re: connection points?
From: Phil Da Lick! (kjhgjhfgfdjgkjkhfdghhjfd_at_hkfhkgjfdhhfdg.spam)
Date: 02/24/04
- Next message: Igor Tandetnik: "Re: connection points?"
- Previous message: Matt Ramme: "ITextServices and TxGetNaturalSize"
- In reply to: Igor Tandetnik: "Re: connection points?"
- Next in thread: Igor Tandetnik: "Re: connection points?"
- Reply: Igor Tandetnik: "Re: connection points?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Feb 2004 22:22:35 -0000
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:OTPK0Nu%23DHA.3452@TK2MSFTNGP11.phx.gbl...
> "Phil Da Lick!" <phil_the_lick@nospam.hotmail.com> wrote in message
> news:1WF_b.9812$h44.1099836@stones.force9.net...
> > Thanks both, I think what I'll do is just pass a pointer to the
> required
> > interface into the children. They are defined entirely within the
> scope of
> > the parent. When the parent dies, the children die as well so this
> shouldn't
> > be a problem.
>
> What if the client still holds an interface pointer of the element? You
> can't have an element destroyed, or the client will crash the moment it
> calls anything through that pointer.
erm I think I'm getting confused about your terminology now, as I did when I
read up on connection points. Basically I have an object which holds a list
[collection] of other objects. The list is not incredibly dynamic, and all
add/remove functions will go through the parent object. When the parent
object dies, all children die. No child will die before the parent unless it
is the result of a proper delte operation within the parent's list
functions. No child object exists before the parent is created.
> > I just wondered whether the "correct" approach was to use a connection
> > point, that's all.
>
> Connection points are designed for loosely coupled components -
> components that have little or no a-priori knowledge of each other. You
> don't really need such a heavy-weight mechanism for tightly coupled
> components - components that are designed from the start to integrate
> with each other, often on the source code level. You don't even need COM
> for that - they can just hold straight C++ pointers to each other.
Sounds like the best way is as described in this thread. From what you've
said here CP's are overkill.
- Next message: Igor Tandetnik: "Re: connection points?"
- Previous message: Matt Ramme: "ITextServices and TxGetNaturalSize"
- In reply to: Igor Tandetnik: "Re: connection points?"
- Next in thread: Igor Tandetnik: "Re: connection points?"
- Reply: Igor Tandetnik: "Re: connection points?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|