Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Improve the efficiency of Java Web background development

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Techniques commonly used in the development of Java back-end services

It is difficult to choose a good MVC framework for the development team, and it takes a high level of experience and level to choose among the many possible solutions. One of your decisions will affect the team for years to come. There are too many things to consider:

Easy to use to improve development efficiency. Focus a small part of your energy on the framework and most of your energy on the business.

Excellent performance, this is the most eye-catching topic.

Try to use the popular framework (the architect can customize the lightweight framework, the simpler but the framework that can complete the business function is the best, and it is convenient for refactoring). The newly recruited developers have inconsistent technical skills and should be considered according to the lowest level of personnel. Reduce the impact of mobility and re-adaptation.

This is the preferred condition for most projects based on these conditions, lightweight frameworks are generally chosen, and if architects cannot customize the architecture, Spring is preferred (after all, it is more popular).

However, using Spring to develop service applications requires developers to have a certain foundation, at least 3 years of experience can stand alone, and the efficiency will certainly not be higher than that of more than 5 years of work experience.

Uncover the regional direction that can be optimized in the process of back-end development

If you want to optimize the back end of the service, you must first understand the modules that can be optimized, as well as the feasibility of framework optimization. Spring and Mybatis, the current mainstream framework, are convenient to use and develop, but at the same time limit the extension, framework is not lightweight, want to expand and modify, you must have quite experienced architects to deal with, and the testing time is quite long, which is not conducive to ordinary developers.

The average developer is really only concerned with business implementation, and there is no need to think about anything else. For example, developers do not need to consider how the framework stores data to the database and the specific implementation process of permissions (ordinary developers only need to consider how to implement business functions, as well as the efficient and reasonable implementation of business functions), specific modules such as data storage, permissions module is mainly designed by architects.

The architect designs the corresponding module interface, such as login, the architect only needs to provide the details of the login interface, and the developer only needs to call the interface to complete the login operation.

The interface can be designed by the architect as to which framework the developer uses, so that the developer can just call the method without paying attention to the framework. (developers can complete development tasks without knowing the Spring and Mybatis frameworks).

Therefore, the architect can consider designing the original three-tier architecture model as an interface-micro-service mode, with each function as an interface module, so that the deployment service provider can scale out for load balancing and update a single module conveniently and flexibly. Without stopping the whole service, it can achieve zero service maintenance and provide services 24 hours a day.

The architect can assign a single module to the designated developer, the developer only needs to implement a single module, and the function of the single module can be implemented using the method specified by the architect, but the framework provided by the architect can be used for process design. Functional development can be carried out without coding.

Understand the author's efficient framework for customizing the architecture after many years of project experience

