Before going to explains these 10 tips which can make your Java application more maintainable and easy to support Joe Maddon Cubs Jersey , let me tell you that I have personally made a lot of these mistakes myself. It requires a great deal of discipline, hard work, and to be vigilant about writing quality code. Sometimes you have to push back even to your team lead or managers bringing the points like support, which is often overlooked.
Don't swallow exceptions Please avoid swallowing the exceptions. The stack trace is the most valuable troubleshooting information. In the production system where the priority is to bring the system up and then find the root cause, these exceptions are gold Anthony Rizzo Cubs Jersey , without them, you will never be able to find what happened with your application at that moment. On the other hand, please don print the stack trace multiple times. Printing a stack trace is a resource intensive process and should be controlled i.e. you print more information while running on DEBUG or INFO mode and only print essential information while running in PRODUCTION mode.
1. It puts unnecessary load on the Application. I e seen throughput of application is reduced to half due to excessive logging.
2. It can fill up the file system very quickly and that can create issues for your application and other applications hosted on the same server. This is a serious problem especially if you are co-hosted with some other application. Do you know what will happen when root directory of certain flavors of Unix system fills up? - that right. No one can login into the host.
3. Troubleshooting will be painful, like looking for a needle in a haystack (if the poor support guy can ever get the log file to open).
Don't Forget to Close Database Connections This is one of the most common reasons for production issues in the last decade, but thankfully with modern frameworks and library Addison Russell Cubs Jersey , this issue is actually slowly disappearing (as the framework takes care of openingclosing connections). If you are an experienced Java developer you would have noticed that most of the issues are exposed in the production environment rather than in UAT or QA environment, especially concurrency related issues? Do you know why? because of production load.
Yes, it is the job of the load testing team to test your application with the production like load. But that does not mean that as a developer you write code that does not scale well. For example Jason Heyward Cubs Jersey , it works fine for 1 user, but what happens when there are 500 users online simultaneously.
Avoid loading large result sets from Database This is one of the common mistakes made by beginners and intermediate Java programmers who don't know about paging or pagination. You simply cannot load every record e.g. order or trade from database in one call. In some cases, obviously, you will run out of memory and it is also a waste of network bandwidth, CPU and memory as the user might not need all of those data. Avoid hard coding Configuration Parameters You might have heard this tip several times but you would be surprised if you look at the code written by many professional software engineers and programmers. There is hardly a code where something is not hard-coded but hard-coding configuration values like URLs Ben Zobrist Cubs Jersey , directory locations, usernamepasswords, cache sizes, log levels etc in the code results in hard to maintain Java applications.
Avoid packing multiple versions of same JAR files Packaging utility jar files in several places, especially various versions of the same utility jar in various locations is the cause of many production issues.
You must have a clean build and versioning processing Kris Bryant Cubs Jersey , especially for internal applications. Consider using Maven for dependency management, it makes life a lot easier than keeping versioned JAR files in the lib folder.
More About the Author
We offer innovative and customized Java Training in Bangalore. Best Java course in Bangalore with Certified Experts. Go to free demo classes, get prepared by 8yrs experienced tutors and furthermore get hands on live project. Visit: Total Views: 83Word Count: 751See All articles From Author Coco Betaine Market to Record an Exponential CAGR by 2023
by omkartmr · February 5, 2019
Cocamidopropyl betaine (CAPB) or coco betaine made from coconut oil is a derivative of cocamide and glycine betaine. Coco betaine is a mild co-surfactant that is compatible with anionic, non-ionic Kyle Schwarber Cubs Jersey , and cationic surfactants. It is an efficient cleanser and foam booster. It acts as a viscosity enhancer, a conditioning & anti-static agent, and a moderate emulsifier. Coco betaine finds applications predominantly in cosmetic products such as body washes, shampoos, bubble baths Yu Darvish Cubs Jersey , cleansing lotions, creams, hand soaps, baby products, hair conditioners Javier Baez Cubs Jersey , and cream rinses.