I have read a lot on the Internet. It is really hard to find out about Java software architecture. However, the architecture of software development is basically the same. Therefore, I found many articles about software architecture in other languages on the Internet. Here, we also talk about our own views on the software architecture, especially in the Java project architecture. Not necessarily true, but this is my conclusion over the past few years.
1. Try not to consider reuse outside the project
Many people think that it is the best way to improve software reuse. However, the actual situation of each project varies. When designing a module or method in a project, the reuse outside the project is considered too much, it will inevitably increase the complexity of the project and overhead the development time. Some may say that this will reduce the overhead of the next project. What is the next project? What are the requirements? What are the influencing factors? Who knows about it now. If the project is to be reused, the reusable part should be extracted after the project is completed, and modified and optimized as the reusable assets of the enterprise, rather than the wishful thinking in the current project. Considering the reusability outside the project, this is a common mistake made by many programmers who are just engaged in software work. The more they think about it, the less effective the software can be, the basic functions, code logic, and program functions are incomplete.
2. Check the project architecture frequently.
A project architecture is a general design that is determined before the project implementation starts. However, the understanding of project requirements and estimation of complexity remain in the initial stage. If the architecture cannot be improved with the understanding of the project during the project development process, the project members must develop the project according to the wrong architecture. Therefore, the project architecture must be checked frequently for necessary reconstruction.
3. refactoring
Some people say that it is a waste of time to modify the data after writing so much. He may not have thought that one afternoon of Refactoring can speed up development in the next few months, which is unimaginable. In addition, through refactoring, we can usually think of more simple methods to replace existing implementations. Such experience can also simplify the development of other modules.
4. Avoid over-integration and let each module do its own thing.
A common example of OA development is that there are usually a lot of approvals in the business system, and many people will surely think of making approval into a common module. This is no problem. However, the common problem is that too many people put the business processing after approval into the business logic of the approval module. In fact, for business modules, the approval process should only be completed. As for what to do after the approval process is completed, let the modules responsible for this process handle it by themselves.
5. Avoid excessive flexibility
Design and Code are not as flexible as possible. A common example is that different objects can be operated using classes or methods when using generics. However, in a three-layer architecture commonly used in Java, if a series of classes are originally intended for a specific object, you do not need to specify them as generics, and then specify them as specific object classes when using them. This is quite superfluous.
6. Reduce the icing on the cake Function
The page is refreshing and the display effect is cooler. It is a icing on the cake for the business system. If these factors make the business interface very complex and bring a series of problems to the business processing, in extreme cases, when business processing cannot continue, it is useless to have a beautiful interface. For one piece of advice, consider other things only when ensuring proper business processing. A prerequisite for this is to communicate with users as necessary. That is to say, the focus of Java-implemented projects is on business processing. Only by well implementing business processing can we consider the appearance of the interface and the user's visual senses.
7. Proper splitting
This is similar to 4. Minimize the complexity of each module and convert mental labor into physical labor. A common example is to add, modify, delete, and view a form. However, the first three operations are generally performed only by a person with a specific function point, status, and specific permissions (maybe only on the only interface in the system ). However, the view operations are distributed across all corners of the project. If you place these four operations on the same interface, you can reduce the number of interfaces, but increase the complexity of the interface, to make necessary judgments on various states and conditions for Read-Only setting of interface elements, this increase in complexity is exponential. if you split the viewing results, the workload will be linear, even if you want to make 10 viewing interfaces, the total complexity is changed
10*10 is much easier to handle and can be componentized.
8. Maintain good communication with customers
Many people do not pay attention to maintaining communication with customers. Many architects believe that communication and communication are only required during the project requirement stage. This is a bad habit, because the customer's requirements will change over time, only by maintaining good communication with the customer can the customer understand the customer's demand changes in the first time, so as to adjust their own project architecture solutions, meet the customer's needs in the shortest time.
9. Connection between project architecture and database architecture
Many people think that a project does not need a database during development, as long as it is implemented in the memory. I personally think this is a bad habit of development. The database depends on the specific needs of the project. However, if a project does not take the database architecture into account during the architecture process, it is very likely that what is implemented in the project will be hard to record in the database or the database design will be very troublesome, this increases the difficulty of project development. In addition, if the database is not considered during project development, some business logic cannot be implemented and data is lost after the project is linked to the database.
Of course, many people may have different architectural insights based on different architectural styles, and my insights are not necessarily correct. I hope you can learn something from me and share your thoughts on architecture.