- OLE Design Architecture
- Posted by Raja on May 11th, 2008
Hi All,
I am a newbie to OLE technology and started up with
http://www.relisoft.com/win32/olerant.html in which the author
presents the statement "Anybody who knows C++ can do it with their
eyes closed. So why can't you do the same in OLE? Here comes the Flaw.
You have to be able to obtain the IBar interface from the IFoo
interface using its QueryInterface. But, wait a minute, the object
FooObj that provides the implementation of all methods of IFoo,
including QueryInterface, had no clue about IBar! It could have been
created long before anyone even thought about the possibility of IBar.
So how can it provide access to IBar?
Good question. I'm not going to go into the gory details of the
aggregation hack that is supposed to solve this problem. Given the
constraints of the flawed initial design, it is a truly ingenious
hack. So is there a better design? Read on..."
Can anyone please explain what the hack is ? Any pointers to better
understanding of design as well, is appreciated.
Thanks,
Raja.
- Posted by boris on May 12th, 2008
"Raja" <rokkamraja@gmail.com> wrote in message
news:41d3180b-f916-40fa-ab69-b2bd02bb3cca@b64g2000hsa.googlegroups.com...
The idea: when COM object FooObj is instantiated as part of COM object
BarObj, FooObj (duting creation time) is given pointer to identity
(IUnknown ) of BarObj. When client calls QueryInterface() on IFoo pointer
asking for interface IBar, FooObj will 1st check if it supports IBar. If so,
it will return IBar pointer. If not, it will forward request to BarObj
(through identity pointer) and pass pointer (IUnknown) returned by BarObj to
client.
Boris
- Signs that you have a poor website design, and the Top 9 Myths about Customer Centered Design (Graphics & Designing) by Fred Doyle
- Part Time VLSI Design Engineering Certification Course fromUniversity of California and Cadence Design Systems (Microprocessors) by tiit
- campus architecture design guide (Routers) by tontonZ
- Supply industrial design, product design, 3D modeling, mold design manufacture - www.defip.com (Graphics & Designing) by 苏州迪菲工业设计有限公司 www.defip.com
- Survey about Architecture and Design Patterns (Programming) by Joerg Rech

