赛迪网 > IT技术 编程语言 > 文章
  IT资讯搜索
 
IT产品搜索
[程序开发][网管世界][网络安全][数据库技术]
[操作系统][嘉宾聊天·在线访谈][活动集锦]
[精彩专题][Symantec专区][订阅IT技术周刊]
[开发论坛][网管论坛][安全论坛][数据库论坛]
[操作系统论坛][Sybase专区][IBM dW技术专区]
[病毒求助][病毒与漏洞播报][文档·源码下载]

VBCOM TUTORIAL(1)

发布时间:2006.08.16 02:48     来源:plwww    作者:

Introduction

This web-based tutorial will guide you through a tour of the Microsoft Component Object Model (COM) from the perspective of Visual Basic. It is not intended to be a comprehensive coverage of VB COM but an introduction.  Our goals are the following:

  • To help you understand the motives behind COM, and why it has evolved to be the way it is.
  • To introduce you to object-based programming in general and COM programming in particular, all from the perspective of VB.
  • To present one of the most important concepts in COM, that of interfaces and interface-based programming
  • To look behind the scenes of VB and learn about GUIDs, IDL, type libraries and the registry.
  • To debunk the myth that COM programming is hard.

We assume that you are here because you are already motivated to learn about VB COM.   If so, click here to setup your tutorial environment, and then you'll be ready to start!  On the other hand, if you would like a little background on the motivations behind COM, continue reading below.

Motivation
Why COM?

COM was originally designed to enable objects to communicate with one another, objects written in different languages and running in different processes.  If you stop and really think about this, COM solves a very difficult problem.  Firstly, languages such as Visual Basic, C++ and Java have radically different run-time environments, type systems, parameter-passing mechanisms and object formats.  Finding a common yet powerful object-oriented framework is not a trivial task.  Secondly, in order for processes to communicate, data must be passed back and forth across address space boundaries (marshaled) in a synchronized manner.  The calling object needs to block while it awaits completion of the call, and the callee object may need to queue up incoming calls as it completes the current one. 

Thus, the first benefit of COM is that it enables the creation of plug-and-play software components.  The power of this approach is readily apparent in Visual Basic itself, with its extensible collection of user-interface controls

Like the object-oriented languages on which it is based, COM was also designed to support the evolution of software components.  We all know that software evolves, both in terms of bug fixes and functionality.  The question is how best to minimize the impact of change in an existing system.  COM's solution is based on a strict adherence to the notion of interface-based programming.  As you will see later in this tutorial, interfaces are simply a collection of method signatures.   However, software designs based on immutable interfaces are better able to evolve since object implementations can change while remaining backward compatible with existing code.  This is the second major benefit to be gained from using COM.

Finally, COM and its infrastructure enable the straightforward construction of distributed applications.  COM objects interacting on the same machine can be moved to different machines without any coding changes!  This greatly simplifies the development of multi-tier applications, especially when combined with other COM-based technologies such as MTS (Microsoft Transaction Server).  Previously known as DCOM (Distributed COM), support for distributed computation is now considered an essential feature of COM and thus no longer carries a separate moniker.


[ 发表评论 ] 字体[  ] [ 打印 ] [ 进入博客 ] [ 进入论坛 ]  [ 推荐给朋友 ]
  相关文章
· VBCOM TUTORIAL(2) (10-11) · VB6中一个非常好用的读写Ini文件的模块 (09-02)
· 发现剪帖板的秘密 (03-06) · 自己动手制作MUD客户端服务程序 (12-23)
· 在 VB5.0中编辑数据库和电子表格 (05-13) · VB应用程序对系统配置参数的确定 (11-15)
· 利用VB访问Internet (10-16) · 将Visual Basic 6.0程序转换到Visual Basic.N (09-09)
· 用VB开发应用程序如何使用INI文件 (11-12) · Win95系统API函数大揭秘 (07-21)
  客户需求反馈表
* 姓  名:
更多资料  了解方案  认识厂商
* 单位名称:
* 联系电话:
* 电子邮件:
  赛迪推荐  
  手机·资费 ·新品·导购·评测·手机资费·宽带
手机搜索  诺基亚 N73 MOTO Z6
  IT产品 ·笔记本·台式机·服务器·打印·投影
IT产品搜索 
  IT技术 ·开发·网管·安全·数据库·操作系统
  信息化 ·热点·专题·访谈·周刊·方案案例
[政务][电信][金融][农业][制造业][中小企业]
[CIO][ERP][协同][IT管理][中间件][电子商务]
[政策][地方][专家][评估][辞典][博客][社区]
· 专题:一路畅通构想曲——让出行不再遭遇堵车
· CIO工作亲历:企业ERP选型不能忽视"选人关"
· 综述:信息化建设给中国监狱带来的各种变化
· 金融业风险管理和法规遵从有五点需考虑的因素
· 保险业CIO关注:该如何建立统一高效的CRM体系
· 调查显示:多数CIO对IT规划仍存在困惑和误解
  博客·论坛 ·曾剑秋·项立刚·Java学习·网管