Skip to content

Dependency Resolution

Immortius edited this page Mar 5, 2015 · 2 revisions

Dependency Resolution

gestalt-module provides a DependencyResolver that will determine a compatible set of modules, given a list of the ids of required modules and a ModuleRegistry populated with available modules.

DependencyResolver resolver = new DependencyResolver(registry);
ResolutionResult resolutionResult = resolver.resolve(new Name("ModuleOne"), new Name("ModuleTwo"));
if (resolutionResult.isSuccess()) {
    resolutionResult.getModules();
}

Dependency Resolution follows these rules:

  • All requested modules must be present and all dependencies satisfied, or else the resolution is considered a failure.
  • If multiple possible versions of a module are possible, the latest version is picked and other versions discarded. This is done first for the required modules, in the order specified, before proceeding though their dependencies. This is notable because using the latest version of a module may disqualify the latest version of other modules.

At the moment the DependencyResolver does not report a reason for failure - this is difficult to pinpoint in the general case due multiple versions and different versions having different dependencies.

Clone this wiki locally