体系结构 01 基于构建的软件架构

SA : Component-based Architecture 基于构建的软件架构

《Software Architecture with Spring 5.0》参考书

https://spring.io 参考资料

软件体系结构的定义

Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project. Commonly this shared understanding is in the form of the major components of the system and how they interact. It’s also about decisions, in that it’s the decisions that developers wish they could get right early on because they’re perceived as hard to change

Software Component

定义

A software component is a unit of composition (用来组装的单元) with contractually specified interfaces(合同化明确的接口) and explicit context dependencies(显式的依赖) only. A software component can be deployed independently(独立地部署) and is subject to composition by third parties

CBSE

  • Component-based software enginerring
  • Goals
    • Assemble a system out of existing components
    • Update a system by adding / replacing components

CBD

  • Component-based development

构建模型

在这里插入图片描述

  • Facets : 部件提供的功能
  • Receptacles :需要外界提供的东西
  • Event sinks :对系统中某些事件感兴趣的监听器
  • Event sources :在系统中产生事件
  • Attributes :可以通过Attributes调整构建的工作模式
  • interface :管理接口,可以通过它创建、销毁部件

在这里插入图片描述

哲学家问题

在这里插入图片描述

控制反转 IoC

提供服务的组件是被"注入"的而不是被“直接写入”到请求者的代码中

解决问题:

在这里插入图片描述

A component should NEVER create (instantiate) its dependencies

IoC means that a component does not create (instantiate) its dependencies but has someone else creating them for it.

Inversion of Control 实现方法:

  1. Dependency Injection

在这里插入图片描述
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值