Elastic Path Production Tools

Architecture

Architecture

Overview

The Data Population Command Line tool is built on the framework provided by Spring Shell and the Spring Framework. With this framework, the commands that are available through the command line to be contributed through a plug-in mechanism. The advantages of these framework are:

  1. The tool is platform independent, works on Windows, Linux, and Mac-based environments. You need not maintain scripts for each operating system.
  2. Spring Shell provides a command line interface. You need not use Data Population CLI to implement commands..
  3. Spring Shell provides a plug-in architecture to contribute commands and specify which ones are available on the command line. With the plug-in architecture, you can add new commands by adding a new plug-in to the CLI class path without rebuilding or editing the code. You can also configure which commands are available on the command line for each environment. With this feature, you can restrict the actions that can be performed in an environment.
  4. Spring Shell is based on a Spring application context, so commands can be implemented and wired together using SOLID principles. This feature enables smaller and componentized functionality that provides flexibility of use, ease of extension, and less maintenance.

Architecture

Commands are contributed to Spring Shell to provide functionality through the CLI tool. Command checks the available command line options and starts the appropriate command object when requested and manages the s conversion of String values provided on the command line to the appropriate Java types required using a plugable converter framework.

In order to contribute commands and converters they are simply declared in a Spring bean definition file that is loaded by Spring Shell. Spring Shell requires the spring bean definition files, which are available at the following path:

classpath*:/META-INF/spring/spring-shell-plugin.xml

For plug-ins, to override the standard bean definitions provided by the tool, the plug-in's bean definitions must be provided at the following file path:

classpath*:/META-INF/spring/dpcli-spring-shell-plugin.xml

This allows the bean definitions loaded to be ordered so that plug-in contributions can override definitions provided by the tool.