Essentials Architecture

Domain-Driven Design itself can be successfully applied in variety of software architectural styles. Some are very broad and tend to define every aspect of the system, others are more focused and try to address a specific demand. The business framework itself can adapt to several architectural styles. This documentation will focus on the traditional layered architecture from the Eric Evans DDD book, improved by the usage of the Dependency Inversion Principle.

Overview Architecture

Naming conventions JAR-level When relevant, modules provide their API in a separate sub-module suffixed with -specs in which case the corresponding module implementation is suffixed -core. This allows to implement classes using the API without activation. This is useful when designing reusable components. Besides, to provide a better separation of concerns, some modules are further split into optional sub-modules: seed-[module]-specs for the API and/or the SPI, seed-[module]-core for the main implementation, seed-[module]-[option] for an optional implementation module.

Essentials Configuration

SeedStack provides a simple and powerful configuration system. Configuration can be read from multiple sources and in multiple formats. The recommended way to specify configuration is a YAML file named application.yaml located at the root of the classpath.

Essentials Dependency injection

In a Seed application, the dependency injection is provided by a Guice injector, created by the kernel in its starting phase. The injector is configured in explicit mode, meaning that all the application injection points are checked during application startup and must be resolvable. This mode ensures that injection errors are detected as soon as possible in the development process. Although Guice is operating behind the scenes, it is invisible for the application which only needs to rely on JSR 330 annotations for defining injection points.

Overview Distribution

The SeedStack distribution is the preferred way of using SeedStack in your project: All components have their version managed globally. You just have to specify the distribution version but not the version of the components themselves. All components are tested together before the release. The distribution is released 3 times per year with a predictable schedule (April, July and November). The distribution is named after the YEAR.MONTH pattern. Dependency management The most important part of the distribution is the dependency management which guarantees that all SeedStack components are at compatible and well-tested versions.

Essentials Domain-Driven Design basics

Domain-Driven Design (DDD) is an approach to the development of software that: Focuses on the core domain. Explores models in a creative collaboration between business experts and the software team. Defines an ubiquitous language within an explicitly bounded context. Domain-Driven Design has two sides, both equally important: Strategic design, which address high-level considerations of domain knowledge and its modeling. Tactical design, which propose practical patterns to design the required software.

Essentials Error diagnostic

When something goes wrong, SeedStack does its best to provide detailed information about the failure. This can take two forms: the detailed exception system and the diagnostic dump. Detailed exception system All SeedStack exceptions extend BaseException which is a RuntimeException. This means that you are not required to catch framework exceptions although you can do so if needed. All SeedStack exceptions display a detailed information report about the failure. Consider this example:

Essentials

SeedStack Java framework, also simply known as «Seed», is the foundation enabling you to build Java applications or microservices easily and efficiently.

Essentials Logging

Logging is a necessity in almost any application. SeedStack standardize logging through the popular SLF4J logging facade but the actual implementation is chosen at the project level. Recommended implementation SeedStack is compatible with any SLF4J implementation but we recommend Logback as an efficient, natural fit for SLF4J. To add Logback to your project, use the following dependency snippet: Maven Gradle <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId><version>1.1.10</version> </dependency> Specifying versions manually is error-prone, use the distribution instead.

Essentials Package layout

We recommend a well-defined package layout for organizing your business code according to the software architecture described above. The domain The root package for the domain layer is: [base.package].domain The domain can be composed of several sub-domains that can be specified as sub-packages: [base.package].domain.subdomain1 [base.package].domain.subdomain2 ... The domain package (or each sub-domain package if relevant) contains: A model package containing aggregates, each in its own package. An aggregate package contains The aggregate root along with other related entities and value objects, The factory interface if any, The repository interface if any, The aggregate policies if any.

Manual Qualified injection

With the business framework, much like the rest of SeedStack, you declare injection points with an interface type not an implementation one. The framework discovers any implementation of a specific interface and will inject it through its interface. For a specific interface, the business framework supports multiple implementations. This is particularly useful when you have multiple algorithms of implementation technologies for an interface. If multiple implementations of a specific interface are found, you must use a qualifier on each one to differentiate them.

Essentials Reference material and books

To go beyond what is described in this documentation, we recommend a few books which will help you to better understand DDD, independently of the business framework. Domain-Driven Design community This is a major online resource about Domain-Driven Design with a lot of contents to discover and learn about it. Online community Eric Evans: Domain-Driven Design Reference This book by Eric Evans is a summary of patterns and definitions of Domain-Driven Design.

Overview Requirements

SeedStack is designed to work equally well and provide the same level of features in a standalone environment or in managed environment like a Servlet container or a JEE application server.

Overview

SeedStack is a Java, general purpose, development solution. It can be used to build different types of projects, and particularly REST-based microservices and applications.

15 element(s)

Filter