Spring Core

Print the objectives

Take the exam   Take a beta test

The objective for the JavaBlackBelt Spring Core Exam is simple: understand and be able to apply everything explained in chapters 3, 4 and 5 of the Spring 2.0 reference documentation. Other aspects of Spring will be covered on separate exams (AOP, DAO, MVC,...).

While we don't especially agree with its structure, the document is written well, complete and available to everyone. This is equivalent to the book Professional Development with the Spring Framework, chapters 2 and 3. Small portions of the objectives can be taken outside one of these two sources (or both).

For the objectives, we reordered the documentation topics, but the content can be easily found in the documentation. The reordering eases the questions sorting in a structured tree of categories.

This JavaBlackBelt exam is an independent initiative and not connected to SpringSource.

References:

  • http://www.springframework.org/docs/reference/beans.html
  • http://www.springframework.org/docs/reference/resources.html
  • http://www.springframework.org/docs/reference/validation.html
  • Professional Java Development with the Spring Framework, Wiley, 2006
  • Spring in Action, Manning, 2005

Need help passing this exam? Check out our Coached e-Learning Spring Fundamentals course.

  Released  Beta  Frozen  

BeanFactory & ApplicationContext

BeanFactory, ApplicationContext, SingletonBeanFactoryLocator, Container Awareness, FactoryBean.
 
 

BeanFactory  4 questions

  • Define the idea behind BeanFactory interface and its functionalities.
  • Write code that make use of the different BeanFactory methods.
  • Use the different BeanFactory sub-interfaces.
  • Be able to define and construct BeanFactory configurations.
  • Identify the different methods of bean creation.
  • Know the different concepts inside the BeanDefinition objects and their relationships with the Configurable/ListableBeanFactory.
3 25 28

ApplicationContext  2 questions

  • Know that an ApplicationContext is a BeanFactory.
  • List capabilities added by an ApplicationContext to a BeanFactory.
  • Load an ApplicationContext for a web application with the ContextLoaderListener.
  • Know the purpose of the different ApplicationContext sub-classes (as ClassPathXmlApplicationContext).
Note: Resource specific questions are in the Resource objective further.
5 14 8

SingletonBeanFactoryLocator  1 question

Write code that make basic use of the SingletonBeanFactoryLocator or the ContextSingletonBeanFactoryLocator classes.

Not covered: EJB specific examples and scenarios.
1 5 7

Container Awareness  1 question

Use the BeanFactoryAware and the ApplicationContextAware interfaces.
2 13 6

FactoryBean  3 questions

  • Develop a custom FactoryBean.
  • Obtain a FactoryBean instance from a BeanFactory.

Write xml configuration fragment to get:
  • constants and enums, using the util:constant element or the FieldRetrievingFactoryBean,
  • methods return value, using the MethodInvokingFactoryBean. Know that if the value is a bean, the factory-method is a better choice.
  • properties value, using the util:property-path element. Direct usage of the PropertyPathFactoryBean class is not part of this exam.
5 11 13

Configuration Files

Main Structure, Beans Naming, Abstract and Child Bean Definitions, Multiple Bean Definitions Files, Properties, Other formats than XML.
Not covered: extensible XML authoring.
 
 

Main Structure  1 question

  • Write an XML bean configuration file, using beans and bean elements.
  • Use multiple schemas (beans and util).
Note: the specificities of schemas others than beans (as aop, lang, util,...) are not covered in this exam, except part of the util schema which is covered in the FactoryBean category.
3 17 5

Beans Naming  2 questions

Properly use the bean identifiers:
  • Differentiate id, name, and alias.
  • Give an example where the use of alias is appropriate.
  • Implement the BeanNameAware interface.
3 37 2

Child Bean Definitions  1 question

  • Configure abstract and child bean definitions.
  • Avoid instantiation of parent bean definitions.
2 14 0

Multiple Files  2 questions

  • Split the bean definition over multiple files with the import element.
  • Load multiple files programmatically in the same application context.
2 15 3

Properties  2 questions

  • Use the PropertyPlaceholderConfigurer to externalize property values.
  • Make the PropertyPlaceholderConfigurer take system properties into account.
  • Differentiate the PropertyOverrideConfigurer from the PropertyPlaceholderConfigurer.
2 1 10

Other Formats  1 question

Write very basic code that use the PropertiesBeanDefinitionReader to read bean definitions from property files.
1 2 2

Dependency Injection

Setter Injection, Constructor Injection, Values for Properties and Constructor Args, Lookup Method Injection, depends-on, Autowiring, Dependency Check
 
 

General  2 questions

  • Define the theories behind Inversion of Control
  • Define the use of Dependency Injection as Inversion of Control
3 23 11

Setter Injection  2 questions

  • Write an xml fragment that set bean properties and collaborators.
  • Know why the Spring team prefers setter injection over constructor injection.
3 9 4

Constructor Injection  2 questions

  • Use the different kinds of constructor argument resolution (type matching / argument index)
  • Argue why the Spring team prefers the argument index resolution.
7 3 7

