Chapter 9 -- Using Separate COM Interfaces

[Previous] [Next]

Chapter 9

In this chapter, we explore the idea of using separate COM interfaces for our main business classes. We also show you the benefits of having facades bind to these classes through the separate interfaces rather than directly to the classes. We know this is a good thing to do because COM was built around this idea, and so is COM+. Since COM+ is the current version of this great technology, we could in this chapter talk about COM interfaces or COM+ interfaces. The question is, should we use the old term or the new term? Well, this book is trying to bring you into the future, so we decided to use COM+ rather than COM in this chapter. But everything we say in this chapter about COM+ interfaces in Microsoft Windows 2000 is equally valid for COM interfaces in Microsoft Windows NT 4.0. You should also know that we'll talk about COM+ interfaces from the perspective of Microsoft Visual Basic developers rather than that of Microsoft Active Template Library (ATL) developers. There are differences between the two perspectives, but you'll have to account for those yourself.

Even if you don't specify separate interfaces for your COM+ components, COM+ will. COM+, in the default interface of the class, exposes all the public properties, methods, and events that you declare for a class. COM+ doesn't allow clients to connect directly to the class. So the question isn't whether your facade objects should connect to main business objects directly or through separate interfaces: your facade objects always connect to your main business objects through separate interfaces, be they the default interfaces or ones that you as the developer specify. The question is instead whether you control this yourself or allow COM+ to control it for you.



Designing for scalability with Microsoft Windows DNA
Designing for Scalability with Microsoft Windows DNA (DV-MPS Designing)
ISBN: 0735609683
EAN: 2147483647
Year: 2000
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net