SeedStack
Domain-Driven Design at the enterprise scale
seedstack.org
twitter.com/seedstack
github.com/seedstack
Agenda
What is SeedStack ?
Domain-Driven Design with SeedStack
Quick demo
What is
SeedStack ?
A modular Java 8+ framework to build:
 REST micro-services
 ClassicWeb applications
 CLI applications
An opinionated solution for robust projects
 Top-notch software architecture for your projects
 Domain-Driven Design for your business
An easily extensible kernel/plugin design
Open-source under MPL 2.0 license
SeedStack at
«Groupe PSA »
About 100 projects in various business domains, like:
 Connected-car
 Manufacturing
 Finance
 R&D
The reference software stack for Java projects:
 Done internally
 Contracted out to our suppliers (CapGemini, ATOS, …)
Minimally extended by closed-source proprietary add-ons
 Security add-on
 Integration with legacy PSA frameworks
How is it used ?
Each project is composed of one or more independent modules
Modules are generated using SeedStack Maven plugin:
 REST micro-services
 Command-line programs
 Batch jobs
 Reusable business domains
Each module follows the same reference software architecture
providing organization-wide consistency
SeedStack Maven plugin also does production-ready packaging
Main
features
Core
Security
Web
Extensions
Tooling
Config, logging, transactions, validation …
GoogleGuice dependency injection
Apache Shiro security
Undertow embedded server
Jersey 2 REST + Hypermedia
Web sockets
Business framework (DDD)
32+ add-ons
Project generator, one-JAR packaging, LiveReload, …
18.4 18.7 18.11
Domain-Driven
Design
A software approach focused on solving business problems with code:
 Strategic design, addressing high-level considerations of domain knowledge
 Tactical design, proposing practical patterns to write the required software
Implemented in the SeedStack business framework:
 Detection of DDD patterns
 Ready-to-use building blocks
 Automation of recurrent tasks
SeedStack DDD
HelloWorld!
@Path("/hello/{name}")
public class HelloResource {
@Inject
private GreeterService greeterService;
@GET
@Produces(MediaType.TEXT_HTML)
public String hello(@PathParam("name") String name) {
return greeterService.sayHello(name);
}
@Service
interface GreeterService {
String sayHello(String name);
}
static class HtmlGreeterService implements GreeterService {
@Override
public String sayHello(String name) {
return "<h1>Hello " + name + "!</h1>";
}
}
}
❶
❷
❸
❶
❸
REST with Jersey 2
Dependency injection
DDD service
❷
❸
SeedStack DDD
Patterns
Modeling
Behavior
Interfaces
Entities
Value objects
Aggregates
Specifications
Factories
Repositories
Services
Policies
Events
Assemblers
Paginator
Mutable objects with identity
Immutable objects without identity
Cohesion and integrity
Querying
Creation logic
Persistence logic
Business logic
Business rules
Business events
Object mapping
Offset, page and key-based pagination
SeedStack DDD
Building blocks
Business framework implements patterns using:
 Annotations
 Interfaces
 Base classes
Patterns are strongly-typed using Java generics:
 They are automatically detected and validated on startup
 They can be injected anywhere
@Inject
@InMemory
private Repository<Customer, CustomerId> customerRepository;
Annotations
Interfaces
Base classes
@Inject
private CustomerFactory customerFactory;
@Inject
private SomeService someService;
SeedStack DDD
Automation
SeedStack helps to avoid most boilerplate code:
 Offset, page or key-based pagination DSL
 Translation of domain specifications to database-specific queries
 Object-mapping strategies and DSL
❶
❷
❸
@Path("/customers")
public class CustomersResource {
@Inject @Jpa
private Repository<Customer, CustomerId> customerRepository;
@Inject
private FluentAssembler fluentAssembler;
@Inject
private Paginator paginator;
@GET @Produces(MediaType.APPLICATION_JSON)
public Page<CustomerDto> pageOfVipCustomers(…) {
return fluentAssembler.assemble(
paginator.paginate(customerRepository)
.byPage(pageIndex)
.ofSize(10)
.matching(new CustomerVipSpec(100)))
.toPageOf(CustomerDto.class);
}
}
❶
❷
❸
Quick demo
REST micro-service
Thank you!
SeedStack is licensed under MPL 2.0:
 Business-friendly
 Composable with other licenses
Feel free to test, use, and contribute to it!
http://seedstack.org
https://github.com/seedstack
https://twitter.com/seedstack

