concept follow snippet in category spring

appears as: following snippet, The following snippet, The following snippet
Spring Dynamic Modules in Action

This is an excerpt from Manning's book Spring Dynamic Modules in Action.

Typically, there are a number of ways to configure the component wiring, ranging from XML files to Java annotations to plain text. The Spring lightweight container offers a rich set of features to do the wiring; the following snippet illustrates the XML-based configuration for our business service and its Notifier dependency.

The configuration of a header follows the syntax illustrated in the following snippet:

Header-Name:
header-value1;directive1:=value1;directive2:=value2,
header-value2;directive1:="item1, item2, item3";attribute1=value4,
header-value3;directive1:=value1;directive3:=value3...

This kind of configuration using headers and their associated directives and attributes is particularly useful when configuring dependencies for versions and resolution strategies. The following snippet shows a real use case of directives and attributes in the configuration of Spring’s spring-beans.jar file. Notice that this declaration uses the resolution directive and the version attribute.

All these attributes make possible fine-grained selection of the packages. The following snippet shows how you can use the version attribute in the Import-Package header.