7.5 Summary

Ru-Brd

The ACE Acceptor-Connector framework decouples a service's connection and initialization strategies from its service handling strategy. This separation of concerns allows each set of strategies to evolve independently and promotes a modular design of networked applications. The ACE Acceptor-Connector framework factors connection and initialization strategies into the ACE_Acceptor and ACE_Connector class templates, and the service handling strategy into the ACE_Svc_Handler class template.

The ACE Reactor, Service Configurator, and Task frameworks described in earlier chapters use class inheritance and virtual methods as their primary extensibility mechanisms. The ACE Acceptor-Connector framework uses these mechanisms as well, primarily as the means to configure different strategies for connection establishment, communication, concurrency, and service behavior. Unlike the frameworks in previous chapters, however, classes in the ACE Acceptor-Connector framework share an inherent relationship in networked application services, so the use of parameterized types plays a more significant role here. To allow and enforce the relationships between the strategies, both ACE_Acceptor and ACE_Connector include an ACE_Svc_Handler -derived class in their template arguments to act as the target of the connection factory.

This chapter defined and illustrated the communication and connection roles that networked application services play, as well as the passive and active connection modes that connection-oriented services use. Although the ACE Socket wrapper facades described in Chapter 3 of C++NPv1 assist with mastering the problems associated with C operating system APIs, this chapter illustrated how the design of the ACE Acceptor-Connector framework encourages modular separation of roles leading to highly extensible and maintainable designs. The examples showed how easy it is to define an application's service handlers by defining class(es) derived from ACE_Svc_Handler and adding the service-specific behavior in the hook and callback methods inherited from ACE_Svc_Handler , ACE_Task , and ACE_Event_Handler . Although the ACE Acceptor-Connector framework encapsulates the most common use-cases for service establishment, this chapter showed how the framework uses the Template Method pattern [GoF] to allow application developers to customize the behavior of each service establishment step to match the requirements, environment, and resources of specific networked applications.

Ru-Brd


C++ Network Programming
C++ Network Programming, Volume I: Mastering Complexity with ACE and Patterns
ISBN: 0201604647
EAN: 2147483647
Year: 2002
Pages: 65

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net