最近有人问我
系统规划的规格,事实上无论明日各种技术栈怎么衍生和变化,这个本质的标准与措施不会变,
让大家回顾一下 这个原则:

•分散关注 Separation of concerns. Divide your application into
distinct features with as little overlap in functionality as possible.
The important factor is minimization of interaction points to achieve
high cohesion and low coupling. However, separating functionality at
the wrong boundaries can result in high coupling and complexity
between features even though the contained functionality within a
feature does not significantly overlap.
不同世界的效用,应该由不同的代码和纤维重迭的模块组合。

•单一任务,效能高内聚 Single Responsibility principle. Each
component or module should be responsible for only a specific feature
or functionality, or aggregation of cohesive functionality.

•一个模块不需要了然另一个模块的内部细节 Principle of Least Knowledge
(also known as the Law of Demeter or LoD).
A component or object
should not know about internal details of other components or
objects.

•Don’t repeat yourself (DRY). You should only need to specify
intent in one place. For example, in terms of application design,
specific functionality should be implemented in only one component;
the functionality should not be duplicated in any other component.

•不要过度设计过多模块 Minimize upfront design. Only design what is
necessary. In some cases, you may require upfront comprehensive design
and testing if the cost of development or a failure in the design is
very high. In other cases, especially for agile development, you can
avoid big design upfront (BDUF). If your application requirements are
unclear, or if there is a possibility of the design evolving over
time, avoid making a large design effort prematurely. This principle
is sometimes known as YAGNI (“You ain’t gonna need it”).

图片 1

软件设计 中 SOLID原则

Simplicity (KISS)

     The most important principle is keeping things simple.
简单是软件设计的靶子,简单的代码占用时间少,漏洞少,并且易于修改。Simplicity
should be your northern star, your compass, and your long-term
commitment. Keeping software simple is difficult because it is
inherently relative. There is no standardized measurement of
simplicity, so when you judge what is simpler, you need to first ask
yourself for whom and when. For example, is it simpler for you or for
your clients? Is it simpler for you to do now or maintain in the
future?

低耦合原则(Minimize Coupling)

      
代码的任何一个片段应该缩短对其他区域代码的依赖关系。尽量不要使用共享参数。低耦合往往是宏观结构体系和出彩设计的声明

Designing for scale      Designing for scale is a difficult art, and each technique
described in this section comes with some costs. As an engineer, you
need to make careful tradeoffs between endless scalability and the
practicality of each solution. To make sure you do not over engineer
by preparing for scale that you will never need, you should first
carefully estimate the most realistic scalability needs of your system
and design accordingly.
Design for Self-Healing
    
The final design principle in this chapter is designing
software for high availability and self-healing. A system is
considered to be available as long as it performs its functions as
expected from the client’s perspective. It does not matter if the
system is experiencing internal partial failure as long as it does not
affect the behavior that clients depend on. In other words, you want
to make your system appear as if all of its components were
functioning perfectly even when things break and during maintenance
times.
Designing For Failure
    
Each application component must be deployed across redundant
cloud components, ideally with minimal or no common points of
failure
      Each application component must make no assumptions about the
underlying infrastructure—it must be able to adapt to changes in the
infrastructure without downtime
      Each application component should be partition tolerant—in other
words, it should be able to survive network latency (or loss of
communication) among the nodes that support that component
      Automation tools must be in place to orchestrate application
responses to failures or other changes in the infrastructure

有的统筹的执行

Keep design patterns consistent within each layer. Within a
logical layer, where possible, the design of components should be
consistent for a particular operation. For example, if you choose to
use the Table Data Gateway pattern to create an object that acts as a
gateway to tables or views in a database, you should not include
another pattern such as Repository, which uses a different paradigm
for accessing data and initializing business entities. However, you
may need to use different patterns for tasks in a layer that have a
large variation in requirements, such as an application that contains
business transaction and reporting functionality.
Do not duplicate functionality within an application. There should
be only one component providing a specific functionality—this
functionality should not be duplicated in any other component. This
makes your components cohesive and makes it easier to optimize the
components if a specific feature or functionality changes. Duplication
of functionality within an application can make it difficult to
implement changes, decrease clarity, and introduce potential
inconsistencies.
Prefer composition to inheritance. Wherever possible, use
composition over inheritance when reusing functionality because
inheritance increases the dependency between parent and child classes,
thereby limiting the reuse of child classes. This also reduces the
inheritance hierarchies, which can become very difficult to deal
with.
Establish a coding style and naming convention for development.
Check to see if the organization has established coding style and
naming standards. If not, you should establish common standards. This
provides a consistent model that makes it easier for team members to
review code they did not write, which leads to better
maintainability.
Maintain system quality using automated QA techniques during
development.
Use unit testing and other automated Quality Analysis
techniques, such as dependency analysis and static code analysis,
during development. Define clear behavioral and performance metrics
for components and sub-systems, and use automated QA tools during the
build process to ensure that local design or implementation decisions
do not adversely affect the overall system quality.
Consider the operation of your application. Determine what metrics
and operational data are required by the IT infrastructure to ensure
the efficient deployment and operation of your application. Designing
your application’s components and sub-systems with a clear
understanding of their individual operational requirements will
significantly ease overall deployment and operation. Use automated QA
tools during development to ensure that the correct operational data
is provided by your application’s components and sub-systems.

