Architecture and Design Guidlines.

 Key Design Principles

When getting started with your design, bear in mind the key principles that will help you to create architecture that meets “best practices,” minimizes costs and maintenance requirements, and promotes usability and extendibility. The key principles are:


Separation of concerns.(问题分离) Break your application into distinct features that overlap in functionality as little as possible.
Single Responsibility Principle. (单一责任原则)Each component or a module should be responsible for only a specific feature or functionality.
Principle of least knowledge.  (最少知识原则) A component or an object should not know about internal details of other components or objects. Also known as the Law of Demeter (LoD).
Don’t Repeat Yourself (DRY). (不要重复自己)There should be only one component providing a specific functionality; the functionality should not be duplicated in any other component.
Avoid doing a big design upfront. (避免一开始就做很大的设计)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 design principle is often abbreviated as BDUF.
Prefer composition over 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值