ACE (Adaptive Communication Environment) 是一种广泛使用的主机基础设施中间件。ACE库包含24w行c++代码,500个类,ACE简化了网络应用程序的创建、组成、配置和移植,而且不会导致性能的显著开销。
ACE软件包的基础是ACE OS Adaptation层和C++ wrapper facades的结合,它封装了核心OS并发网络编程机制。ACE的较高层建立在这一基础之上,提供了可复用的框架、网络服务组建、基于标注的中间件等。
1.ACE OS Adaptation层
ACE OS Adaptation层大约占ACE10%的代码,它由一个名为ACE_OS的类构成,此类包含500多个C++静态方法,这些方法封装了原始的、基于C的OS API,隐藏了“和平台相关”的细节,展示了统一的OS机制接口,供更高级的ACE层使用。ACE_OS Adaption层使得ACE的可移植性和可维护性变得单纯。
2.ACE C++ Wrapper Facade层
wrapper facade由一个或多个类组成,这些类将函数和数据封装在类型安全的“面向对象”接口中。ACE C++ wrapper facade层位于OS Adaptation层之上,并提供了大致相同的功能。这些功能被封装成C++类,而不是独立的C函数。此层代码占大约50%。
3.ACE framework层
ACE中剩下的40%是面向对象框架,它们是多组集成在一起、相互合作的类,用来为一组相关应用提供可复用的软件架构。
4.ACE 网络服务组建层
ACE还提供了一个网络服务库,库中的服务都被包装成组件。所谓组件指的是软件系统中的一个“被封装的部分”&#