Life has a good friend is not easy, a friend is a database DBA (operational direction) was born, the software development is not much experience, but recently at hand there is something to make it to software this thing began to have interest. So he asked me this question. I, the level is very poor, so big title throw over, how to answer? Fortunately, the friend gave clear direction:
Code management, version control, patch management, architecture design, module partitioning, interface design, error coding, log design, test methods, security control, performance planning
Then I have to answer according to these, since I have written so much, I will take it out and share it with you.
1, code management, version control, patch management
For a single product company, the problem is the various iterations and the management of these iterations.
First of all, sit down and discuss the factors that affect our code changes. Requirements, bugs, planned, unplanned?
Traditional software management usually divides the requirements into a number of phases, then builds the plan for each issue and then plans to do it.
However, modern software is biased towards agile management, using user stories to break down requirements into different scenarios, manage stories, and then move forward in an iterative way, then revise the overall objectives of the project in a timely manner.
Back to code management, I have a principle, whether you are a demand or user story, when you open your computer to start writing, it is necessary to clarify why you coding, and then each time you commit the version must and your code base, task (a kind of integration in the project management tool inside the tasks, You can also understand that a line of demand within Excel one by one corresponds. For example, you are doing an interface today, the interface only completes a function, such as changing the password. Then write down what you are doing and what you need to know about it. To put it simply, every commit is an atom commit. Then commit, at a minimum, to ensure that your code can be compiled and passed.
Versioning, it is often necessary to consider the management of the branch and the management of the label. In fact, I have a good way to ensure its security, that is, without version control tools. They are not as reliable as copy-paste/compress packages. If you are certain that a branch is to be published, you first need to use the Release tool for Branch Publishing, and then the patch for the branch continues on it, then merge it into the main branch as appropriate. But at the same time, please do one thing, download it, compress it, and put it on a file server. Then, once you have a problem, find a text comparison tool, and you'll usually be enlightened.
Patch management This matter, just also mentioned, you really to which version of the problem, on which branch to change, and then the timely merger, of course, you are not so big when the difference is the best.
Here is a digression, the core of agile I personally think that is not how to say clearly the user story, but you have to have unit test, no this is not nonsense ... Of course others are also important, but unittest is a necessary level. This is an important reason why the outsourcing software industry often does not get agile, because it is not so easy to do.
2. Architecture Design
Architecture design It's not that cool. One or two words can explain the white things, but a few people think it is more important principle.
A, moderate design, in fact, this degree, how difficult, in a person began to look at a problem, nature has its own point of view in the inside, your perspective must not be the center of the world, then reasonable split can be, in the spirit of pragmatism to do architecture design, usually in the cost, A good balance can be achieved in terms of intelligence and so on.
b, reasonable, in fact, object-oriented programming is the best place is to let a piece of code to try to simulate a thing itself, which is like the database design inside the relational table, it must express the right relationship, so even if it is defective performance. These are in fact and what code readability and so on are interlinked. That's why most people think that multi-threaded routines can be difficult, because it's not usually the human mind. This reasonable design usually starts from the design of the database to affect your entire complexity. This usually varies with the architect's perception and understanding of the problem, and at different times in the project's progress, it may not be so at the beginning of the project that something is reasonable.
All of this is nonsense, because it is not operational, it is when you have to make a decision to think about it to help. So what are the rules to follow?
In fact, usually we are accustomed to solve them with the problem, such as your performance requirements are very high, you want to reach a specific SLA, then you start to choose the technology and framework in these aspects are more careful, and then use your familiar rather than your indefinitely technology to solve, so even if the problem, You can at least know how to think about the problem without suspecting that it is not a reliable thing. Then is to include all the points that affect these, since that is the performance problem, then the database, index, etc. are to be considered, and some can be separated from the business, but also can be resolved from the business, such as clearly a page users just want to see a value, but you always on the page with a large list, And the big list just again query a big table, then this page must have a problem.
3. Module Division
Module division is actually your function of the reasonable separation of the process, you can put your home master bedroom, second bedroom, kitchen bathroom split, you can figure out why the electric business classification inside will not put the fan into the digital products, it means you master the basic rules of the module division. These are vertical divisions that are subdivided by domain.
I don't think you want to know about this. Also includes hierarchical management, software is a hierarchy of upper and lower layers, in fact, from under you run hardware to the operating system this level is usually done, and then is to do your software part, so touch your operating system is usually the software company to the various frameworks, such as. net The framework and Java virtual machines, and then the architecture framework, what ASP. NET, servlet, etc., do not involve your business, usually solve the technical problems, and then you see now the mature solution is usually started from the interface (perhaps an interface, There is always an interaction with the outside world), then from this layer down, to just that layer of the bottom of the frame you need to split. See if you need to access data, such as the database, whether it is SQL or nosql, it is necessary to go to the joint, and here is the evaluation of your interface between the design capabilities, and then you imagine you design the interface like the socket above the standard socket, the upper layer is no longer concerned about the implementation of the lower level, if there is a problem, Let's change the lower level. Then you peel it off one layer at a level, and you just want to do the external interface (perhaps the interface). What three-tier architecture or something, is just a general classification of these.
But according to your thinking, perhaps your mind is a visualstudio inside of the solution panel, you want to know is a large solution of the various assemblies (DLL/LIB) classification, then you go back to your most familiar windows/linux under the good, Responsible for the network is the network drive, how it is implemented, I am responsible for the network, you can find me. Then the IO is responsible for the IO is good. The partition of the assembly is almost like this, with SSO example, add decryption we will have a separate module, and then do the specific business logic will have, and then some auxiliary small code (such as check the IP address ah what), it is probably a little bit out of this.
4, interface design
Many of the above ideas in the interface design is actually the same, in fact, the responsibility is clear, an interface as far as possible to complete an atomic operation, do not complete many things, unless you take it as a thing to do. This granularity of the grasp also needs to think clearly. For example, to change the interface of the password, you do not add the logic of resetting the password, even if the code behind you can not wait to invoke the same set, also need to expose two interfaces. Interface is designed to show that it is relatively stable, any modification of the interface is a desperate, principle, the agreed function is not to be reduced, even if it is unreasonable, this is the interface the most difficult place. Just like you released the Lamp base interface, and then the whole world is for you to produce electric lights, and then you say no, round you don't like you like Fang, I changed ha, then, you know, go to the streets not to be beaten. Then the design of the interface needs to be reasonable, even if you leave an unused parameter, internal you do not need, you can write dead, but must be reasonable, only in this way, the future use of this interface standard procedures will not be affected. Then the idea of unit testing is very important, the interface is always to ensure that the previously tested scene after each upgrade can still run normally, or your interface at any time may have a ripple reaction.
5, Error coding, log design
Everything belongs to this, the thing is you determine a list, and then spit it out of the process, windows so many wrong, nothing but a bunch of code, out of the problem to KB inside a search out all kinds of code. As for this rule is similar to mobile phone number or zip code, or according to the barcode scheme, this scene is different, even if you do not regularly to make up, they are just an ID function.
There may be a point here, this coding and log design is usually together, in fact, when you need to record the program, even if you think it will happen 800 years, you also need to give people a legitimate code and perfect explanation, then you do not when the system pops up "wrong" time, You look at more than 10 of the same mistakes. I tend to be wrong always the only way.
in modern software programming, you can use the idea of AOP to collect them, this idea and the program is similar to horizontal slicing, it is usually reflected in the code, your code is clearly just the business logic, but it automatically helps to record the log, And can tell you exactly which program is the first few lines where to do what. Of course this also has a price, just as you install a filter on the faucet, then the water will naturally be smaller.
Now there is nosql, mass storage becomes more convenient, and then analysis of the matter with the use of offline computing, it can be calculated, but remember, be sure to keep the information as much as possible to record.
6. Test method
Traditional testing is of course very important, and what is important is smoke testing, user acceptance testing, regression testing, and integration testing.
Here to mention more is automated testing, although I am very difficult to use this point in the project, but its thinking I very much agree, because it is the code to test the code, the code is what, is your experience of the accumulation, you find a sister to go up to point, the process is experience, you let sister point 20 times maybe sister can kick a foot, But once the code is complete, it will only become more and more accurate. Now software engineering on the face of similar interface click on these have been formed tools, but to be honest, the domestic industry is not very good at mastering. Of course also because there are many imperfections.
Through continuous and repeated testing, it is plain to know that more experience and physical exertion can achieve better results, whether people or machines.
7. Safety Control
Security control, the security group now do those things, including the use of security tools to scan, to find Red Hat organizations, in fact, based on industry experience to achieve the role of supervision. Of course, software development, the essence is a smart thing, such as your home building, you know the installation of Windows, need to have a lock, and the lock must be inside the house, not outside, low floor need to install anti-theft window, anti-theft window must be narrower than a normal person, these are experience. There are a lot of ready-made experiences that need to be mastered before programmers start working, but they should not assume that programmers know everything, but they are very cute. I just started to write the web, that time did not go to the security side to think, because the previous has been done is the Windows interface, there is no so-called security between different windows, but when doing the web, really do the kind of pages other than the login page can not log in, knock an address can go into the low thing, Later discovered, only from the Web principle to understand the problem, but this thing, after all, is a consciousness and insight problems. Most people who do not do bad things do not know how to do bad things, so we still need to learn more.
Then there is a good infrastructure, development specifications, many company programmers do not know this, but they do not cheat, such as single sign-on to help them solve the problem, because the architecture requires a user at least logged in.
In particular, the interface is mentioned here, usually a lot of people do the interface is safe, because it is difficult to test, but also see, but this piece usually need to be valued. But like what WebService standard inside has a set of safety norms, of course, in addition to large companies, we may not have much control.
8. Performance Planning
Performance, is it a math problem? First you know how much performance pressure you have, and it's not natural for you to put the wheels of a little wheel under the truck. It's better than before. Distributed computing allows performance to be decomposed from a single computer performance bottleneck, but distributed .... Usually applies to things that can be distributed ...
In fact, in our common scenario, is nothing more than Web performance and database performance, Web performance is now all using load balancing to separate, in fact, many times the stupid programmer to do stupid things need the server CPU to pay the thing is not uncommon. Performance problems, most of the problems, such as time-consuming programs in the work, such as slow network, IO operations, access to the database, cross-border operations are often prone to performance issues. For example, the speed of accessing memory is usually not a magnitude of access to the database. Then accessing the database within a for loop is a less appropriate approach. Then a one-time read and for may help you, of course, not all scenarios. There is a good algorithm, such as a loop algorithm complexity is O (n), and a hash table algorithm complexity is O (1), usually we do not need to write these, but choose the right data structure to deal with the problem, become very important.
As for you say your server should buy how good, then I do not know, after the pressure is measured, look at Buy can afford the most expensive, and then adjust the program to go.
What is it about software development?