Saturday, December 8, 2018

Project Lombok : Boilerplate code reducer

Project Lombok, boilerplate code remover and space saver by generating code in ".class" file instead of generating it in the "source code" file. In this article, I will try to explain how Lombok is so popular and its usage with step by step example.

Introduction :

Project Lombok is java library/tool which is used to minimize boilerplate code and save developers time. No doubt, java is a great language but is criticized by the community for one reason that is verbosity. 

Lombok generates code like getters, setters, toString, and IDE does the same thing for us but IDE generates it in our source code wile Lombok generate it in ".class" file directly.

Thursday, October 25, 2018

Spring AOP with example

What is AOP ?

"AOP(Aspect Oriented Programming)  is programming way, that helps to increase modularity and avoids strong coupling of code by separating cross-cutting concerns". It is one of the key components of Spring Framework.
Cross-cutting concern is a code logic which is scattered throughout the application and it affects entire application. Transaction management and logging are best examples of cross cutting concerns. 
"The key unit of modularity in OOP is class, whereas aspect is the unit of modularity in AOP "

Tuesday, October 16, 2018

Basics of CORS (Cross-Origin Resource Sharing)

Before learning more about CORS, it's important to familiarize yourself with SOP (Same-Origin Policy).

What Is SOP (Same-Origin Policy)?

SOP is a security mechanism implemented in almost all of the modern browsers. It does not allow documents or scripts loaded from one origin to access resources from other origins. Now, what is the origin? The origin is not only domain. — the origin could be the combination of the Host name, Port number, and URI (Uniform Resource Identifier) Scheme.

Sunday, October 14, 2018

Spring IoC Container with XML configuration

What is IoC Container ? 

The org.springframework.context.ApplicationContext interface represents the Spring IoC container. This container instantiates, configures, and assemble beans by using externally provided configuration metadata.
ApplicationContext and BeanFactory are the same, but the ApplicationContext adds more enterprise-related functionality. In short, the ApplicationContext is a superset of the BeanFactory.