当前位置:网站首页>. Net six design principles personal vernacular understanding, please correct if there is any error
. Net six design principles personal vernacular understanding, please correct if there is any error
2022-07-03 14:52:00 【Xu Ziqian】
Opening and closing principle : On the extension , Close... To modification , Interface is a good example , It can be extended on the basis of the source code , But you can't change the source code
A single principle : Single function , A class represents a function .
The Ritchie principle : Subclasses can be used as parent classes , Subclasses need to inherit all methods of the parent class
The principle of Dependence Inversion : Rely on abstract interfaces , Don't rely on concrete implementation , Try to use interfaces to encapsulate common ground
Interface isolation principle : Split bloated interfaces into smaller and more specific interfaces , It is not a method with high commonality that is pulled out and encapsulated into an interface ,
You need to use the methods in the new interface to inherit the new interface , If you put many subclasses in an interface, you don't need some methods inside , It seems that this interface is relatively bloated ,
Don't put all methods into the same interface in order to save trouble .
Dimitar's law : Reduce coupling between classes . Each class minimizes dependencies on other classes , Make the function module function as independent as possible . For example, you need to pass the class 1 Display methods display classes 1 And the class 2 The data of
Don't be in class 1 Write the display class directly in 2 Logical code of , But in class 2 Finish writing the display class 2 Methods , Then it is passed to the class in the form of parameters 1 The presentation method of a class 2 The object of ,
Then call class 2 How to show
边栏推荐
- CentOS7部署哨兵Redis(带架构图,清晰易懂)
- C language memory function
- Joomla! CMS 3.0~3.4.6 RCE
- Amazon, express, lazada, shopee, eBay, wish, Wal Mart, Alibaba international, meikeduo and other cross-border e-commerce platforms evaluate how Ziyang account can seize traffic by using products in th
- Dllexport et dllimport
- [engine development] in depth GPU and rendering optimization (basic)
- [qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?
- B2020 分糖果
- How does vs+qt set the software version copyright, obtain the software version and display the version number?
- Vs+qt multithreading implementation -- run and movetothread
猜你喜欢
![Luogu p4047 [jsoi2010] tribal division solution](/img/7f/3fab3e94abef3da1f5652db35361df.png)
Luogu p4047 [jsoi2010] tribal division solution
![[graphics] adaptive shadow map](/img/93/a6a3c7716331368c90c2c86da11f55.jpg)
[graphics] adaptive shadow map
![[ue4] material and shader permutation](/img/8f/7743ac378490fcd7b9ecc5b4c2ef2a.jpg)
[ue4] material and shader permutation
![[qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?](/img/f6/fe61c84f289f0e74a45946dac687a6.jpg)
[qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?

表单文本框的使用(一) 选择文本

Detailed explanation of four modes of distributed transaction (Seata)

Niuke: crossing the river

Open under vs2019 UI file QT designer flash back problem

Talking about part of data storage in C language

PS tips - draw green earth with a brush
随机推荐
Write a 2-minute countdown.
[graphics] real shading in Unreal Engine 4
Awvs batch operation script
7-10 stack of hats (25 points) (C language solution)
5.2-5.3
dllexport和dllimport
Pytorch深度学习和目标检测实战笔记
Paper sharing: generating playful palettes from images
[graphics] adaptive shadow map
Zzuli:1056 lucky numbers
Zzuli:1043 max
Zzuli:1046 product of odd numbers
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
Yolov5进阶之七目标追踪最新环境搭建(二)
零拷贝底层剖析
C language fcntl function
C language dup2 function
Find books ()
Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
Déformation de la chaîne bm83 de niuke (conversion de cas, inversion de chaîne, remplacement de chaîne)