Java

When to use Static Class in place of Singleton in Java Indeed there are some situations, where static classes makes sense than Singleton. Prime example of this is java.lang.Math which is not Singleton, instead a class with all static methods. Here are few situation where I think using »

Create EnvironmentType enum: public enum EnvironmentType { VAPP, PHYSICAL, CLOUD } then create qualifier: @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.TYPE}) public @interface EnvironmentQualifier { EnvironmentType value(); } ... next create abstract class or interface Environment: public interface Environment { Machine getMachine(String name); } then create EnvironmentLiteral to be able to select environment with »

Create simple app using maven mvn archetype:generate -DgroupId=org.catcher -DartifactId=SampleApp -DarchetypeArtifactId=maven-archetype-webapp Add parent spring-boot-starter to main pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.8.RELEASE</version& »

http://www.theserverside.com/tutorial/Classloaders-Demystified-Understanding-How-Java-Classes-Get-Loaded-in-Web-Applications »

To switch to Java 8 run: sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64 To switch to Java 9 run: sudo update-java-alternatives --set /usr/lib/jvm/java-1.9.0-openjdk-amd64 »

Model Mapper - very nice lib: http://modelmapper.org/getting-started/ »