Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects, Volume 2, 详细读书笔记 1

《Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects, Volume 2》 是一本经典书,其描述的各种设计模式异常精彩。书的第一作者就是创造了ACE的Douglas Schmidt,因此这本书里的大多数模式都能在ACE中找到对应的实现,在看本书的时候可以结合着看ACE的各资料。此书也有中文译本,名叫《面向模式的软件体系结构 卷2:用于并发和网络化对象的模式》,还是翻译POSA Vol.1的那些人,还是一样的烂,还是看原版比较好。但英文毕竟不是我们的母语,看起来很头疼,看过后记忆又不深刻,因此我在看书的过程中,像POSA Vol.1一样记下了详细的笔记,希望以后回顾时有所帮助,不过在看这本书的时候,工作也比较忙,记下的笔记也就没有POSA Vol.1的笔记那么多,就不叫“巨详细”笔记了。好了不罗嗦了,看书:

---------------------------------------------

 

Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects, Volume 2
by Douglas Schmidt, Michael Stal, Hans Rohnert and Frank Buschmann
An examination of 17 essential design patterns used to build modern objectoriented middleware systems.
《面向模式的软件体系结构 卷2:用于并发和网络化对象的模式》

[page 47]
第2章:服务的访问和配置模式(Service Access and Configuration Patterns)
2.1[概述]
本章描述了在独立(和网络)系统中的4种设计模式,用来设计访问(和配置)服务(和组件)的高效API(application programming interfaces):Wrapper Facade,Component Configurator, Interceptor 和 Extension Interface。
网络本就是异构的,(?? Therefore, a key challenge confronting researchers and developers is how to effectively design and configure application access to the interfaces and implementations of evolving service components.)研发人员面临的一项关键挑战是如何高效地设计和配置应用程序访问接口以及服务组件进化的实现。本章描述了4种模式,覆盖服务访问和配置的不同方面:
    - Wrapper Facade 设计模式,将已存在的非面向对象APIs提供的函数和数据封装成简洁、健壮、可移植、可维护且内聚性更强的面向对象类接口。Wrapper Facade通常通过‘封装‘操作系统底层APIs,提高应用程序的可移植性,减轻采用底层API所附加的程序复杂性。
    本书为了尽量减少此模式同其他模式之间的冗余,在Wrapper Facade的[实现]一节只包含了关于threads, mutex locks, condition variables 和 Sockets的细节。而其他使用了Wrapper Facade的模式,将在随后的模式描述中由他们自己的[实现]一节描述实现细节,这些模式包括:Reactor, Proactor, Acceptor-Connector, Strategized Locking , Active Object 和 Monitor Object。所以建议你先阅读Wrapper Facade。
[page 48]
    - Component Configurator设计模式允许应用程序在不用改变代码、重新编译、重新静态链接的前提下,就可以在运行时链接(或解除连接)组件的实现。有高可用性需求的应用程序,如:执行在线事务处理或者自动化工业实时处理的关键任务系统(??mission-critical),通常都需要这种灵活的配置能力。因而,Component Configurator致力于解决服务配置和服务演进这些方面的问题。
    这一节的其他模式,特别是 Extension Interface 和 Interceptor,可以采用Component Configurator模式在不关闭、重启运行中的应用程序的前提下,(重)配置各种应用程序中组件的服务角色。
    - Interceptor架构模式允许将服务透明地添加到框架(framework)中,而且当某事件出现时此服务能自动被触发。Interceptor therefore prepares a framework for its own evolution to accommodate services that are
not configured or not even known during the framework's original development. Interceptor also allows other applications to integrate components and services with instances of the framework. Such services are often 'out-of-band' or application-specific from the perspective of the framework instance, but are important for the productive and proper operation of applications that use the framework.
    - Extension Interface设计模式,在开发人员扩展或修改已有组件的服务功能时,避免接口膨胀,避免客户端代码被破坏。同一个组件中可以使用多个Extension Interface。(??Extension Interface addresses both the challenge of component and
service evolution and the provision of clients with an authorized and role-specific access to a component's functionality.)Extension Interface致力于解决2方面问题:组件和服务的演化挑战,给客户端访问组件功能提供授权和特定角色。

在本章中所描述的模式不能解决所有关于服务访问和配置(Service Access and Configuration)的问题,这个话题还面临着很多挑战:
    - 经本地代理间接访问远程服务。
    - 服务的生命周期管理;在分布式系统中定位某服务。
    - 控制操作系统,计算server能提供多少资源给位于其中的服务实现。
Other patterns in the literature address these issues, such as Activator [Sta100], Evictor [HV99], Half Object plus Protocol [Mes95], Locator [JK00], Object Lifetime Manager [LGS99], and Proxy [POSA1] [GoF95]. These patterns complement those presented in this section and together describe key principles that well-structured distributed systems should apply to configure and provide access to the services they offer.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值