Note: The JIRA issue for this work is FCREPO-648

Problem Statement

Fedora's original Server and Module classes were designed in 2002, and provided a common way for major functional components ("modules") of the repository to be plugged in, configured, initialized, and stopped. Problems with the existing framework include:

Requirements

Use standard, well-known frameworks/libraries to:

Non-requirements

This work will NOT attempt to:

These capabilities may be added in the future, possibly with the help of OSGi.

Framework Choice

After analyzing the available options, we have selected the Spring framework, version 3.

Popular frameworks that support the dependency injection pattern include Spring, PicoContainer, and Guice.

How do they compare? Several articles have been written comparing Spring and Guice, as well as all three. As many have pointed out, Spring and Guice are more than DI frameworks. For our purposes, we considered the attributes of each that are most relevant to the problem at hand:

 

Spring

PicoContainer

Guice

Supports start/stop lifecycle hooks for components

Yes (interface, JSR-250 @PostConstruct/@PreDestroy annotations, spring-specific annotation, or xml-configured)

Yes (interface or JSR-250 @PostConstruct/@PreDestroy annotations)

No

Supports autowiring

Yes

Yes

Yes

Supports in-code wiring and configuration

Yes (JavaConfig)

Yes

Yes

Supports external wiring (outside of code)

Yes (xml)

No

Not directly (but it's possible)

Supports external config (outside of code)

Yes (xml and/or properties)

No

Yes (Names.bindProperties)

OSGi-Friendly

Yes (Spring-DM)

Unknown

Yes (Guice-Peaberry)

JSR-330 Support

Yes, 3.0+

In Progress

In Progress

Jar Footprint (non-OSGi)

750kb

300kb

650kb

Spring was selected because:

Implementation Strategy/Principles

Implementation Plan

Overview + Discussion

View presentation from March 16th, 2010 Special Topic Meeting

Phase I - Prepare

Modify existing modules to accept injected dependencies and config values

Phase II - Swap

Phase III - Cleanup