Properties and Constructor Args  4 questions

  • Write xml bean definitions that use the value, null, list, set, map, props elements.
  • Declare inner beans and explain why they are usually anonymous.
  • Differentiate between using value and idref for referring a bean name.
  • Use ref in a bean definition.
    Note: the difference between (id)ref local and name is part of the Beans Naming objective above.
  • Use the shortcut form of value and ref. Know it cannot be used for ref local. Also use the shortcut form of map elements (key-ref, value-ref).
  • Use the compound property names.
12 20 28

Lookup Method Injection  1 question

  • Use lookup method injection and identify cases where it can avoid dependency to the container.
  • Explain why it requires CGLIB.
Excluded from this exam: Arbitrary Method Replacement.
1 22 4

Depends-on  1 question

Use depends-on attribute and identify cases where it should be used.
4 2 2

Autowiring  2 questions

  • Write code that would autowire collaborators.
  • Explain the 5 autowiring modes and the arguments for using each of them.
  • Set these modes at different levels (tags in the XML file) and predict the result according to the overriding rules.
3 47 1

Dependency Check  1 question

Identify the different dependency checking modes and the default mode.
1 6 6

Lifecycle

Instantiation, Singleton vs Prototype, Initializing/DisposableBean, Bean(Factory)PostProcessor, Container Lifecycle, Bean Lifecycle
 
 

Instantiation  2 questions

In a bean definition, set how a bean should be created (via constructor, via static factory method, via bean factory method).
4 17 7

Initializing and DisposableBean  1 question

  • Use the InitializingBean and DisposableBean interfaces.
  • Use the init-method and destroy-method attributes.
Note: the behavioral difference for destroy, between singleton and prototypes is covered by the Singleton vs Prototype objective, not here.
2 45 3

Scopes  3 questions

  • Identify the default scope of a bean.
  • Configure a bean for a given scope (Spring v1 and v2 syntaxes).
  • Configure a singleton for lazy-loading.
  • Determine the scope(s) for which the container cannot manage the destruction part of the lifecycle.
Excluded from this exam: custom scopes.
3 29 10

PostProcessors  1 question

  • Know that BeanPostProcessors allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies.
  • Know that BeanFactoryPostProcessors for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.
  • Automatically register post processors with an ApplicationContext.
Note: PropertyPlaceholderConfigurer and PropertyOverrideConfigurer are not part of this objective, they are part of the Configuration Files objectives.
0 35 2

Container Lifecycle  2 questions

Know the container lifecycle sequence:
  • XML parsing,
  • BeanFactoryPostProcessors,
  • logical validation (with properties/constructor-args conversion),
  • singleton with no lazy-init,
  • ContextRefreshedEvent,
  • getBean call to the container,
  • ContextClosedEvent (call on applicationContext.close).
Note: this objective is only about the sequence of the lifecycle, not about the details of each step which are actually covered by other objectives.
2 1 9

Bean Lifecycle  2 questions

Identify major events on a bean's life, and their order:

  • instantiation & constructor injection,
  • setters injection,
  • xxxAware callbacks,
  • bean post processors "before initialization" call back,
  • InitializingBean, init-method,
  • Bean post processors "after initialization" call back,
bean is used,
bean destruction begins (revert of init order)
  • bean post processors "destroy" call back,
  • DisposableBean, destroy-method.

Note: this objective is only about the sequence of the lifecycle, not about the details of each step which are actually covered by other objectives.

3 15 9

Misc

Low Level Resources, MessageSource, ApplicationEvent, PropertyEditor, BeanWrapper.
 
 

Low Level Resources  3 questions

  • Use the Resource and InputStreamSource interfaces.
  • Get a Resource with a ResourceLoader (ApplicationContext).
  • Determine the type of returned Resource, from the resource location path and ApplicationContext used.
  • Use the classpath*: prefix.
  • Use the ResourceLoaderAware interface.
  • Explain why Ant-style patterns (* and **) only work where directory locations can actually be resolved to a File (and why). It also only work with the getResources(...) methods, as from the PathMatchingResourcePatternResolver class.
6 17 7

MessageSource  2 questions

  • Use a MessageSource for i18n, through an ApplicationContext.
  • Use a StaticMessageSource and a ResourceBundleMessageSource.
  • Use the MessageSourceAware interface.
2 6 4

ApplicationEvent  2 questions

  • Use the standard ApplicationEvents (ContextRefreshed/ContextClosed/RequestHandled Event).
  • Publish custom ApplicationEvents with the ApplicationEventPublisher.
  • Register the ApplicationListener implementor to handle events.
  • Identify the spring provided ApplicationEvents.
1 9 3

PropertyEditor  4 questions

  • Write code that make use of built-in PropertyEditors.
  • Make a custom PropertyEditor.
  • Use the Java SE rule about custom property editor naming convention (MyClassEditor) and location.
  • Register a PropertyEditor explicitly with the CustomEditorConfigurer.
  • Write code that make use of the DataBinder and Validator.
  • Write code that can manipulate beans using the BeanWrapper.
2 7 13

Exam information

  • 85 minutes
  • 57 questions (769)
  • 70% required
  • +9 √
  • - 50  points
  • 15 day delay
  • status: released

Exam leader