What is the relationship between design, architecture, and framework?
Everyone is designing
Before we talk about the topic, let’s start with the design.
In fact, each of us is doing design, no matter which industry, which level, and which position we are in.
- When the artist paints, he draws sketches to design
- Writers will outline the design when writing
- The programmer will write pseudo code to design when coding.
- When the cleaner sweeps the floor, he will design the execution path of the sweeping ground in his mind.
Design is big and small
For the field of software systems:
- At the method level, we can design method names, variable names, and statement blocks to make the method easy to understand, concise, and efficient;
- At the level of the class, we can design its methods, member variables, static variables, inheritance relationships, and visibility levels, so that a class can be better abstracted and encapsulated for others to use;
- At the level of the package, we can design and plan the location of each module code so that we can quickly find the corresponding code;
- At the service level, we can design the granularity of services, exposed features, and communication protocols to facilitate continuous interaction between services;
- At the system level, we can complete system-level collaboration by designing the exposed functions and collaborative forms of the system;
- There is still a hierarchy that needs to be designed, such as a large software system that is collaboratively implemented among multiple software systems, but each company may call this differently;
- The software system also has a hierarchy, but it may be the human system itself.
All levels of the design here has a simple design that provides an abstract interface in order to evolve independently in order to interact with peripherals, specific changes within the package . This is a fundamental idea in a large project that we organize to complete a complex task.
I just talked about the design of the software system field, but it can be extended to various fields, such as human systems, architectural systems, novel systems, and so on.
People who do high-level design are not necessarily proficient in the underlying design.
Of course, it’s certainly best for people with high-level design to integrate their knowledge of the underlying subsystems, but in most cases, we can’t do it because the level of the system we’re organizing is too much.
For example, the business code we designed can use the ability of the operating system to coordinate CPU, memory and IO to complete the execution of business code after compiling, but the person who designs the business code does not necessarily know how the CPU pipeline works. How the memory barrier coordinates multiple cores and memory, and how the data is transferred to other machines.
For another example, a large company CEO may not understand coding, but there are different types of generals, including technically savvy talents. Therefore, the CEO can manage the entire company as long as he organizes and designs a group to cover his knowledge. Includes a variety of software systems throughout the company.
From the above we can see that the ability of people who do high-level design and low-level design cannot be directly compared, because their capability stacks may be completely different and cannot be easily compared.
However, under the usual routines, the high-level design is transferred from the underlying design talents (called promotion, promotion is not appropriate, sometimes the underlying design talent is more scarce), because only your design ability is affecting After the level is not so large, you can rest assured that you can design at a higher level.
Architecture and design relationship
In fact, architecture is a design.
The architecture design stipulates some large-scale constraints and specifications between major components. Some smaller-level designs can satisfy certain characteristics such as readableness, reliability, and performance under these constraints and specifications. Scalability, security, and more.
For example, when we design a house, rooms, halls, kitchens, etc. can be imagined as architecture. When we are doing soft installation, we can’t change the original design. Otherwise, it is easy to cause a safety hazard by simply knocking on the wall. But we can control the soft, and form a different style of room.
Of course, the size of the design hierarchy is relative. The room layout in a room in the previous example is architecture. But looking up, in a block of architectural design, the interior layout of a house is just a small level design that does not affect the planning of the entire block.
Therefore, the term architecture should exist at all levels . Just as we are writing code, using various design patterns, such as the chain of responsibility, to specify the way to write the code, to ensure the stability and readability of the code by opening and closing principles, we are already this extensible The architect of the code.
Architecture and framework
A framework is an implementation of an architecture.
For example, the architecture design of MVC (architecture exists at every level) separates the concerns of different types of code, making the code clearer and easier to maintain.
And all kinds of MVC frameworks implement this architecture, as long as we extend our code based on this framework, then we can write code that conforms to the MVC architecture specification.
to sum up
- In order to complete something, no matter which position we are in, we need to design it;
- A design can contain multiple sub-designs that others are responsible for, and your design may be part of other people’s designs;
- To complete a complex task, splitting the design by level is a common method;
- In order to control the implementation of the underlying design and achieve some of the effects we expect, we have to standardize and limit the design. This is called architecture, which is also a design;
- Just as there are many levels of design, there are many levels of architecture;
- The framework is a concrete implementation of the architecture, using the framework and extending/encoding under the constraints of the framework/architecture can accelerate the implementation of our code.