Summary
Do you need to develop flexible software that can be customized quickly? Do you need to add the power and efficiency of frameworks to your software? The ADAPTIVE Communication Environment (ACE) is an open-source toolkit for building high-performance networked applications and next-generation middleware. ACE's power and flexibility arise from object-oriented frameworks, used to achieve the systematic reuse of networked application software. ACE frameworks handle common network programming tasks and can be customized using C++ language features to produce complete distributed applications. C++ Network Programming, Volume 2,focuses on ACE frameworks, providing thorough coverage of the concepts, patterns, and usage rules that form their structure. This book is a practical guide to designing object-oriented frameworks and shows developers how to apply frameworks to concurrent networked applications. C++ Networking, Volume 1,introduced ACE and the wrapper facades, which are basic network computing ingredients. Volume 2 explains how frameworks build on wrapper facades to provide higher-level communication services. Written by two experts in the ACE community, this book contains: An overview of ACE frameworks Design dimensions for networked services Descriptions of the key capabilities of the most important ACE frameworks Numerous C++ code examples that demonstrate how to use ACE frameworks C++ Network Programming, Volume 2,teaches how to use frameworks to write networked applications quickly, reducing development effort and overhead. It will be an invaluable asset to any C++ developer working on networked applications.
Author Biography
Dr. Douglas C. Schmidt is the original developer of ACE and The ACE ORB (TAO). He is a Professor at Vanderbilt University, where he studies patterns, optimizations, middleware, and model-based tools for distributed real-time and embedded systems. He is a former editor-in-chief of C++ Report and columnist for C/C++ Users Journal.
Stephen D. Huston is President and CEO of Riverace Corporation, a provider of technical support and consulting services to companies who want to keep software projects on track using ACE. Steve has nearly ten years of experience with ACE, and more than twenty years of software development experience, focusing on network protocol and C++ networked application development in a wide range of hardware and software environments.
Table of Contents
Foreword |
|
vii | |
About This Book |
|
xi | |
|
Object-Oriented Frameworks for Network Programming |
|
|
1 | (22) |
|
An Overview of Object-Oriented Frameworks |
|
|
1 | (3) |
|
Comparing Software Development and Reuse Techniques |
|
|
4 | (8) |
|
Applying Frameworks to Network Programming |
|
|
12 | (2) |
|
A Tour Through the ACE Frameworks |
|
|
14 | (5) |
|
Example: A Networked Logging Service |
|
|
19 | (2) |
|
|
21 | (2) |
|
Service and Configuration Design Dimensions |
|
|
23 | (16) |
|
Service and Server Design Dimensions |
|
|
24 | (10) |
|
Configuration Design Dimensions |
|
|
34 | (4) |
|
|
38 | (1) |
|
The ACE Reactor Framework |
|
|
39 | (48) |
|
|
39 | (3) |
|
|
42 | (4) |
|
The ACE_Event_Handler Class |
|
|
46 | (15) |
|
The ACE_Timer Queue Classes |
|
|
61 | (9) |
|
|
70 | (16) |
|
|
86 | (1) |
|
ACE Reactor Implementations |
|
|
87 | (28) |
|
|
87 | (2) |
|
The ACE_Select_Reactor Class |
|
|
89 | (10) |
|
|
99 | (4) |
|
The ACE_WFMO_Reactor Class |
|
|
103 | (10) |
|
|
113 | (2) |
|
The ACE Service Configurator Framework |
|
|
115 | (40) |
|
|
115 | (3) |
|
The ACE_Service_Object Class |
|
|
118 | (8) |
|
The ACE_Service_Repository Classes |
|
|
126 | (12) |
|
The ACE_Service_Config Class |
|
|
138 | (16) |
|
|
154 | (1) |
|
|
155 | (48) |
|
|
155 | (2) |
|
The ACE_Message_Queue Class |
|
|
157 | (26) |
|
|
183 | (19) |
|
|
202 | (1) |
|
The ACE Acceptor-Connector Framework |
|
|
203 | (54) |
|
|
203 | (3) |
|
The ACE_Svc_Handler Class |
|
|
206 | (10) |
|
|
216 | (13) |
|
|
229 | (27) |
|
|
256 | (1) |
|
The ACE Proactor Framework |
|
|
257 | (40) |
|
|
257 | (4) |
|
The Asynchronous I/O Factory Classes |
|
|
261 | (9) |
|
|
270 | (8) |
|
The Proactive Acceptor-Connector Classes |
|
|
278 | (8) |
|
|
286 | (10) |
|
|
296 | (1) |
|
The ACE Streams Framework |
|
|
297 | (22) |
|
|
297 | (2) |
|
|
299 | (15) |
|
|
314 | (4) |
|
|
318 | (1) |
Glossary |
|
319 | (10) |
Bibliography |
|
329 | (8) |
Index |
|
337 | |
Excerpts
About This Book Software for networked applications must possess the following qualities to be successful in today's competitive, fast-paced computing industry: Affordability,to ensure that the total ownership costs of software acquisition and evolution are not prohibitively high Extensibility,to support successions of quick updates and additions to address new requirements and take advantage of emerging markets Flexibility,to support a growing range of multimedia data types, traffic patterns, and end-to-end quality of service (QoS) requirements Portability,to reduce the effort required to support applications on heterogeneous OS platforms and compilers Predictabilityandefficiency,to provide low latency to delay-sensitive real-time applications, high performance to bandwidth-intensive applications, and usability over low-bandwidth networks, such as wireless links Reliability,to ensure that applications are robust, fault tolerant, and highly available Scalability,to enable applications to handle large numbers of clients simultaneously Writing high-quality networked applications that exhibit these qualities is hard--it's expensive, complicated, and error prone. The patterns, C++ language features, and objectoriented design principles presented inC++ Network Programming, Volume 1: Mastering Complexity with ACE and Patterns(C++NPv1) help to minimize complexity and mistakes in networked applications by refactoring common structure and functionality into reusable wrapper facade class libraries. The key benefits of reuse will be lost, however, if large parts of the application software that uses these class libraries--or worse, the class libraries themselves--must be rewritten for each new project. Historically, many networked application software projects began by Designing and implementing demultiplexing and dispatching infrastructure mechanisms that handle timed events and I/O on multiple socket handles Adding service instantiation and processing mechanisms atop the demultiplexing and dispatching layer, along with message buffering and queueing mechanisms Implementing large amounts of application-specific code using this ad hoc host infrastructure middleware This development process has been applied many times in many companies, by manyprojects in parallel. Even worse, it's been applied by the same teams in a series of projects. Regrettably, this continuous rediscovery and reinvention of core concepts and code has kept costs unnecessarily high throughout the software development life cycle. This problem is exacerbated by the inherent diversity of today's hardware, operating systems, compilers, and communication platforms, which keep shifting the foundations of networked application software development. Object-oriented frameworksare one of the most flexible and powerful techniques that address the problems outlined above. A framework is a reusable, "semi-complete" application that can be specialized to produce custom applications. Frameworks help to reduce the cost and improve the quality of networked applications by reifying proven software designs and patterns into concrete source code. By emphasizing the integration and collaboration of application-specific and application-independent classes, frameworks enable larger scale reuse of software than can be achieved by reusing individual classes or stand-alone functions. In the early 1990s, Doug Schmidt started the open-source ACE project to bring the power and efficiency of patterns and frameworks to networked application development. As with much of Doug's work, ACE addressed many real-world problems faced by professional software developers. Over the following decade, his groups at the University of California, Irvine; Washington University, St. Louis; and Vanderbilt Univer