注冊(cè) | 登錄讀書(shū)好,好讀書(shū),讀好書(shū)!
讀書(shū)網(wǎng)-DuShu.com
當(dāng)前位置: 首頁(yè)出版圖書(shū)科學(xué)技術(shù)計(jì)算機(jī)/網(wǎng)絡(luò)軟件與程序設(shè)計(jì)程序設(shè)計(jì)綜合COM高手心經(jīng)

COM高手心經(jīng)

COM高手心經(jīng)

定 價(jià):¥30.00

作 者: (美)Don Box等編著
出版社: 科學(xué)出版社
叢編項(xiàng): UML與面向?qū)ο笤O(shè)計(jì)影印叢書(shū)
標(biāo) 簽: UML

ISBN: 9787030114044 出版時(shí)間: 2003-05-01 包裝: 簡(jiǎn)裝本
開(kāi)本: 23cm 頁(yè)數(shù): 222 字?jǐn)?shù):  

內(nèi)容簡(jiǎn)介

  COM是面向?qū)ο蠓植际綉?yīng)用程序開(kāi)發(fā)中重要的中間層技術(shù)。本書(shū)作者根據(jù)自己多年COM實(shí)際開(kāi)發(fā)的經(jīng)驗(yàn)和心得,總結(jié)出了50條重要的規(guī)律,并歸納為6大類:從C++到COM的過(guò)渡,接口及COM開(kāi)發(fā)基本要素,實(shí)施問(wèn)題,apartment有關(guān)概念,安全性,事務(wù)。另外,還通過(guò)網(wǎng)站提供了書(shū)中的代碼。本書(shū)適合有經(jīng)驗(yàn)的C++、COM及MTS程序開(kāi)發(fā)人員閱讀。

作者簡(jiǎn)介

暫缺《COM高手心經(jīng)》作者簡(jiǎn)介

圖書(shū)目錄

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

本目錄推薦

掃描二維碼
Copyright ? 讀書(shū)網(wǎng) hotzeplotz.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號(hào) 鄂公網(wǎng)安備 42010302001612號(hào)