在互联网系统下暴发的一部分原则

1.制止单点故障:任何事物都要有多少个。这扩展了成本和复杂度,但却能在可用性和负载性能上收入。而且,这促进设计者接纳一种分布式优先的构思。可(异地)部署和就地路由连接,破除单点故障;可分布,可调度的口径

2.横向扩张,而不是纵向扩张:升级服务器(纵向)的成本是指数增长的,而增添另一台商用服务器(横向)的资本是线性增长的。
3.尽量压缩应用程序大旨所急需做到的干活。

4.API优先:将应用程序视为一个提供API的劳动,而且,不假定服务的客户端类型(手机应用、Web站点、桌面应用程序)。

5.提供尽可能新的多少:用户可能不需要及时看到最新的多寡,最后一致性能够拉动更高的可用性。
6.规划时要考虑爱戴和自动化:不要低估应用程序维护所急需的时光和工作量。软件第一次公开发布是一个值得赞赏的里程碑,但也阐明着真正的办事要开首了。
7.为故障做好准备:将故障对极端用户的熏陶最小化。
8.数码报告和督查平台;
用户作为数据,系统性能监控数据,系统充足和业务相关数据等的报告
9.数码分级存储原则:单内存cache存储,内存cache+异步更新,内存cache+同步革新;
从五个纬度分析用户作为模型,决定有关数据的贮存策略:1),能经得住用户数量的丢失吗?2),能忍受多少的非及时性吗?
3),数据的读写比例分布如何?
10.状态分离原则;
能静态化尽量静态化,在代码和过程部署上,在DNS层上做好气象分离的系统规划准备
11.轻重别离原则;
维持衔接和事务处理的分离,接入尽量轻量化,使得系统具有很好的吞吐量,处理尽量异步化,使得可以平滑扩充
12.
去掉服务依赖原则:同一IDC的其余服务对系统的震慑,第三方调用系统接口的割裂和过载爱慕,依赖第三方服务的监察和平安珍爱标准等。
13.柔性可用原则;
拍卖好相当意况下的灰度体验,区分好首要处理途径和非关键路径,而系统规划要尽可能把重点路径转换成非关键路径
14.异步化,能异步的尽量异步原则;
透过内存管道,操作流水等技巧举行拼接各类处理模块
15.灰度条件;
灰度发表政策是遵照用户号码段,用户ip段,如故用户vip等级,用户所在城市等展开灰度升级,保证系统的平缓迭代
16.分外的神速响应和一键切换原则;
IDC断电?系统切换来正规的资本是有点?时间吧?需要多少人操作?牛的体系可以一个人在保管后台按一个按钮就足以切换,再按一下就足以切换回来
17.有损服务标准化;
用低本钱提供海量的劳动规范
18.充分利用DNS层做好系统的可分布设计
19.区分系统作为和用户作为并各自展开设计,甚至在关键时刻可以展开转移。
20.努力实现无状态:状态音信要保留在尽可能少的地点,而且要保存在特意计划的零部件中。百折不挠app_server设计的无状态统筹规范,转变用户作为为系统作为,使得app_server具有无状态的特性
21.多级cache设计以及各种cache的路由设计
22.“大序列小做”原则  
23.强政工模型到最终一致性事务模型的转换原则
24.尽可能拆分
25.劳务架构“去核心化”
26.数据化运营
27.尽可能使用成熟组件
28.尽可能自动化

普遍web系统规划的一部分中坚标准:

