逻辑架构分析.ppt
data for presentation
· handles application layer requests · implementation of domain rules · domain services (POS, Inventory)
- services may be used by just one application, but there is also the possibility of multi-application ser..) ...
2
逻辑架构(Logical architecture)
• 逻辑架构是软件类的宏观组织结构
– 它将软件类组织为包(或空间)、子系统和层等 – 不同部署结构,未决定系统部件的物理部署
• 层(layer)
– 对类、包或子系统更为粗粒度的分组 – “较高”层可以调用“较低”层的服务 – 逻辑架构并非一定组织为层,但这种方式十分普
Sales
Domain
5
分解系统
• 系统都需要降低复杂度,应分解成小模块再 进行开发
– 拆分系统->子系统分层
• 子系统
– 子系统所有对象为某一主题服务,相互紧密协作 ,提供一个明显划定功能单元。
– 尽可能独立于系统其他部分 – 对系统分解为子系统后还需要对子系统进行再分
层
6
准则:使用层进行设计
• 某些层可以分布式实现 • 利于在中间层实施安全特性 • 通过逻辑划分,有助于团队开发
8
准则:内聚职责
• 同一层的对象 职责紧密关联
· GUI windows · reports · speech interface · HTML, XML, XSLT, JSP, Javascript, ...
· Persistence, Security
· low-level technical services, utilities, and frameworks
面向对象分析与设计
逻辑架构分析
OOA&OOD
1
Business Modeling
Sample UP Artifact Relationships
Domain Model
* *
Requirements
Use-Case Model
Vision
Supplementary Specification
The logical architecture is influenced by the constraints and non-functional requirements captured in the Supp. Spec.
UI (AKA Presentation, View)
• 不同层中对象 的职责不混淆
• 如UI对象不处 理应用逻辑
· handles presentation layer requests · workflow · session state · window/page transitions · consolidation/transformation of disparate
· very general low-level business services used in many business domains
· CurrencyConverter
Application (AKA Workflow, Process, Mediation, App Controller)
: ProductCatalog
enterItem (itemID, quantity)
spec = getProductSpec( itemID )
Register
ProductCatalog
class diagrams
...
(a static view)
1
1 ...
makeNewSale() enterItem(...) ...
package diagrams of the logical
UI
architecture
(a static view)
Design Model Domain
Glossary
Tech Services
Design interaction diagrams (a dynamic view)
: Register
Persistence
Logging
RulesEngine
4
UML包图
• 用包图描述系统的逻辑架构
• 层可以建模为包
• 包图可以组织任何事物:类,包,用例等
• 需要显示包间依赖性
UI
Domain
Swing
Web
Sales
UI::Swing
UI::Web
Domain::Sales
UI
Swing
Web
• 好的分层体系结构使系统易于扩展和维护
– 做到关系分离、高级服务和低级服务分离、特定于应用 的服务与一般性服务分离
– 对某一特定层进行修改而不会影响到任何其他层 – 层是模块化的,可以重写某一层,或是整个替换某一层
,只要接口不变,系统其他层次不受影响。这样,某些 层能够用新的实现替换
• 在各层之间限制消息流动,减少层次耦合,增加移 植性
遍
• 面向对象分析重点在应用逻辑层
3
简单分层结构
• 用户界面
UI
not the Java
Swing
Swing libraries, but
Web
our GUI classes
• 应用研究逻辑
based on Swing
和领域对象
Domain
• 技术服务
Sales
Payments
Taxes
Technical Services
• 将软件分层可增加软件的健壮性
– 层次化是一种概念,把软件设计组织成类或组件的层次/ 集合。
– 每一层都依据其下一层来构建,同时为上一层提供实现 基础。
– 不同层的对象间存在一定的对应关系,但每一层的对象 都互相独立的
– 上层的对象了解其下层的对象,但不了解其上面各层
同一层间是否允许协作?
7
分层优点
Domain (AKA Business, Application Logic, Model)
Business Infrastructure (AKA Low-level Business Services)
dependency
more app specific
· (relatively) high-level technical services and frameworks