当前位置:网站首页>The only core indicator of high-quality software architecture
The only core indicator of high-quality software architecture
2022-07-04 13:41:00 【51CTO】
Software architecture (software architecture) The importance of software , As the importance of building foundation and frame structure for house construction . When the foundation is unstable 、 When the building frame is unreasonable , Hidden dangers 、 Inconvenience and higher costs will be faced in the subsequent decoration and maintenance stages . Because of this , Architectural design has become a discipline , With science 、 standard 、 Deal with it in a systematic way . The difference is , Software industry seems to have no software ( framework ) Design is a major , But from the fact that many software development engineers want to become software architects, we can see its importance and weight . This article will talk about software architecture , Explore the core indicators that I understand to measure the quality of software architecture .
Meta model of software architecture
Wikipedia (Wikipedia) The definition of software architecture is :
Software architecture refers to the fundamental structures of a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations. The architecture of a software system is a metaphor, analogous to the architecture of a building. It functions as a blueprint for the system and the developing project, laying out the tasks necessary to be executed by the design teams.
Besides , Institute of electrical and electronics engineers (IEEE) The concept of software architecture is also defined , Expressed as :
The fundamental organization of a system embodied in its components, their relationships to each other and to the environment, and the principles guiding its design and evolution.
In order to facilitate readers to grasp the focus of these two definitions , I marked the keywords in red .
however , I have my own understanding of software architecture , The origin can be condensed into software architecture meta model . use UML The expression is shown in the figure below .
This model only exists “ Simple ” Three elements of :
- • Concept Is the core of software architecture .Brooks stay 《 One month myth 》 Pointed out in , The main task of software development is to build the concept of complex software , The secondary task is expressed in programming language under the condition of meeting time redundancy and space redundancy . The former I call “ software design ”, The latter is called “ Programming ”, The combination of the two is “ software development ”. Behind software design , It implies the individual design idea , The design idea is further composed of design principles , And the principle is composed of design patterns . With thought 、 Principles and patterns are refined step by step to guide software design , In order to ensure the consistency of design to the greatest extent 、 Continuity and reusability .
- • Between concepts Relationship . When the concept is established , The relationship between concepts is also established . Of course , We hope the relationship between concepts is clear 、 clean , In order to do it “ loose coupling ”. From the perspective of software implementation , Relationships are usually expressed by interfaces , It could be a function 、 Class or network communication .
- • Acting separately or jointly on concepts and relationships constraint . Constraints are proposed on concepts and ( or ) The relationship should meet the requirements , It can be performance 、 Memory capacity 、 The real time 、 Reliability is all inclusive ( Non functional ) Content .
Based on the software architecture meta model, the logical architecture can be derived 、 Physical architecture 、 The data architecture 、 Operation architecture and development architecture , These architectures are the visualization of metamodels according to different scenarios and concerns . such as , The core concept in logical architecture is “ System “、“ Subsystem ”、“ platform ”、“ frame ” and “ modular ”, And the relationship is “ layer ”、“ agreement ” and “ Interface ”. Another example , The core concept in the development architecture is “ library ”、“SDK”、“ Package ”, Relationships are “CI/CD”, Constraints can contain “ Configuration Management ”、“ Maintainable ”、“ Scalable ”、“ Testable ” etc. .
It's not hard to see. , Software architecture is a very complex topic . This can also be explained to some extent , Why it is not easy to become a real software architect , And so many software engineers regard becoming an architect as their phased goal of career development . that , Facing such complex content , How to define the core indicators to measure its quality ? Or we can ask , Dealing with things like Chromium、Fuchsia The architecture of such large-scale software , What is the key to its success ?
High quality software architecture evolved
The meta model of software architecture shows , High quality software architecture must be based on the concept that can solve the reality efficiently and effectively ( Business ) problem . A seemingly simple sentence , But it often bothers people , The trouble stems from the individual ability and the natural law behind our understanding and solving problems .
Ability level , Individual conceptual ability is positively related to software architecture ability . Conceptual ability refers to whether an individual can grasp the main contradiction when facing problems , Start with the main contradiction and shape the concept to solve the problem . Individual conceptual ability level , It can be seen from the accuracy of the concepts they master and use ( such as , Similar to distinguishing between refactoring and rewriting ), The more precise, the stronger the conceptual ability . People with poor conceptual ability , Not only is the software architecture weak , Programming level will not be much better . Conceptual ability takes time to improve , Behind it is not just the accumulation of industry experience , It is more necessary for individuals to be willing to take the initiative to think .
Solve the same problem , The efficiency and effect of using different concepts to segment the designed architecture to solve problems are likely to be completely different . Bad concept segmentation , It will make the path to solve the problem thorny 、 Accident after accident , The logical transformation between concepts is awkward and inefficient .
From the perspective of natural law , Solving real problems through software is a process of gradually deepening and expanding the scope , And the degree of deepening and expansion is endless . let me put it another way , Please don't imagine designing a perfect software architecture from the beginning . This law also tells us , Don't think too much about flexible design at first , In many cases, that is a high sounding waste .
When deciding whether to adopt flexible design at present, authors usually ask themselves two questions . Question 1 , Is this flexibility clearly stated in the requirements ? If it is , Consider , Otherwise, ask the second question before deciding . Question two , Whether the cost of adopting this flexible design now and in the future is equivalent . If so, there is no need to consider flexible design at present , Otherwise, we should consider .
The above two aspects tell us , Good software architecture evolved , It is not designed after hesitation . Those architects who seem to be very experienced and capable , Because they have experienced many evolutions in other places before, they have stronger conceptual ability than ordinary people . However , Experience is constantly outdated , Business is also growing , These two factors determine that there will be no high-quality software architecture once and for all .
“ variable ” Is the only core indicator
If high-quality software architecture is evolved , Then the implication behind it is ( At any time ) Variability is the only core indicator of high-quality software architecture . The next question is , How to “ variable ”?
Just me Chromium From the secondary development experience of the project , The reason why this dinosaur level project can deal with the problem of architecture evolution well , The reason is to ensure that the whole project has the ability to refactor at any time . When it is found that the design of which module is unreasonable , It can be adjusted and improved through refactoring . When I first saw the great changes in the code of the two versions released successively , I was really surprised , At that time, I suddenly realized , A good software architecture is not the same code for a long time , It can change at any time . We are not worried about the imperfection of the software , But I'm worried that the software evolution is muddy and slow .
In reality , Many software that is deeply in tar pit is not that the parties do not know the problem and how to cure it , But suffer from inability to change . The code changes introduced to completely solve the problem are fundamental to these projects in terms of manpower and time investment “ Unacceptable ”, Can only be forced to continue “ Sticking dog skin plaster ”.
The difference between refactoring and rewriting is , The former is based on unit testing to ensure code changes , Ensure that there is no functional degradation when changing the implementation inside the interface . It's not hard to guess ,Chomium The project is a project that relies heavily on unit testing for quality assurance , This is a feature of many world-renowned large-scale software projects . However , The engineering practice of attaching importance to and implementing unit testing is not common in China , Few people or companies pay attention to and maintain unit test code as production code .
The dilemma of software platform and Zhongtai
Theoretically , The advantage of the software platform is :
- Improve the quality and efficiency of software development . Avoid repeated development of similar products through abstraction and reuse ; Precipitate knowledge and experience in code , Avoid similar products from making the same mistakes again .
- Output design ideas 、 Standardize and guide the programming behavior of software engineers who do customized development based on .
- Train engineers with software platform design ability . Software platforms usually need to be abstracted 、 Decouple and deal with the problems of universality and pertinence , This requires software designers to have better conceptual ability , Building a software platform will help cultivate people with this ability .
In the author's opinion , The essence of software platform advocated by the Internet industry is software platform , The so-called difference between the two concepts is only imposed for the purpose of creating concepts .
More than 10 years ago , When I was still working in the communications industry , I have experienced the embarrassment that the software platform has become the bottleneck of product development on it , It runs counter to the original intention of building a platform to improve development efficiency . The root cause lies in , The software platform has not solved the architecture well from the perspective of Engineering “ variable ” The problem of , This makes the software platform unable to adapt well to the needs of the development of the upper product business in the process of development and make changes in time , Finally, the development and evolution of upper level products are affected by the decline of adaptability .
Based on the author's experience in the communication industry , It is suggested that companies in the current Internet industry that are practicing software platform should pay special attention to solving the architecture of software platform “ variable ” problem . Otherwise, many years later , You also have to face the labor and money of splitting or abandoning the software platform .
The software platform can only deal with the architecture “ variable ” problem , In the event of a decline in adaptability , Enter a new round through reconstruction 、 Higher level life cycle .
At the end
Software architecture design is an eternal hot topic in the field of software development , Behind the noise , We can't just stay in the form of architectural experience sharing and learning , More attention should be paid to the construction of engineering capacity, so that the software architecture can be changed at any time ( The refactoring mentioned in this article is only one part ). Only the software architecture with the ability to change at any time , We can practice the experience learned from others , Otherwise, we can only talk on paper .
Recommended reading
边栏推荐
- 《预训练周刊》第52期:屏蔽视觉预训练、目标导向对话
- 面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
- XML入门二
- The old-fashioned synchronized lock optimization will make it clear to you at once!
- 干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
- 【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源
- FS4056 800mA充电ic 国产快充电源ic
- Rsyslog configuration and use tutorial
- Comparative study of the gods in the twilight Era
- CTF竞赛题解之stm32逆向入门
猜你喜欢
JVM系列——栈与堆、方法区day1-2
Zhongang Mining: in order to ensure sufficient supply of fluorite, it is imperative to open source and save flow
CTF竞赛题解之stm32逆向入门
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Practice: fabric user certificate revocation operation process
美团·阿里关于多模态召回的应用实践
面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
ASP.NET Core入门一
Annual comprehensive analysis of China's mobile reading market in 2022
Dgraph: large scale dynamic graph dataset
随机推荐
"Pre training weekly" issue 52: shielding visual pre training and goal-oriented dialogue
C#基础深入学习二
Meituan Ali's Application Practice on multimodal recall
Practice: fabric user certificate revocation operation process
使用宝塔部署halo博客
Etcd 存储,Watch 以及过期机制
mysql三级分销代理关系存储
CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合
2022年中国移动阅读市场年度综合分析
三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
Rsyslog configuration and use tutorial
一文掌握数仓中auto analyze的使用
PostgreSQL 9.1 飞升之路
PostgreSQL 9.1 飞升之路
N++ is not reliable
Iptables foundation and Samba configuration examples
使用Scrcpy投屏
[leetcode] 96 and 95 (how to calculate all legal BST)
How real-time cloud interaction helps the development of education industry