Shared Flashcard Set

Details

Spring Notes
n/a
67
Computer Science
Undergraduate 1
05/31/2013

Additional Computer Science Flashcards

 


 

Cards

Term

Name 4 benefits of Spring.

Definition

1. Layered/distributed architecture (non-intrusive) .

2. Loosely coupled.

3. Simplifies creation of business methods.

4. Lightweight.

Term
Every class in Spring is treated as a what?
Definition
Bean.
Term

Spring is a _____ _____ ______ .

Definition
One stop shop.
Term

What does the Spring Core/IoC Container do?

Definition
Manages all services and the life-cycle of the bean.
Term

All instances of the beans are ______ by default.

Definition
Singleton.
Term
Whats the difference between ApplicationContext and Bean Factory?
Definition

- BeanFactory supports lazy instantiation and provides the configuration framework and basic functionality.

- ApplicationContext supports pre-instantiation and adds more enterprise-specific functionality onto the Bean factory.

Term

Explain the Spring module MVC framework.

Definition
A full-featured MVC implementation for building Web applications (Spring's own framework).
Term

Explain the Spring module Web.

Definition
Builds on top of the ApplicationContext module, providing contexts for Web-based applications.
Term
Explain the Spring module ORM.
Definition
Various ORM frameworks can plugin to Spring's Object Relational tool.
Term

Explain the Spring module DAO.

Definition
It offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors.
Term
Explain the Spring module AOP.
Definition
It integrates Aspect-Oriented Programming functionality directly into the Spring framework, through a configuration management feature.
Term

Explain the Spring module Context.

Definition

A configuration file that provides context information to the Spring framework.

Term
Explain the Spring module Core Container.
Definition

Provides the essential functionality of the Spring framework.

Term
What is Cross Cutting Concern?
Definition
Functionality that is common/cutting across many classes.
Term
Explain the AOP concept Advice.
Definition
It states what Cross Cutting Concern needs to be applied and when.
Term

Explain the AOP concept JoinPoint.

Definition
It defines where on the method that the advice can be applied to.
Term
Explain the AOP concept PointCut.
Definition
The joinpoints that the advice is actually applied to.
Term

Explain the difference between JoinPoint and PointCut.

Definition

- JoinPoint is the possible candidates/methods to be selected.

- PointCut is the candidate(s)/method(s) selected.

Term
Explain the AOP concept Target Object.
Definition
The object(s)/class(es) that the Advice will be applied to.
Term

Explain the AOP concept Proxy Object.

Definition
A new object (at run-time) that is the target object and the advice applied to it.
Term

Explain the difference between Target Object and Proxy Object.

Definition

- Target Object is the targeted object to apply the advice to.

- Proxy Object is the object that has had the advice applied to it.

Term

Explain the AOP concept Aspect.

Definition
The pointcut with the Advice applied to it.
Term

In AOP, what answers the question 'when'?

Definition
Advice.
Term
In AOP, what answers the question 'where'?
Definition
JoinPoint and PointCut.
Term

In AOP, what answers the question 'what'?

Definition
Cross Cutting Concern.
Term

AOP ________ Cross Cutting Concern.

Definition
Modularizes
Term
Which injections does Spring support?
Definition
Constructor and Setter injections.
Term

IoC is used heavily in what frameworks?

(Hint: 3)

Definition
Spring, Struts, & EJB.
Term
Describe an IoC analogy.
Definition
An external agent (Container) pre-instantiates the object and delivers it ready for use when the calling code requires it.
Term
Spring beans are classes ____ ___ in an XML file.
Definition
Wired up.
Term
What are the Spring beans in a XML file called?
Definition
Bean definitions.
Term

What are some pros of Constructor injection?

(Hint: 3)

Definition

- Strong dependency contract; Bean ready to use upon instantiation.

- No setter; therefore less code.

- Bean properties immutable after construction.

Term

Give some examples of Cross Cutting Concerns.

(Hint: 4)

Definition
Logging, Security, Transactions, and Caching.
Term

What are some advantages of AOP?

(Hint: 2)

Definition

- Aspects are now decoupled from the primary code; they are not scattered throughout it.

- Code is now focused on primary functions alone.

Term

Spring allows what kind of JoinPoints?

(Hint: 2)

Definition
Method and Execution.
Term

What can IoC be broken into?

(Hint: 2)

Definition
Dependency Injection and Dependency Lookup.
Term
What is the difference between Dependency Injection and Lookup?
Definition

- Injection: is non-invasive.

- Lookup: is invasive.

Term
What kind of Dependency is the following?
public interface Orange {
  // methods
}
public class AppleImpl implements Apple {
  private Orange orange;
  public AppleImpl(Orange orange) {
    this.orange = orange;
  }
  // other methods
}
Definition
Constructor Dependency.
Term

What kind of Dependency is the following?

public interface Orange {
  // methods
}
public class AppleImpl implements Apple {
  private Orange orange;
  public void setOrange(Orange orange) {
    this.orange = orange;
  }
  // other methods
}
Definition
Setter Dependency.
Term

What kind of Dependency is the follow?

public interface Orange {
  // methods
}
public class AppleImpl implements Apple, DependencyProvision {
  private Orange orange;
  public void doDependencyLookup(DependencyProvider dp) throws DependencyLookupExcpetion{
    this.orange = (Orange) dp.lookup("Orange");
  }
  // other methods
}
Definition
Contextualized Dependency Lookup (Push Approach).
Term
What is a dependency?
Definition
When an object must depend on another object.
Term
Describe the relationship between IoC and DI.
Definition
IoC is the principle, DI is the way of implementing IoC.
Term
Explain the Advice Before.
Definition
Advice that executes before a join point.
Term
Explain the Advice After Returning.
Definition
Executes after a join point completes normally (like without an exception).
Term
Explain the Advice After Throwing.
Definition
Executed if a method exits by throwing an exception.
Term
Explain the Advice After Finally.
Definition
Executed regardless of the means by which a join point exits (normal or exceptional return).
Term
Explain the Advice Around.
Definition
Surrounds a join point such as a method invocation.
Term
What two things are required in a Bean Definition?
Definition
A id and class attribute.
Term
Where do you define the auto wire attribute?
Definition
In the bean definition.
Term
What is Wiring?
Definition
It is a way to specify the relationship between various bean definitions in a Spring Xml file.
Term
What is Constructor injection?
Definition
Dependencies are provided as constructor parameters.
Term
What are Setter injections?
Definition
Dependencies assigned through Java-Bean properties.
Term
What are Interface injections?
Definition
Injection is done through an interface.
Term
Define the bean scope Singleton.
Definition
The bean definition is limited to one instance.
Term
Define the bean scope Prototype.
Definition
The bean definition is is limited to any number of objects instances.
Term
Define the bean scope Request.
Definition
The bean definition is limited to a single HTTP request.
Term
Define the bean scope Session.
Definition
The bean definition is limited to a HTTP session.
Term
Define the bean scope Global Session.
Definition
The bean definition is limited to a global HTTP session.
Term
What does the Bean Factory provide?
Definition
It provides the configuration framework and basic functionality.
Term
What does the Application Context provide?
Definition
It adds more enterprise-specific functionality onto the Bean factory.
Term
What is a Spring bean?
Definition
An object that is instantiated, assembled, and managed in a Spring Core Container.
Term
What is Context?
Definition
A means to access objects in a framework-style manner that is similiar to a JNDI registry.
Term
A Spring Core Container manages what?
Definition
One or more beans.
Term
The Spring Core Container is also known as what?
Definition
The IoC Container.
Term
What is Declarative Transaction Management?
Definition
Made possible with Spring AOP, and is similar to CMT (Container-Managed).
Term
What is Programmatic Transaction Management?
Definition
An approach that allows you to manage the transaction with the help of programming in your source code.
Term
Which Spring module supports Struts?
Definition
The Web module.
Supporting users have an ad free experience!