Because I am really lazy (I can't help it, I find it very tiring to write code for several years), so I wonder if I can develop the back-end function without writing code. I have been doing ETL Kettle development all the time. After learning about the data flow plug-in, I found that Kettle running idea can be applied to Web request development. The following Kettle development interface:

The diagram perfectly shows the login judgment process, where

INPUT: receives the parameters, user name, password and other information passed in by the user

Judge: used to judge the parameter information passed in by the user

Login and user information: get basic user information

ADMIN_CHECK: determine whether you are an administrator or not

PutCache: put in cach

Through visualization tools, it is convenient to design functional processes, ranging from obtaining single record information to querying data and other functions.

Testing is also very convenient to pass in request parameters directly through visualization tools without using development tools (Eclipse, etc.). Actual project developers who do not have the ability to code can also complete the assigned functional tasks.

Flow tools:

The main design concept refers to ETL tools such as Kettle, which is used for the systematic mode of data flow processing, and brought into the concept of Web.

Just imagine, a Web request server, how to deal with the server? What needs to be done with the data returned to the client after processing, and so on.

Analyze the specific steps, and divide the functions into building blocks, first consider minimizing the module.

Such as login module:

Receive incoming parameters

Determine whether the user name exists

Determine whether the password exists

Determine whether the user name format and password format are correct.

Judgment verification code

Find out if a user name exists in the database

Find the user and determine whether the user password is consistent with the input password (password judgment)

After judging the success, a token is generated and returned to the user. If it fails, an error message is returned.

The simple login process is simplified to the above eight processing steps. Analyze these eight steps, and the plug-ins required for each step can be classified as follows:

INPUT receive parameters plug-in

Judge filter plug-in

Data format validation plug-in

Database record query plug-in

Return message plug-in

Constant plug-in

As shown below:

We can see that several plug-ins are mainly used in the figure, such as INPUT (receiving parameters entered by the user). The configuration is as follows:

Add constant: set constant user output information, as shown in the following figure:

Filter plug-in: determine the field value, as shown below:

Data format verification: determine whether the format of the field value meets the requirements, as shown in the following figure:

Data query plug-in: query database table record values, as shown below:

Output selection value: select the field for the next step, as shown below:

Now we find that the function that originally needed to write code for user login verification now only needs to configure the specific implementation process, without coding, is it very convenient? and you don't need someone with development experience to configure it.

How to lead the Java team to develop and maximize efficiency

Project architects and managers (preferably the same person, who have a thorough understanding of the project) should consider the level of the team and design the framework based on the newest developers, rather than blindly catering to the architects. Architects should consider developers as product users to design reasonable products for developers to use.

In addition, architects should be as lazy as possible (in this case, they can do the work through tools without a lot of coding). Only in this way can they think about how to improve their efficiency, rather than working overtime every day to highlight themselves. I don't approve of overtime all the time. Nothing needs to be dealt with by overtime, and if necessary, it is also an emergency for online operators, not in the development process.

The improvement of background development efficiency depends on the following:

1. Personnel allocation

In theory, the more project configuration, the higher the development efficiency, but the blind increase of personnel does not increase the burden of managers, and software engineering configuration personnel have certain rules, not the more developers, the better.

two。 Frame selection

Choosing a suitable framework can better improve the development efficiency, but the selection of the framework should take into account the overall level of the developers in the same group. The framework offer is as simple as possible, simple but not complicated and optimal, and the testing requirements of the team should be taken into account. If the framework selection allows testers and requirements personnel to participate in the development (generally only testers are required to develop together If the framework selection can allow requirements personnel to participate in the development together, after all, it is every manager's pursuit to squeeze human resources during the development project.

3. Code workload

There must be a lot of code in the project, but if you can minimize the amount of code for development and give people more time to focus on the business direction (after all, the development project is mainly closely related to the business), since you don't want to write extra code, you naturally want to achieve it through visual operations (now APP development can be visualized, and one can be generated in a few minutes). The architect's main consideration is to develop a framework that allows developers to visualize their work.

Detailed efficiency:

In terms of staffing, my project is currently staffed:

The architect and development engineer (A), the development engineer (1-2, B and C) have no development experience or are seconded from the test team and other departments (no way, the company does not assign more people), testers, and requirements personnel and other groups.

In view of the above personnel mix, if you choose frameworks such as Spring MVC, only A has the ability to develop quickly and needs to write a lot of code, and B and C need to train them in advance, and then start developing them after the training, which is certainly not as efficient as experienced developers, even if B and C have the same development capabilities as A, and the amount of coding developed by three people at the same time is relatively large.

At this point, if A develops a tool that allows B and C to visualize programming operations, such as the architecture used in the current project, B and C can complete functional development without basic development capabilities through the tool T_VISUAL (visualization tool developed by A), as shown below:

With reference to the open source software ETL tool KETTLE implementation pattern, a background program flow tool is developed. For example, VALI_LOGIN_CHECK on the interface represents a function block, which can be used as a simple judgment function block, where the INPUT plug-in represents the parameters for receiving WEB REQUEST requests, as shown below:

These three parameters are passed in from the page request, and the next steps are to determine whether the user name and password authentication meets the verification requirements.

With the above tools, An only needs to make every effort to develop the required functional plug-ins, while B and C only need to plan business functional blocks, such as login, registration, access to user information, product list and other functional modules needed in the project. You only need to create the corresponding functional modules. B and C do not need coding, only need to visualize the design process, and then only need to arrange the module function, personnel arrangement can be expanded geometrically, without worrying about the ability of developers, with the help of tools, only basic developers are needed. You can have some logic ability.

If the architect has not developed the corresponding visualization tool, it is recommended that the architect should try to separate each unit operation class into a single plug-in (similar to the plug-in step of the above tool), so that when writing code, there is no need to write the details of the function block, just write the function flow, that is, when writing.

As shown below:

Among them, An only needs to write the content of the function block, and B and C only need to call the module class with heavy function block for splicing. The difficulty of the project lies in the implementation of the function block, and the specific module does not need to consider the implementation of the specific function, but only needs to consider the business process, which requires less development ability, so that A can lead B and C to carry out the development. and A does not need detailed guidance to B and C, just need to answer when they think there is a problem. Everyone can be more focused, and if subsequent functional modules need to be added, they only need to add the same level as B and C, without the need to add Class An engineers. Greatly reduce personnel costs, development efficiency is also high efficiency.

Although the choice of Spring MVC on the Web framework is in line with the mainstream, it requires relatively high personnel. In order to take into account the team as a whole, you can consider some lightweight frameworks such as JFinal (now used in the project), which have lower requirements for personnel and are suitable for junior developers.

These are some of the experiences I have summed up and some methods summed up in personal team development, mainly taking into account the rest of the team. After all, the high-end framework looks perfect, but it is a nightmare for developers, especially in terms of writing a huge amount of code.

Follow up

The summary of many years of development experience is that programmers need to be lazy, because only laziness can develop efficient tools and processes. You can see that a developer has a huge amount of programming code every day and seems to be diligent. But it is less than half the workload of a developer who uses tools. Sometimes developers stop to think about how to simplify the current workflow, and the code can be written as small and refined as possible. In order to develop reusable tools.

Finally, I enclose my official account:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report