Some think about software design
1 Introduction
It has been working for five years. Think carefully, although many projects, but in software technology, feelings always progressively improve, on the one hand, on the one hand, on the one hand, I think, it is personal Summary and think about it.
So, slowly, it is still necessary to think and summarize some of your own experience.
Why only talk about software design, don't talk about software development, but also more contents such as software development, but also some of the contents of software project management, the design is just part of these years, I still feel I act A technical expert's role is more suitable, and then talk about management when you really have mature management.
Four years ago, when I passed the system analyst exam, I was very clear in my heart, and I was far away from the real system analyst.
Regretive four years later, I still feel that I have a truly system analyst or a quite distance.
But in any case, the software design is a development direction of my software technology expert. I will analyze it. I think it will be more beneficial to my future growth.
2 Why Design
In software engineering, focus on design, summary design, detailed design, very emphasized, so in the company's software development process, it is often required to have a design phase and design documentation.
Interestingly, in the new too, software quality and design document, there is almost no practical connection, I see the phenomenon, the project, software quality is often very general, many projects, software quality Still very nice.
In fact, the design and design documents have nothing to do with more design documents, and does not represent software design.
From the perspective of software, it will eventually affect the software quality. It is software code, the design is better, the encoded rotten, the result is still a bad software, so the code quality, under any circumstances, it is excellent software quality cornerstone.
I saw a book for a while, called "Programming Everest", which is a resolution algorithm for some specific issues. This book puts forward an important suggestion for programmers: Before writing code, do more I think, think more, is there a better solution?
A stupid programmer is a man-writer, a truly excellent programmer, should write the program after thinking.
I moved the examples from the book to give you a look:
[Question] There is such a text file, the file per line record is an integer, its value ranges from 0 to 1,000,000, normal data cannot be repeated, the file is approximately 500,000 lines, and the program is now written in the file and output a result file. The result file is sorted from small to large records for records of input files.
[Constraint] The system memory is only 256KB, and the file output can be completed within 60 seconds.
【analysis】
(First of all, this example looks more old, modern computer memory is far more than 256KB)
At first glance, it is a sorting problem. The special place is that there is insufficient memory. It is only 256KB, so it is unable to use a large number to do internal sorting, and can only use external sorting methods.
So the surface looks like this problem is more complicated (do you remember the external sort? Do you want to turn over the data structure? Or Google Search?), To meet performance requirements are also very difficult. If you give you more thinking, I think many people can think of the following solutions:
One byte has 8 bits, since the data of the file cannot be repeated, we can use a huge array flag to mark whether each number has appeared in the file. 256KB of memory, that can represent 256 × 1024 × 8 = 2,048,000, enough to represent 0 to 1,000,000. (In fact, even if there is insufficient memory, or need to indicate a larger number, you can put the logo array in an external file)
This is very simple, read the record from the file order, then set the corresponding bit in the array. After all read, scan the flag bit array, if the flag is True, enter the number to the result file.
Very Simple, the highest performance, and beautiful.
If I am a programmer, I started to solve this problem with external sorting, and then think of behind the method, I will be extremely depressed.
So if you want to be not depressed, you must remember, do more thinking before writing code!
If you want to further think about why it is necessary to think, this involves some of the essentials of software development. For example, do you want to build a good software system? Do you want to be an excellent software developer? If you want to do it, you need to think.
Design is one of the processes of thinking.
I think software development should have three levels: architecture, design and encoding.
From a certain point of view, it is exceeded the scope of the software product, which is a very high-level software structure of software products from the entire application solution perspective of software products. Most importantly, the software architecture should combine the company's strategy, business goals into software products, consider the design of the entire software system with systematic, strategic vision. If you use a small machine or a PC server? Is DB2 or Oracle? Is WIN2000 or Linux? Which software module is the self-developing or considering adopting some third-party software?
Recently, Zhang is in designing the next generation platform, which is a choice. It is to select the NAS server to make a file server, replacing the current PC server disk array to make a file server, as a software developer, from the software, use What file servers do not have any effect, but from the system perspective, the file server can withstand the throughput of high-speed data, it is likely to be a key to stabilize whether the system can be stably operated.
For example, the choice of the software system is to select Win2000, or Linux. Win2000 is simple and easy to use, and the project installer and system maintenance staff are relatively low, Linux is complex, how to weigh the choice between the two? Since the new system and hardware relationship is very close, the hardware driver and operating system is very large, because the Win2000 virus is serious, the vulnerability is too much, you must constantly play the patch, and after playing the patch, there is a lot of hardware drivers. Impact, the problem is very much, so next-generation platform must use Linux or UNIX, which is considered from the overall stability and robustness of the company's products.