当前位置:网站首页>The art of Engineering (3): do not rely on each other between functions of code robustness
The art of Engineering (3): do not rely on each other between functions of code robustness
2022-07-06 17:38:00 【Wzzzzzzx】
My code has three files , One is responsible for producing SVG character string , One is responsible for storing the string , One responsible for drawing
The code is roughly as follows , And three separate documents
class Producer {
void createSvgString();
...
};
class Storage {
void setSvgStying();
...
};
class Draw {
void drawSvgFigure();
...
};
Now there is a need , I need to judge this SVG Is the pattern a closed pattern .
At first, in order to avoid modifying too much logic , I'm building SVG String time , For closed containers , At the end of the string, a Z ending . Then I just need to draw classes , Judging it can solve the problem .
There is a big problem with this method , It's easy to bury a hole for subsequent developers . The method of determining whether it is a container depends heavily on generating SVG String function , If you ignore this later , When developing other functions for containers , When something goes wrong , It needs to be in another file , Solve in an irrelevant class .
So the practice here should be to create a function , Used to judge whether it is a container , Then pass the result to the drawing class .
When I work again , Pay attention to one function and concentrate on one job , Don't intersperse the work that other functions should do .
边栏推荐
- [VNCTF 2022]ezmath wp
- 【逆向初级】独树一帜
- Total / statistics function of MySQL
- Flink analysis (I): basic concept analysis
- mysql 基本增删改查SQL语句
- C # nanoframework lighting and key esp32
- Case: check the empty field [annotation + reflection + custom exception]
- EasyRE WriteUp
- 03 products and promotion developed by individuals - plan service configurator v3.0
- Grafana 9 is officially released, which is easier to use and more cool!
猜你喜欢

Final review of information and network security (full version)

EasyRE WriteUp

Interpretation of Flink source code (II): Interpretation of jobgraph source code
![[ASM] introduction and use of bytecode operation classwriter class](/img/0b/87c9851e577df8dcf8198a272b81bd.png)
[ASM] introduction and use of bytecode operation classwriter class

Virtual machine startup prompt probing EDD (edd=off to disable) error
![[reverse] repair IAT and close ASLR after shelling](/img/83/1c77e24e9430fb7ea775169a794a28.png)
[reverse] repair IAT and close ASLR after shelling

The problem of "syntax error" when uipath executes insert statement is solved

学 SQL 必须了解的 10 个高级概念

Models used in data warehouse modeling and layered introduction

【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
随机推荐
List set data removal (list.sublist.clear)
数据仓库建模使用的模型以及分层介绍
Flink parsing (III): memory management
Wu Jun's trilogy insight (V) refusing fake workers
Models used in data warehouse modeling and layered introduction
基于LNMP部署flask项目
Openharmony developer documentation open source project
02 personal developed products and promotion - SMS platform
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
C#版Selenium操作Chrome全屏模式显示(F11)
How uipath determines that an object is null
信息与网络安全期末复习(完整版)
微信防撤回是怎么实现的?
Akamai anti confusion
JVM 垃圾回收器之Serial SerialOld ParNew
全网最全tcpdump和Wireshark抓包实践
Wu Jun trilogy insight (IV) everyone's wisdom
远程代码执行渗透测试——B模块测试
connection reset by peer
TCP connection is more than communicating with TCP protocol