This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
MOBI The eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDF The popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
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:
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.
Click below for Sample Chapter(s) related to this title:
Sample Chapter 1
Download the sample pages (includes Chapter 1 and Index)
(NOTE: Chapters 3-9 begin with an Overview and each chapter concludes with a Summary.)
About This Book.
1 Object-Oriented Frameworks for Network Programming.
An Overview of Object-Oriented Frameworks.
Comparing Software Development and Reuse Techniques.
Applying Frameworks to Network Programming.
A Tour through the ACE Frameworks.
Example: A Networked Logging Service.
Service and Server Design Dimensions.
Configuration Design Dimensions.
The ACE Time Value Class.
The ACE Event Handler Class.
The ACE Timer Queue Classes.
The ACE Reactor Class.
The ACE Select Reactor Class.
The ACE TP Reactor Class.
The ACE WFMO Reactor Class.
The ACE Service Object Class.
The ACE Service Repository Classes.
The ACE Service Config Class.
The ACE Message Queue Class.
The ACE Task Class.
The ACE Svc Handler Class.
The ACE Acceptor Class.
The ACE Connector Class.
The Asynchronous I/O Factory Classes.
The ACE Handler Class.
The Proactive Acceptor-Connector Classes.
The ACE Proactor Class.
The ACE Module Class.
The ACE Stream Class.
Software for networked applications must possess the following qualities to be successful in today's competitive, fast-paced computing industry:
Writing high-quality networked applications that exhibit these qualities is hard--it's expensive, complicated, and error prone. The patterns, C++ language features, and object oriented design principles presented in C++ 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
This development process has been applied many times in many companies, by many projects 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 lifecycle. 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 frameworks are 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 University, along with contributions from the ACE user community and Steve Huston at Riverace, yielded a C++ toolkit containing some of the most powerful and widely-used concurrent object-oriented network programming frameworks in the world. By applying reusable software patterns and a lightweight OS portability layer, the frameworks in the ACE toolkit provide synchronous and asynchronous event processing; concurrency and synchronization; connection management; and service configuration, initialization, and hierarchical integration. The success of ACE has fundamentally altered the way that networked applications and middleware are designed and implemented on the many operating systems outlined in Sidebar 2 (on page 16 of the text). ACE is being used by thousands of development teams, ranging from large Fortune 500 companies to small startups to advanced research projects at universities and industry labs. Its open-source development model and self-supporting culture is similar in spirit and enthusiasm to that driving Linus Torvalds' popular Linux operating system.
This book describes how the ACE frameworks are designed and how they can helpdevelopers navigate between the limitations of
The skills required to produce and use networked application frameworks have traditionally been locked in the heads of expert developers or buried deep within the source code of numerous projects that are spread throughout an enterprise or an industry. Neither of these locations is ideal, of course, since it's time consuming and error prone to reengineer this knowledge for each new application or project. To address this problem, this book illustrates the key patterns that underlie the structure and functionality of the ACE frameworks. Our coverage of these patterns also makes it easier to understand the design, implementation, and effective use of the open-source ACE toolkit itself.
This book is intended for "hands on" C++ developers or advanced students interested in understanding how to design object-oriented frameworks and apply them to program networked applications. It builds upon material from C++NPv1 that shows how developers can apply patterns to master complexities arising from using native OS APIs to program networked applications. It's therefore important to have a solid grasp of the following topics covered in C++NPv1 before reading this book:
The ACE frameworks are highly flexible and powerful, due in large part to their use of C++ language features. You should therefore be familiar with C++ class inheritance and virtual functions (dynamic binding) as well as templates (parameterized types) and the mechanisms your compiler(s) offer to instantiate them. ACE provides a great deal of assistance in overcoming differences between C++ compilers. As always, however, you need to know the capabilities of your development tools and how to use them. Knowing your tools makes it easier to follow the source code examples in this book and to build and run them on your systems. Finally, as you read the examples in this book, keep in mind the points noted in Sidebar 7 (on page 46 of the text) regarding UML diagrams and C++ code.
Our C++NPv1 book addressed how to master certain complexities of developing networked applications, focusing on the use of ACE's wrapper facades to avoid problems with operating system APIs written in C. This book (which we call C++NPv2) elevates our focus to motivate and demystify the patterns, design techniques, and C++ features associated with developing and using the ACE frameworks. These frameworks help reduce the cost and improve the quality of networked applications by reifying proven software designs and patterns into frameworks that can be reused systematically across projects and enterprises. The ACE frameworks expand reuse technology far beyond what can be achieved by reusing individual classes or even class libraries.
This book presents numerous C++ applications to reinforce the design discussions by showing concrete examples of how to use the ACE frameworks. These examples provide step-by-step guidance that can help you apply key object-oriented techniques and patterns to your own networked applications. The book also shows how to enhance your design skills, focusing on the key concepts and principles that shape the design of successful object oriented frameworks for networked applications and middleware.
The chapters in the book are organized as follows:
ACE_Reactor interface,which support a wide range of OS event demultiplexing mechanisms, including
select(), WaitForMultipleObjects(), XtAppMainLoop(),and
The chapters are organized to build upon each other and to minimize forward references. We therefore recommend that you read the chapters in the book in order. Although this book illustrates the key capabilities of ACE's most important frameworks, we don't cover all uses and methods of those frameworks. For additional coverage of ACE, we refer you to The ACE Programmer's Guide and the online ACE documentation, generated by Doxygen, at http://ace.ece.uci.edu/Doxygen/ and http://www.riverace.com/docs/.
This book is based on ACE version 5.3, released in the fall of 2002. ACE 5.3 and all the sample applications described in our books are open-source software. Sidebar 3 (on page 19 of the text) explains how you can obtain a copy of ACE so you can follow along, see the actual ACE classes and frameworks in complete detail, and run the code examples interactively as you read the book.
To learn more about ACE, or to report errors you find in the book, we recommend you subscribe to the ACE mailing list,
email@example.com. You can subscribe by sending a request to
firstname.lastname@example.org. Include the following command in the body of the email (the subject is ignored):
subscribe ace-users emailaddress@domain
You must supply
emailaddress@domain only if your message's
From address is not the address you wish to subscribe. If you use this alternate address method, the list server will require an extra authorization step before allowing you to join the list.
Postings to the
ace-users list are also forwarded to the
comp.soft-sys.ace USENET newsgroup, along with postings to several other ACE-related mailing lists. Reading the messages via the newsgroup is a good way to keep up with ACE news and activity if you don't require immediate delivery of the 30-50 messages that are posted daily on the mailing lists.
Archives of postings to the comp.soft-sys.ace newsgroup are available at http://groups.google.com/. Enter
comp.soft-sys.ace in the search box to go to a list of archived messages. Google has a complete, searchable archive of over 40,000 messages. You can also post a message to the newsgroup from Google's site.
The ADAPTIVE Communication Environment (ACE) toolkit has achieved enormous success in the area of middleware for networked computing. Due to its flexibility, performance, platform coverage, and other key properties, ACE enjoys broad acceptance by the networked application software community, as evidenced by its use in thousands of applications, in scores of countries, and in dozens of domains. ACE has also received considerable attention beyond the middleware community since it's an open-source role model for highquality and well-designed pattern-oriented software architectures.
But why is ACE so successful? Addressing this question properly takes some thought. To start off, let's reconsider the Foreword from C++ Network Programming: Mastering Complexity with ACE and Patterns (C++NPv1) and resume the mass transit analogy presented there by my colleague Steve Vinoski. Steve's right that a high-quality mass transit system consists of more than just aircraft, airports, trains, train stations, and rails. It also needs less obvious infrastructure, such as scheduling, routing, ticketing, maintenance, and monitoring. But even a complete collection of ingredients is still not sufficient to develop an effective mass transit system. Arranging these ingredients so they seamlessly fulfill their primary objective--fast and reliable transportation of people--is equally important. Would you use a mass transit system whose ticketing was located in a train maintenance location or an airport hangar, or whose planned and actual scheduling and routing weren't available to the public? I doubt it!
The success of mass transit systems depends on more than the knowledge of the infrastructure parts that are provided--it depends on how these different parts must be connected and integrated with their environment. This knowledge enables architects of mass transit systems to integrate individual parts into higher-level building blocks and to connect these building blocks effectively. For example, ticketing, information points, baggage offices, and boarding are integrated in train stations located at city centers or major suburban centers. Likewise, airports are often located near large cities and connected by frequent express trains.
Even mass transit centers themselves are arranged so that activities can be performed effectively. For example, when you enter a train station or airport via the main entrance, you find ticket agents, information centers, and timetables. You also find shops to satisfy your travel needs. As you enter the main train hall or airport concourse, you find other information centers, up-to-date scheduling information, and the platforms and gates for boarding the trains and planes. Mass transit centers thus not only provide all necessary services to begin and end a journey, they also organize their internal "control flows" effectively. While the core structures and control flows in most train stations and airports are similar, their concrete realization can differ widely. Yet we all recognize these mass transit center patterns immediately since they follow key invariants that we've learned through years of experience.
So what's the connection between successful mass transit system design and the success of ACE? The answer is simple: In addition to the basic network computing ingredients (the wrapper facades that Doug and Steve introduced in C++NPv1), ACE also includes useful object-oriented frameworks that build upon these wrapper facades and provide useful higher-level communication services, such as event demultiplexing and dispatching, connection management, service configuration, concurrency, and hierarchically layered stream processing. The ACE framework services satisfy many networked software needs by organizing the structures and internal control flows of your applications effectively via key patterns learned through years of experience.
The ACE frameworks offer you a number of important benefits:
select().Likewise, the ACE Acceptor-Connector framework can be configured with different IPC mechanisms. While this adaptability is beneficial by itself, ACE goes a step further: for many adaptations you can configure the desired strategies from available and interchangeable implementations. In addition to the different Reactor implementations mentioned above, for instance, ACE provides wrapper facades for various IPC mechanisms, such as the Sockets, SSL, TLI, and shared memory, that help to configure the ACE Acceptor-Connector framework for specific platforms and applications.
As a result of advising and leading many software projects over the years, I've found that ACE greatly simplifies the task of employing reusable middleware that can be customized readily to meet the needs of networked applications. Not all networked applications need heavyweight middleware, such as application servers, web services, and complex component models. Yet most networked applications can benefit from portable and efficient host infrastructure middleware like ACE. This flexibility is the core of ACE's success since you needn't commit to an entire middleware suite if you don't use all of it. Instead, you can combine just the essential ACE middleware classes you need to compose applications that are small, but as powerful as necessary. For this reason, I predict that ACE will still be widely used long after the influence of today's heavyweight middleware has waned.
ACE's tremendous flexibility also needn't lead to a sea of incompatible middleware implementations. For example, if you build an embedded system that speaks the CORBA Internet inter-ORB protocol (IIOP) to the outside world, you can use The ACE ORB (TAO), which is a CORBA-compliant, open-source, real-time object request broker (ORB) built using the ACE wrapper facades and frameworks. If CORBA is overkill for your application needs, however, you can build custom, yet interoperable, middleware using the appropriate ACE classes. Both solutions can be based on the same core structures and protocols, such as the ACE Common Data Representation (CDR) classes and its TCP/IP Socket wrapper facades. They can therefore communicate seamlessly with one another, just as you can take a train from Paris to Istanbul--the famous Orient Express--and travel through many European countries without having to change trains due to incompatible railroad networks.
As Steve Vinoski and I have pointed out, there are many similarities between highquality mass transit systems and high-quality networking middleware. To me and thousands of other C++ developers around the world, ACE is the toolkit for building the latter! After saying so many good things about ACE, however, let's return to the main intent of this foreword: introducing the second volume (C++NPv2) of the C++ Network Programming series. As with all software technologies and middleware, the more you understand your tools, the better you'll be able to apply them. It turns out that using ACE in your applications is just one aspect of improving your networked software. To benefit significantly from ACE's many advantages, you therefore also need a sound understanding of the core concepts, patterns, and usage rules that underlie its powerful frameworks.
For years, a common way to learn ACE involved studying its code, comments, and example applications. Clearly, this process was time consuming and error prone. Moreover, even after managing to read the several hundred thousand lines of C++ code in ACE, it was easy to miss the forest for the trees. As the Greek philosopher Thucydides noted two millennia ago: "A man who has the knowledge but lacks the power to clearly express himself is no better off than if he had never any idea at all."
We're therefore fortunate that Doug and Steve found time in their busy schedules to create such a high-quality book on the ACE frameworks. C++NPv2 explains the ideas and concepts underlying the ACE frameworks in an easily accessible form using the popular concurrency and networking patterns from the POSA and "Gang of Four" patterns books. These patterns, in turn, reify thoughtful and time-proven solutions to common networking problems. For example, they tell you what the problems are, why these problems are hard, what the solutions to these problems are, and why these solutions applied to ACE are of high quality. If you want thorough coverage of the patterns and frameworks in ACE that are shaping the next generation of networked application software then read this book. I've learned much from it and I'm sure you will too.
Senior Principal Engineer
Siemens Corporate Technology
Click below to download the Index file related to this title: