当前位置:网站首页>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
边栏推荐
猜你喜欢
洞见科技解决方案总监薛婧:联邦学习助力数据要素安全流通
求解:在oracle中如何用一条语句用delete删除两个表中jack的信息
A data person understands and deepens the domain model
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Read the BGP agreement in 6 minutes.
Etcd storage, watch and expiration mechanism
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Zhongang Mining: in order to ensure sufficient supply of fluorite, it is imperative to open source and save flow
8个扩展子包!RecBole推出2.0!
Runc hang causes the kubernetes node notready
随机推荐
C#基础深入学习一
.NET 使用 redis
Alibaba cloud award winning experience: build a highly available system with polardb-x
eclipse链接数据库中测试SQL语句删除出现SQL语句语法错误
XML入门二
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
runc hang 导致 Kubernetes 节点 NotReady
WPF double slider control and forced capture of mouse event focus
6 分钟看完 BGP 协议。
Reinforcement learning - learning notes 1 | basic concepts
Using scrcpy projection
Commvault 和 Oracle 合作,在 Oracle 云上提供 Metallic数据管理即服务
上汽大通MAXUS正式发布全新品牌“MIFA”,旗舰产品MIFA 9正式亮相!
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
用fail2ban阻止密码尝试攻
求解:在oracle中如何用一条语句用delete删除两个表中jack的信息
Web知识补充
高效!用虚拟用户搭建FTP工作环境
How real-time cloud interaction helps the development of education industry
三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键