Term
|
Definition
A design principle that refers to the decoupling of the specification of a behavior from when it is actually executed. |
|
|
Term
What is Dependency Injection? |
|
Definition
A process where objects define their dependencies through a constructor argument or properties that are set on the object instance after it has been constructed. |
|
|
Term
What are the different types of dependency injection?
(Hint: 3) |
|
Definition
Constructor, Setter, & Interface. |
|
|
Term
What are the benefits of IoC?
(Hint: 4) |
|
Definition
- Minimizes the amount of code.
- Makes your application more testable.
- Loosely coupled.
- Support eager instantiation and lazy loading. |
|
|
Term
|
Definition
It is an open source framework created to address the complexity of enterprise application development. |
|
|
Term
What are the advantages of Spring framework?
(Hint: 4) |
|
Definition
- It has layered architecture (use what you need).
- It enables POJO programming.
- DI and IoC simplifies JDBC.
- Open source and no vendor lock-in. |
|
|
Term
What are the features of Spring?
(Hint: 7) |
|
Definition
Lightweight, Inversion of Control (IoC), Aspect Oriented (AOP), Container, MVC Framework, Transaction Management, JDBC Exception Handling. |
|
|
Term
How many modules are there in Spring? |
|
Definition
|
|
Term
What is the Bean Factory? |
|
Definition
A factory like class that holds the bean definitions and instantiates the bean whenever it is called. It also is able to create associations between collaborating objects as they are instantiated. |
|
|
Term
What is Application Context? |
|
Definition
An interface that represents the Spring Core Container and is responsible for instantiating, configuration, and assembling the beans. |
|
|
Term
What are the common implementations of the Application Context?
(Hint: 3) |
|
Definition
- Class Path XML Application Context.
- File System XML Application Context.
- XML Web Application Context. |
|
|
Term
What is the typical Bean life cycle in Spring Bean Factory Container?
(Hint: 7) |
|
Definition
- Container finds bean def. and instantiates it. - Using DI, Spring populates all properties of bean def. - If bean impl BeanNameAware intrfce, factory calls setBeanName(), passing bean id. - If bean impl BeanFactoryAware intrfce, factory calls setBeanFactory(), passing instance of self. - If bean associates w/ BeanPostProcessers, postProcessBeforeInitialization() is called. - If init-method is specified, it is called. - If bean associates w/ BeanPostProcessors , postProcessAfterInitialization() is called. |
|
|
Term
What do you mean be Bean wiring? |
|
Definition
It's creating associations between the bean definitions in the Spring container. |
|
|
Term
What do you mean by Auto wiring? |
|
Definition
Spring has the ability to automatically wire relationships between collaborating beans. |
|
|
Term
How do you integrate Struts with Spring?
(Hint: 5) |
|
Definition
1. In struts-config, install ContextLoaderPlugin.
2. In action tag, type="org.springframework.web.struts.DelegatingActionProxy" 3. In action-servlet.xml, map html action to action class + reference the injection. 4. In appContext.xml, map injected bean to the bean class. 5. In action class, install setter for injected bean. |
|
|
Term
What ORM's does Spring support?
(Hint: 6) |
|
Definition
Hibernate, iBatis, JPA (Java Persistence API), TopLink, JDO (Java Data Object), OJB. |
|
|
Term
What are the ways to access Hibernate using Spring?
(Hint: 3) |
|
Definition
- DI with the HibernateTemplate and Callback.
- Extending HibernateDaoSupport and applying an AOP interceptor.
- Hibernate Contextual Sessions. |
|
|
Term
What are the two approaches to integrate Spring with Hibernate using Contextual Sessions?
(Hint: 2) |
|
Definition
- Proxy bean approach (old way).
- AOP namespace configuration approach (new way). |
|
|
Term
Define HibernateTemplate in Spring. |
|
Definition
A helper class which provides different methods for querying/retrieving data from the database. |
|
|
Term
What benefits does the HibernateTemplate have in Spring?
(Hint: 4) |
|
Definition
- Simplifies interactions with Hibernate Session.
- Common functions are simplified to single method calls.
- Sessions are automatically closed.
- Exceptions are automatically caught and converted to runtime exceptions. |
|
|
Term
How did you integrate Spring and Hibernate using Template Injection?
(Hint: 4) |
|
Definition
- Wire up the following: basic data source, local session factory, hibernate template, Dao impl. class. - Place setter for Template in Dao Impl. class. - Create anonymous inner class to implement doInHibernate() of CallBack interface and place desired CRUD there. - Pass inner class obj to Template, execute method to invoke desired CRUD operations. |
|
|
Term
What are the bean scopes in the Spring Framework?
(Hint: 5) |
|
Definition
Singleton, Prototype, Request, Session, Global Session. |
|
|
Term
|
Definition
A technique that modularizes Cross Cutting Concerns across multiple classes. |
|
|
Term
How is AOP used in Spring? |
|
Definition
It is used to provide services suchs as logging, security, transactions, and caching. |
|
|
Term
What do you mean by Aspect in Spring? |
|
Definition
The Advice and PointCut being used together. |
|
|
Term
What do you mean be JoinPoint in Spring? |
|
Definition
A point during execution of a program, such as the execution of a method or the handling of an exception. |
|
|
Term
What do you mean by Advice in Spring? |
|
Definition
It states when to apply the Cross Cutting Concern methods. |
|
|
Term
What are the types of Advice in Spring?
(Hint: 6) |
|
Definition
Introduction (can't be used with a PointCut), Before, After Returning, After Throwing, After Finally, Around. |
|
|
Term
What are the types of the transaction management Spring supports?
(Hint: 2) |
|
Definition
Programmatic & Declarative transaction management. |
|
|
Term
What are the benefits of the Spring framework transaction management?
(Hint: 4) |
|
Definition
- Provides a consistent programming model across different transaction API.
- Supports declarative transaction management.
- Provides a simpler API for programmatic transaction management.
- Integrates very well with Spring's various data access abstractions. |
|
|
Term
When should you use programmatic and declarative transaction management in Spring? |
|
Definition
- Programmatic: when you have a small number of transactional operations.
- Declarative: when you have numerous transactional operations. |
|
|
Term
Explain the Spring DAO support. |
|
Definition
It makes it easy to work with data access technologies (Hibernate, JDBC) in a consistent way, and makes switching technologies fairly easy. |
|
|
Term
What is Spring's JDBC template? |
|
Definition
A central class to interact with a database through JDBC. |
|
|
Term
What is Class Path Xml Application Context? |
|
Definition
It loads context definitions from an XML file, treating context definitions as classpath resources. |
|
|
Term
What is Xml Web Application Context? |
|
Definition
It loads context definitions from an XML file contained within an web application. |
|
|
Term
What are the 5 modes of Auto Wiring in Spring? |
|
Definition
no, byName, byType, constructor, autodetect. |
|
|
Term
Explain how to integrate Spring and Hibernate using Contextual Sessions via the Proxy bean approach.
(Hint: 3) |
|
Definition
- Create the DaoImpl class with a setter for the Session Factory.
- Wire up the following: data source, SessionFactory, HiberanteTransactionManager, TransactionProxyFactoryBean, and the target.
- Bind each CRUD method to a transaction in the TransactionProxyFactoryBean. |
|
|
Term
Explain how to integrate Spring and Hibernate using Contextual Sessions via the AOP namespace configuration approach.
(Hint: 3) |
|
Definition
- Create the DaoImpl class with a setter for the Session Factory.
- Wire up the following: data source, SessionFactory, HibernateTransactionManager, and the target.
- Bind each CRUD method to a transaction in the spring.xml. |
|
|
Term
What are the modules in Spring?
(Hint: 7) |
|
Definition
Core Container, Context, AOP, DAO, ORM, Web Module, MVC Framework. |
|
|
Term
List some ways that ApplicationContext is better than BeanFactory.
(Hint: 5) |
|
Definition
- Provides a means to resolve text messages (i18n).
- Provides a way to load file resources.
- Certain operations can be handled derivatively.
- ApplicationContext is a Resource Loader.
- Implements Message Source; for localized services. |
|
|
Term
What is File System Xml Application Context? |
|
Definition
It loads context definitions from an XML file in the file system. |
|
|