Posts

Enforcing Java Singletons is Very Hard

  Background A  singleton  is a class that is instantiated exactly one time and can be used to represent "global" or system wide components. Common usages of singletons include loggers, factories, window managers or platform components. My general tip is to avoid using singletons when possible, because it is difficult to break out or override functionality and also to write test mocks and they also tend to create a bad over all code structure. As it turns out in this post, they are also insecure. know more java training Many efforts has been made to devise good singleton patterns but there is one surprisingly easy and efficient way of doing it. However, there is really no rock solid way of guaranteeing that the  singleton  integrity is not breached. Read this post and see if you agree. The Final Field Scheme This solution relies on keeping the constructor private and exporting a public static final member to provide singleton access like this: public class FooSingleton {    

50 Senior Java Developer Interview Questions (ANSWERED) To Know in 2020

  Q1 :   What is JVM? Why is Java called the “Platform Independent Programming Language”? Answer A Java virtual machine (JVM) is a process virtual machine that can execute Java bytecode. Each Java source file is compiled into a bytecode file, which is executed by the JVM. Java was designed to allow application programs to be built that could be run on any platform, without having to be rewritten or recompiled by the programmer for each separate platform. A Java virtual machine makes this possible, because it is aware of the specific instruction lengths and other particularities of the underlying hardware platform. know more java training Q2 :   What is Spring? Answer Spring  is an open source development framework for enterprise Java. The core features of the Spring Framework can be used in developing any Java application, but there are extensions for building web applications on top of the Java EE platform. Spring framework targets to make J2EE development easier to use and promote g

Javarevisited

  One of the things I tried with this roadmap is that to keep the exposure as short as possible, I have avoided mentioning many alternatives, particularly when it comes to libraries and tools, and stick with industry-standard tools and libraries. I have kept it simple so that most of the people can follow it and only included the essential stuff, but if there is enough desire, I am thinking to post T he Java Developer RoadMap 2.0  to add some advanced things like JVM internals, Profiling, Java 9 Modules, Cloud Native Java, different cloud platforms like AWS, GCP, or Azure, and more advanced tools like Chef for DevOps and much more. If you are interested, you can find a more exhaustive list of separate blog pots, which I have listed in the further learning section. Anyway, let's go through this Java Developer RoadMap to understand how to become a Java developer in 2021. Btw, you by no means need to understand everything on this roadmap to become a rockstar developer. In fact, you do

Minborg's Java Pot

  This is my Java blog with various tips and tricks that are targeted for medium and advanced Java users. I am a guy living in Palo Alto, California, but I am originally from Sweden. I am working as CTO on Speedment with Java and database application acceleration. Check it out on www.speedment.com Pull down all the source code on this blog using "git clone https://github.com/minborg/javapot.git". I encourage any contribution and improvement on the source code. Happy Reading! /Per Minborg Enforcing Java Singletons is Very Hard Background A  singleton  is a class that is instantiated exactly one time and can be used to represent "global" or system wide components. Common usages of singletons include loggers, factories, window managers or platform components. My general tip is to avoid using singletons when possible, because it is difficult to break out or override functionality and also to write test mocks and they also tend to create a bad over all code structure. As

5 tips for proper Java Heap size

  Determination of proper Java Heap size for a production system is not a straightforward exercise. In my Java EE enterprise experience, I have seen multiple performance problem cases due to inadequate Java Heap capacity and tuning. know more java training  This article will provide you with 5 tips that can help you determine optimal Java heap size, as a starting point, for your current or new production environment. Some of these tips are also very useful regarding the prevention and resolution of java.lang.OutOfMemoryError problems; including memory leaks. Please note that these tips are intended to “help you” determine proper Java Heap size. Since each IT environment is unique, you are actually in the best position to determine precisely the required Java Heap specifications of your client’s environment. Some of these tips may also not be applicable in the context of a very small Java standalone application but I still recommend you to read the entire article. Future articles will