Home Java javaTutorial 13 mistakes Java veterans should beware of

13 mistakes Java veterans should beware of

Nov 26, 2016 pm 01:38 PM
java mistake

Problems arising during the production process are gradually receiving the attention of middle and top management. Whether you are a developer or an architect, you should pay enough attention to the following items to avoid embarrassing situations in the future. You can also use it as a troubleshooting note.

#1. Do not externalize configuration properties in properties files or XML files. For example, the number of threads used by batch processing is not set to be configurable in the properties file. Your batch program can run smoothly whether in a DEV environment or a UAT (User Acceptance Test) environment, but once deployed on PROD, when it is used as a multi-threaded program to process larger data sets, it will An IOException will be thrown, either because of different JDBC driver versions or because of the problem discussed in #2. If the number of threads can be configured in a properties file, it becomes very easy to make it a single-threaded application. We no longer need to repeatedly deploy and test applications to solve problems. This method is also suitable for configuring URL, server and port number, etc.

#2. The size of the data set used in the test is inappropriate. For example, a typical scenario in production is to use only 1 to 3 accounts for testing, when the number should be 1000 to 2000. When doing performance testing, the data used must be real and uncropped. Performance testing that is not close to the real environment may bring unpredictable performance, expansion and multi-threading issues. Only by testing the application with a larger data set can you ensure that it functions properly and meets SLAs (service level standards) for non-functional attributes.

#3. Naively believe that the external and internal services called in the application are reliable and always available. Not allowing service call timeouts and retries will adversely affect the stability and performance of the application. Proper service outage testing is required. This is important because today's applications are mostly distributed and service-oriented, requiring a large number of network services. Endlessly requesting unavailable services can harm your application. The load balancer also needs to be tested to ensure that it is working properly to keep each node balanced.

#4. Failure to follow minimum security requirements. As mentioned above, network services are ubiquitous, making it easy for hackers to exploit them for denial-of-service attacks. So, when using Secure Sockets Layer, it is essential to complete basic verification and conduct penetration testing using tools like Google skipfish. Not only does an insecure application threaten its own stability, it can also negatively impact a company's reputation due to data integrity issues, such as a situation where customer "A" can view customer "B's" data.

#5. There is no cross-browser compatibility testing. Today's web applications are mostly rich single page applications that use JavaScript programming language and frameworks like angular js. In order for the website you build to run smoothly across different devices and browsers, you must implement a corresponding design. So to ensure that your app works across all devices and browsers, it must be tested for compatibility.

#6. Do not externalize business rules that may change frequently. For example, tax laws, government or industry-related requirements, taxonomies, etc. You can use an engine like Drools to process business rules, which helps you externalize these business rules by storing them in a database or excel. Once enterprises master these business rules, they can respond quickly to tax laws or related requirements with minimal changes and testing.

#7. The following documents are not provided

Write unit test documents and make them have good code coverage.

Integration testing.

A comprehensive or encyclopedic page lists all software components, such as classes, scripts, configuration files, etc., and these components are either modified or newly created.

High-level concept diagram depicts all components, interactions and structure.

The basic document tells developers "how to build a development environment based on detailed information about data sources."

In addition to COS (Conditions of Satisfaction), a form created by MindMap, there are two main document forms in agile development, 1 and 2.

#8. No proper disaster recovery plan and system monitoring and archiving strategy. As project deadlines approach, these things are often missed in the rush to deploy the project. Not setting up proper system monitoring with Nagios and Splunk not only threatens the stability of your application, but also hinders current diagnostics and future improvement efforts.

#9. There is no convenient column design for database tables, such as created_datetm, update_datetm, created_by, updated_by and timestamp. It also does not provide orderly deletion record columns, such as 'deleted' which can take 'Y' or 'N'. 'Column or 'record_status' column which can be 'Active' or 'Inactive'.

#10. Failure to develop a proper retracement plan. As a result, when the system fails, there is no way to restore the system to the stable state before deployment. This plan needs to be carefully considered and signed by the relevant team. The plan includes rolling back to a previous version of the software, removing all data inserted into the database and all entries in the properties file.

#11. No capacity plan was developed before the project started. Today, when stating platform requirements, it is not enough to simply say "requires a Unix machine, an Oracle database server, and a JBoss application server." Your requirements must be precise to

specific version of operating system, JVM, etc.

How much memory (including physical memory, JVM heap memory, JVM stack memory and JVM permanent generation space).

CPU (number of cores).

Load balancer, required number of nodes, node type, such as active/active or active/passive, and clustering requirements.

File system requirements, for example, your application might collect generated reports and save them for a year before archiving them. In this case, you need to have enough hard drive space. Some applications require the generation of data extraction files and their temporary storage for use by other system processes or data warehouse systems for multidimensional analysis reporting. There are also data files based on Secure File Transfer Protocol that come from either internal or external systems and need to be kept for 12 to 36 months before being archived.

#12 below comes from a comment by "David DeCesare" from "java.dzone",

#12, "Not using the best tool for the job." In many cases, developers will use a language or tool they want to learn in a production system. Usually this is not the best option. For example, using NoSQL databases for data that is already actually relational. Remember, no matter which tool you adopt, you will need to maintain your product for the next 3 to 5 years (or even longer).

#13. Lack of sufficient knowledge reserves in 16 key technical areas. These areas include identifying and fixing 1) "concurrency issues", 2) transaction issues, and 3) performance issues. In many interviews, I relied on these 3 aspects of knowledge to get new contracts.


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1262
29
C# Tutorial
1235
24
Break or return from Java 8 stream forEach? Break or return from Java 8 stream forEach? Feb 07, 2025 pm 12:09 PM

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP vs. Python: Core Features and Functionality PHP vs. Python: Core Features and Functionality Apr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

Java Program to Find the Volume of Capsule Java Program to Find the Volume of Capsule Feb 07, 2025 am 11:37 AM

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

PHP's Impact: Web Development and Beyond PHP's Impact: Web Development and Beyond Apr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP: The Foundation of Many Websites PHP: The Foundation of Many Websites Apr 13, 2025 am 12:07 AM

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

See all articles