Author: Editorial Team
-
Instantiation of bean by using an instance factory method in Spring
Spring allows instantiation of bean using instance factory method. Using instance factory allows to keep separate the logic to create the bean separate. In this article we’ll discuss the instantiation of bean by using instance factory method in Spring. Instantiation with an instance factory method invokes the non-static method of the existing bean in the…
-
Instantiation of bean with a Static Factory Method in Spring
Spring allows following three ways to instantiate beans: Instantiation with a constructor Instantiation with a static factory method Instantiation by using an instance factory method In this article we’ll discuss instantiation with a static factory method. When defining configuration for a bean which is created with a static factory method, we use two attributes class…
-
Overview of bean in Spring and naming beans
1. Introduction Beans in application are same as bricks in house. A bean is an object of your application. An application is made of several beans. A bean is an object which is instantiated, assembled (refers to injection of dependencies) and managed by Spring IoC container. IoC container instantiates, assembles and manages the beans using…
-
Immutable class and how to create immutable class in Java?
In this article, we’ll discuss immutable class in Java. Understanding of immutable class is very important as immutable objects play a very important role in Java. To demonstrate how important immutable classes are in Java we can take the example of String class in Java which is designed as immutable. Immutable objects are useful while…
-
An introduction to ThreadLocal in Java
ThreadLocal class is one of the classes provided by Java which helps programmers in writing thread safe code. When sensitive data is accessed by multiple threads, it needs to be synchronized. ThreadLocal works in a different manner. Rather than synchronizing the shared data, we are providing each thread with its own copy of data. ThreadLocal…
-
Custom events in Angular with EventEmitter
Sometimes the DOM events are not enough and there is a need to raise custom events. For example, a child component may need to emit an event and tell the parent component that it has updated itself. The parent component then listens to this event and may need to update itself. The flow of data…
-
Event binding in Angular
Applications are built for users and it is obvious that users will interact with the application. User can fill input form and submit the form by clicking button. All these are examples of events performed by users. Whenever an event occurs, application should listen and respond to that event. Using event binding we can listen…
-
Binding to the style attribute in Angular
In this article we’ll discuss binding to the style attribute in Angular. We use style attribute to define inline styles to elements in HTML. Using style binding we can set styles dynamically. Binding to the single style The syntax for binding to single style is: Example For example, we can bind the width of a…
-
Binding to the class attribute in Angular
In this article, we’ll read how to bind to the class attribute in Angular. We can dynamically add and remove classes to an element using class binding. his is a very helpful feature from user interface point of view. There are many scenarios when we want to apply color coding based on some expression. For…
-
Attribute binding in Angular
In this article we’ll discuss attribute binding in Angular. Angular supports both property binding as well as attribute binding. It is recommended to use property binding, if possible. However, it is not always possible to use property binding in case there is no property to bind. In this case attribute binding can be used. colspan,…