可用性:
一个网站的健康运行时刻对于众多铺面的名气与运行都是重点的。对于部分更大的在线零售站点,几分钟的不可用都会促成数千或数百万比索的营收损失,由此系统规划得可以不断服务,并且能高效从故障中复苏是技巧和工作的最主旨要求。分布式系统中的高可用性需要密切考虑关键部件的冗余,从一些系统故障中连忙复原,以及问题发生时优雅降级。
性能:
对于多数站点而言,网站的属性已改成一个关键的设想因素。网站的快慢影响着使用和用户满足度,以及查找引擎排行,与营收和是否能留给用户直接有关。由此,创造一个对准快速响应与低顺延举办优化的系统非常关键。
可靠性:
系统必须是易如反掌的,这样同样数量请求才会一贯再次来到相同的多寡。数据变换或更新之后,同样的乞请则应该回到新的数据。用户应该了解一点:假诺东西写入了系统,或者取得存储,那么它会持久化并且肯定保持不变以便将来拓展搜寻。
可扩张性:
对于其他大型分布式系统而言,大小(size)只是索要考虑的框框(scale)问题的一个方面。同样举足轻重的是努力去增强处理更大负荷的力量,这平常被称呼系统的可增添性。可扩展性以连串的成百上千例外参数为参考:可以处理多少额外流量?扩张存储容量有多容易?可以处理多少更多的业务?
可管理性:
系统规划得容易运维是另一个首要的考虑因素。系统的可管理性等价于运维(维护和立异)的可扩充性。对于可管理性需要考虑的是:问题暴发时容易诊断与精通,便于更新或改动,系统运维起来何等简单(例如:常规运维是否不会掀起失利或特别?)
成本:
成本是一个最紧要元素。很显明那包括硬件和软件成本,但也要考虑系统部署和保安这一头。系统构建所花费的开发者时间,系统运作所急需的运维工作量,以及陶铸工作都应该考虑进来。成本是负有系统的总财力。

剩下来 就足以围绕 ISO 9126质地模型:软件质地模型的6大特征和27个子特性
来进展系统规划与分析,度量, 他们是:

一、功能性:
1、适合性:提供了相应的法力
2、准确性:正确(用户需要的)
3、互操作性:产品与产品里面互相数据的力量
4、保密安全性:允许通过授权的用户和序列可以健康的造访相应的数目和音信,禁止未授权的用户访问…….
5、功用性的依从性:国际/国家/行业/公司 标准规范一致性

二、可靠性:产品在确定的原则下,在规定的时日内形成规定职能的能力
1、成熟性:避免内部错误导致软件失效的能力
2、容错性:软件出现故障,自我处理能力
3、易恢复生机性:失效意况下的还原能力
4、可靠性的依从性

三、易用性:在指定使用口径下,产品被领会、
学习、使用和吸引用户的力量
1、易驾驭性:
2、易学性:
3、易操作性:
4、吸引性:
5、易用性的依从性:

四、功用性:在规定台标准下,相对于所用资源的数码,软件出品可提供合适性能的能力
1、时间特性:平均事务响应时间,吞吐率,TPS(每秒事务数)
2、资源利用性:CPU 内存 磁盘 IO 网络带宽 队列 共享内存
3、功效依从性:

五、软件维护性:”四规”,
在规定标准下,规定的时日内,使用规定的工具或措施修复规定职能的能力
1、易分析性:分析定位问题的难易程度
2、易改变性:软件出品使指定的修改可以被实现的力量
3、稳定性:制止意外修改导致程序失效
4、易 测试性:使已修改软件能被认可的力量
5、维护性的依从性

六、软件可移植性:从一种环境迁移到另一种环境的力量
1、适应性:适应不同平台
2、易安装性:被装置的力量
3、共存性:
4、易替换性
5、可移植性的依从性:

有心人回忆现在各个的系统平台,框架,组件,工程措施,都至少含有有地点的统筹思想与规范。可能还有遗漏的,后续补充。


前几日先到这儿,希望对你在系统架构设计与评估,团队管理, 项目管理, 产品管理
有参照成效 , 您可能感兴趣的著作:
互联网电商购物车架构衍生和变化案例
互联网业务场景下音讯队列架构
音讯系统架构设计演进
互联网电商搜索架构衍变之一
信用社新闻化与软件工程的迷思
合作社项目化管理介绍
软件项目成功之要素
人际交换风格介绍一
精益IT社团与分享式领导
学习型社团与商家
公司立异文化与等级观念
协会目的与私家目的
初创公司人才招聘与治本
人才集团环境与合作社文化
商店文化、团队文化与文化共享
高效能的社团建设
花色管理挂钩计划
构建高速的研发与自动化运维
某大型电商云平台实践
互联网数据库架构设计思路
IT基础架构规划方案一(网络序列规划)
餐饮行业解决方案之客户分析流程
餐饮行业解决方案之采购战略制定与执行流程
餐饮行业解决方案之业务设计流程
供应链需求调研CheckList
集团应用之性质实时度量系统衍变

如有想询问更多软件设计与架构, 系统IT,集团信息化, 团队保管
资讯,请关注自我的微信订阅号:

图片 2

作者:Petter Liu
出处:http://www.cnblogs.com/wintersun/
正文版权归作者和天涯论坛共有,欢迎转载,但未经作者同意必须保留此段讲明,且在篇章页面显著地方给出原文连接,否则保留追究法律责任的权利。
该著作也还要发表在自我的单独博客中-Petter Liu
Blog

网站地图xml地图