注册 | 登录读书好,好读书,读好书!
读书网-DuShu.com
当前位置: 首页出版图书科学技术计算机/网络软件与程序设计程序设计综合COM高手心经

COM高手心经

COM高手心经

定 价:¥30.00

作 者: (美)Don Box等编著
出版社: 科学出版社
丛编项: UML与面向对象设计影印丛书
标 签: UML

ISBN: 9787030114044 出版时间: 2003-05-01 包装: 简裝本
开本: 23cm 页数: 222 字数:  

内容简介

  COM是面向对象分布式应用程序开发中重要的中间层技术。本书作者根据自己多年COM实际开发的经验和心得,总结出了50条重要的规律,并归纳为6大类:从C++到COM的过渡,接口及COM开发基本要素,实施问题,apartment有关概念,安全性,事务。另外,还通过网站提供了书中的代码。本书适合有经验的C++、COM及MTS程序开发人员阅读。

作者简介

暂缺《COM高手心经》作者简介

图书目录

Preface
Shifting from C++ to COM
1.Define your interfaces before you define your classes(and do it in IDL).
2.Design with distribution in mind.
3.Objects should not have their own user interface.
4.Beware the COM singleton.
5.Don't allow C++ exceptions to cross method boundaries.
Interfaces
6.Interfaces are syntax and loose semantics.Both are immutable.
7.Avoid E_NOTIMPL.
8.Prefer typed data to opaque data.
9.Avoid connection points.
10.Don't provide more than one implementation of the same interface on a single object.
11.Typeless languages lose the benefits of COM.
12.Dual interfaces are a hack.Don't require people to implement them.
13.Choose the right array type(avoid open and varying arrays).
14.Avoid passing IUnknown as a statically typed object reference(use iid_is).
15.Avoid[in,out]parameters that contatin pointers.
16.Be conscious of cyclic references(and the problems they cause).
17.Avoid wire_marshal,transmit_as,call_as,and cpp_quote.
Implementations
18.Code defensively.
19.Always initialize[out]parameters.
20.Don't use interface pointers that have not been AddRef'ed
21.Use static_cast when bridging betwwen the C++type system and the COM type system.
22.Smart interface pointers add at least as much complexity as they remove.
23.Don't hand-optimize reference counting.
24.Implement enumerators using lazy evaluation.
25.Use flyweights where appropriate.
26.avoid using tearoffs across apartment boundaries.
27.Be especially careful with BSTRs.
28.COM aggregation and COM containment are for identity tricks,not code reuse.
Apartments
29.Don't access raw interface pointers across apartment boundaries.
30.When passing an interface pointer between one MTA thread and another,use AddRef.
31.User-interface threads and objects must run in single-threaded apartments(STAs).
32.Avoid creating threads from an in-process server.
33.Beware the Free-Threaded Marshaler(FTM).
34.Beware physical locks in the MTA.
35.STAs may need locks too.
36.Avoid extant marshals on in-process objects.
37.Use CoDisconnectObject to inform the stub when you go away prematurely.
Security
38.ConInitializeSecurity is your friend.Learn it,love it,call it.
39.Avoid As-Activator activation.
40.Avoid impersonation.
41.Use fine-grained awthentication.
42.Use fine-grained access control.
Transactions
43.Keep transactions as short as possible.
44.Always use SafeRef when handing out pointers to your own object.
45.Don't share object references across activity boundaries.
46.Beware of exposing object references from the middle of a transaction hierarchy.
47.Beware of committing a transaction implicitly.
48.Use nontransactional objects where appropriate.
49.Move nontrivial initialization to IObjectControl::Activate.
50.Don't rely on JIT activation and ASAP deactivation to achieve scalability.
Epilogue
About the Authors
Index

本目录推荐