
最 低 价:¥27.00
定 价:¥30.00
作 者:Don Box,Tim Ewald,Keith Brown,Chris Sells 著
出 版 社:科学出版社
出版时间:2003 年5月
I S B N:7030114043
| 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. z 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. ll. typeless languages lose the benefits of com. 12. dual interfaces are a back. 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 contain 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_east when bridging between 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 marshah on in-process objects. 3z use codisconnectobject to inform the stub when you go away prematurely. security 38. coinitializesecurity is your friend. learn it. love it, call it. 39. avoid as-activator activation. 40. avoid impersonation. 41. use fine-grained authentication. 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 iobjeetcontrol:: activate. 50. don't rely on jit activation and asap deactivation to achieve scalability. epilogue about the authors index |
商品评论(0条)