Skip to content

Seedstack Architecture Overview

hervestern edited this page Aug 18, 2020 · 1 revision

Overview

Architecture

A parent pom defines minimal version of the APIs. A bom, used for distribution, defines the individual versions of the component that make up the global Seedstack version.

Each module contains a comprehensive changelog, with standard codes to describe changes:

  • [fix]
  • [new]
  • [brk]
  • [chg]

Note: the framework is quite stable (still, security API remains quite cumbersome).

Plugins

  • specs -> contains the APIs. The presence of API in the classpath does not triggers any specific behaviour.

  • core -> implementation of the specs. The presence of an implementation triggers activation of the plugin.

The same layout is used at the module level.

Class Seed contains the kernel, which manages classpath scanning at start-up.

Note: Seedstack manages annotation inheritance, including at interface level, and including among annotations.

Class SeedServletContainerInitializer self-registers (lazy initialization, without synchronization), through Java service mechanism (META-INF/services).

It is the same mechanism that is used for low-level plugins.

Class GracefulShutdonwnHandler enables a clean shutdown of plugins and modules.

Plugins are located under seed.core.internal.

Every plugin is associated to a module that manages injection.

Modules

A “core” Guice module manages other Guice modules.

@Install (org.seedstack.seed): Guice module declaration that enables automatic detection and installation.

@Bind (org.seedstack.seed): individual binding.

Initialization

InitContext (io.nuun.kernel.api.plugin.context)

  • contains implementations found in the classpath,
  • contains the plugins

Maven

As of version 18.11, Maven must be launched using JDK v11 (openjdk can be downloaded from https://jdk.java.net/). Command “mvn install” may fail due to license error if mvn runnable does not contain license information.

Solution:

  • Run: mvn license:format

Example:

[‎14/‎12/‎2018 15:16]  ADRIEN LAUER - U083051:  
mvn versions:set versions:commit -DnewVersion=3.8.1-SNAPSHOT 

In the project, the Seedstack framework import is done through dependencyManagement configuration, adding seedstack-bom dependency.

File seedstack-bom-.pom declares framework dependencies, and pulls dependency versions from project org.seedstack.distribution.

File distribution-.pom defines the versions versions of the components (coffig, business, addons, etc).

Module Architecture

Java

Seedstack requires Java version 8+, and is compiled using JDK v11.

Note: in particular, Seedstack uses Java 8 predicates (see https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html)

User examples

Source code for the examples is available under https://github.com/seedstack/samples

It contains three projects:

  • addons
  • basics
  • full-apps

For usage information, see seedstack.org.