Himanshu shriv has Published 51 Articles

Difference between Streams and Collections in Java 8

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:31:05

4K+ Views

Java Collections framework is used for storing and manipulating group of data. It is an in-memory data structure and every element in the collection should be computed before it can be added in the collections.Stream API is only used for processing group of data. It does not modify the actual ... Read More

Difference between JDK dynamic proxy and CGLib proxy in Spring

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:28:58

2K+ Views

Spring AOP is proxy based. Spring used two types of proxy strategy one is JDK dynamic proxy and other one is CGLIB proxy.JDK dynamic proxy is available with the JDK. It can be only proxy by interface so target class needs to implement interface. In your is implementing one or ... Read More

Difference between applicationContext.xml and spring-servlet.xml in Spring Framework

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:26:49

1K+ Views

Applicationcontext.xml - It is standard spring context file which contains all beans and the configuration  that are common among all the servlets. It is optional file in case of web app. Spring uses ContextLoaderListener to load this file in case of web application. Spring-servlet.xml- It is a single entry point for ... Read More

Difference between DispatcherServlet and ContextLoaderListener in Spring

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:06:17

2K+ Views

ContextLoaderListener creates a root web-application-context for the web-application and puts it in the ServletContext. This context can be used to load and unload the spring-managed beans ir-respective of what technology is being used in the controller layer(Struts or Spring MVC).DispatcherServlet creates its own WebApplicationContext and the handlers/controllers/view-resolvers are managed by ... Read More

Difference between @Inject and @Autowired

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:05:11

7K+ Views

@Inject and @Autowired both annotations are used for autowiring in your application.@Inject annotation is part of Java CDI which was introduced in Java 6, whereas @Autowire annotation is part of spring framework. Both annotations fulfill same purpose therefore, anything of these we can use in our application.Sr. No.Key@Inject@Autowired1BasicIt is part ... Read More

Difference between Spring AOP and AspectJ AOP

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 09:02:34

401 Views

Sr. No.KeySpring AOPAspectJ AOP1BasicIt is a simple implementation of AOP technology. It can be applied only the beans.It is a complete implementation of the AOP technology in Java. It can be applied in any java class.2Design Pattern  It uses the proxy pattern so aspects are applied on proxies objectIt doesn't ... Read More

Difference between singleton and prototype bean scope.

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 08:59:54

3K+ Views

Spring framework supports five types of bean scope −SingletonPrototypeRequestSessionGlobal SessionAs per the spring documentation −Singleton − It returns a single bean instance per Spring IoC container. This single instance is stored in a cache of such singleton beans, and all subsequent requests and references for that named bean return the ... Read More

Difference between @Bean and @Component annotation in Spring.

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 08:56:07

16K+ Views

 Spring supports multiple types annotations such as @Component, @Controller, @service @Repository and @Bean. All theses can be found under the org.springframework.stereotype package.When classes in our application are annotated with any of the above mentioned annotation then during project startup spring scan(using @componentScan) each class and inject the instance of the ... Read More

Difference between Dependency Injection and Factory Pattern.

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 08:53:23

2K+ Views

Factory and Dependency injection both are the design pattern which can be used to enhance loose coupling abilities between the software components. Factory design pattern is used to create objects. But, injection and life cycle management of the object should be handled by programmer within the application. There is no way ... Read More

Difference between IOC and Dependency Injection in Spring.

Himanshu shriv

Himanshu shriv

Updated on 09-Sep-2020 08:50:55

3K+ Views

Inversion of control is a design principle which helps to invert the control of object creation.According to the paper written by Martin Fowler , inversion of control is the principle where the control flow of a program is inverted: instead of the programmer controlling the flow of a program, the ... Read More

Advertisements