Scala OO programming by example

Scala both support OO and functional programming. Scala OO support builds on Java but with below differences: No public class , so you can have more than one public class in a single file No file naming convention No static member but you can use companion objects as your static objects different way to declare(…)

Scala basic syntax by example

All data types are objects and there are no primitives and you can call methods on an Int or a Long. Scala Data Types

 Scala Variables Compiler can infer type, so if you does not assign type to variable it will automatically set it according to the value.

vals are immutable  while vars(…)

Scala Language by example

What is Scala? it is a language that  is invented by Martin Odersky  and runs on the JVM (Java Virtual Machine) and helps you to write  beautiful and powerful code in type-safe way. Why Scala? It has Flexible syntax with Unified type system (no primitive). It has Type inference which automatically assign right value type to an expression.(…)

read property files in Spring

What are properties files ? Properties files help us to abstract out values from our project e.g. url , passwords. Moving away from hardcoding these values in the source code can help us to move our code easily between different environments. how to read property file from Spring xml configuration create a property file make(…)

Spring singleton vs prototype scope

What is singleton scope? Singleton is a default scope in spring application so its means that there is only one instance of our bean is available through the project by default. You might still have more than 1 instance per jvm if you are running more than 1 project with your jvm. How to do(…)

12 good points in code review

What is review? It is a visual inspection of (typically) source code by someone other than the author, in order to identify defects with the intention of rectifying those defects. Why we need review ? find issues and fix them early in the software life cycle. early fixes helps us to save time and cost.(…)

spring Java AutoWiring

You can automatically wiring interfaces with their implementation with java annotation in Spring. This way of auto wiring giving you a better understanding of how beans are wired together. Wiring beans in configs

@ComponentScan Add it to top of your configuration file to mark the start point of your app for looking for the(…)

Spring configuration using Java

What is it ? It is easier for developers to bind java beans with pure java and avoiding from using xml config files. From Spring 3.0 onward most features of Spring can be configure just with Java. How to use it ? It is looking for the files that have @configuration annotation rather than xml(…)

Spring annotation using XML example

What is it ? It is another way to wire up beans in java application. How is it works? setup applicationContext.xml similar to Spring XML configuration, we need to create our main xml config file.

Component Scanner We need to edit our applicationContext.xml file and specify the context of it.

Also we need(…)