Domain-Driven Design with SeedStack, OW2con'2018, June 7-8, 2018, Paris

  • 1.
    SeedStack Domain-Driven Design atthe enterprise scale seedstack.org twitter.com/seedstack github.com/seedstack
  • 2.
    Agenda What is SeedStack? Domain-Driven Design with SeedStack Quick demo
  • 3.
    What is SeedStack ? Amodular Java 8+ framework to build:  REST micro-services  ClassicWeb applications  CLI applications An opinionated solution for robust projects  Top-notch software architecture for your projects  Domain-Driven Design for your business An easily extensible kernel/plugin design Open-source under MPL 2.0 license
  • 4.
    SeedStack at «Groupe PSA» About 100 projects in various business domains, like:  Connected-car  Manufacturing  Finance  R&D The reference software stack for Java projects:  Done internally  Contracted out to our suppliers (CapGemini, ATOS, …) Minimally extended by closed-source proprietary add-ons  Security add-on  Integration with legacy PSA frameworks
  • 5.
    How is itused ? Each project is composed of one or more independent modules Modules are generated using SeedStack Maven plugin:  REST micro-services  Command-line programs  Batch jobs  Reusable business domains Each module follows the same reference software architecture providing organization-wide consistency SeedStack Maven plugin also does production-ready packaging
  • 6.
    Main features Core Security Web Extensions Tooling Config, logging, transactions,validation … GoogleGuice dependency injection Apache Shiro security Undertow embedded server Jersey 2 REST + Hypermedia Web sockets Business framework (DDD) 32+ add-ons Project generator, one-JAR packaging, LiveReload, … 18.4 18.7 18.11
  • 7.
    Domain-Driven Design A software approachfocused on solving business problems with code:  Strategic design, addressing high-level considerations of domain knowledge  Tactical design, proposing practical patterns to write the required software Implemented in the SeedStack business framework:  Detection of DDD patterns  Ready-to-use building blocks  Automation of recurrent tasks
  • 8.
    SeedStack DDD HelloWorld! @Path("/hello/{name}") public classHelloResource { @Inject private GreeterService greeterService; @GET @Produces(MediaType.TEXT_HTML) public String hello(@PathParam("name") String name) { return greeterService.sayHello(name); } @Service interface GreeterService { String sayHello(String name); } static class HtmlGreeterService implements GreeterService { @Override public String sayHello(String name) { return "<h1>Hello " + name + "!</h1>"; } } } ❶ ❷ ❸ ❶ ❸ REST with Jersey 2 Dependency injection DDD service ❷ ❸
  • 9.
    SeedStack DDD Patterns Modeling Behavior Interfaces Entities Value objects Aggregates Specifications Factories Repositories Services Policies Events Assemblers Paginator Mutableobjects with identity Immutable objects without identity Cohesion and integrity Querying Creation logic Persistence logic Business logic Business rules Business events Object mapping Offset, page and key-based pagination
  • 10.
    SeedStack DDD Building blocks Businessframework implements patterns using:  Annotations  Interfaces  Base classes Patterns are strongly-typed using Java generics:  They are automatically detected and validated on startup  They can be injected anywhere @Inject @InMemory private Repository<Customer, CustomerId> customerRepository; Annotations Interfaces Base classes @Inject private CustomerFactory customerFactory; @Inject private SomeService someService;
  • 11.
    SeedStack DDD Automation SeedStack helpsto avoid most boilerplate code:  Offset, page or key-based pagination DSL  Translation of domain specifications to database-specific queries  Object-mapping strategies and DSL ❶ ❷ ❸ @Path("/customers") public class CustomersResource { @Inject @Jpa private Repository<Customer, CustomerId> customerRepository; @Inject private FluentAssembler fluentAssembler; @Inject private Paginator paginator; @GET @Produces(MediaType.APPLICATION_JSON) public Page<CustomerDto> pageOfVipCustomers(…) { return fluentAssembler.assemble( paginator.paginate(customerRepository) .byPage(pageIndex) .ofSize(10) .matching(new CustomerVipSpec(100))) .toPageOf(CustomerDto.class); } } ❶ ❷ ❸
  • 12.
  • 13.
    Thank you! SeedStack islicensed under MPL 2.0:  Business-friendly  Composable with other licenses Feel free to test, use, and contribute to it! http://seedstack.org https://github.com/seedstack https://twitter.com/seedstack