Top Banner
The lean development stack Adrien LAUER SeedStack
24

SeedStack, the lean development stack

Apr 12, 2017

Download

Technology

SeedStack
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SeedStack, the lean development stack

The lean development stackAdrien LAUER

SeedStack

Page 2: SeedStack, the lean development stack

2 of 24

HistoryProject started late 2012

10+ years experience of frameworksCustomOpen-Source: mainly Spring

Page 3: SeedStack, the lean development stack

3 of 24

GoalsBuild a common development stack

Shared across all business entitiesManufacturing / logistics / finance / sales / R&D / …

Being extensible

Enabling re-use

Page 4: SeedStack, the lean development stack

4 of 24

OrganizationCore team at PSA Peugeot CitroënOther members at various locations

http://seedstack.orghttps://github.com/seedstackTwitter: @seedstackIRC: #seedstack on freenode

Page 5: SeedStack, the lean development stack

5 of 24

Get presentation code samples at

https://github.com/adrienlauer/poss-samples

Page 6: SeedStack, the lean development stack

6 of 24

Core valuesOpinion

A reference architecture for your apps

ModularitySingle responsibility principle

ExtensibilityOpen-Closed principle

Page 7: SeedStack, the lean development stack

7 of 24

FoundationJavaSet of technologies to build backends

WebSet of technologies to build Web apps

BusinessDomain-Driven Design (DDD) approach

Page 8: SeedStack, the lean development stack

8 of 24

FoundationJavaSet of technologies to build backends

WebSet of technologies to build Web apps

BusinessDomain-Driven Design (DDD) approach

Page 9: SeedStack, the lean development stack

9 of 24

Java focusKernel + plugin architecture

One plugin per concernScalable

One global Guice injector

Unified configuration

Plugin discovery

Classpath scan Initialization

Page 10: SeedStack, the lean development stack

10 of 24

Sample pluginpublic class MyPlugin extends AbstractPlugin { private final Set<Class<?>> annotatedClasses = new HashSet<>();

@Override public String name() { return "my-plugin"; }

@Override public Collection<ClasspathScanRequest> classpathScanRequests() { return classpathScanRequestBuilder().annotationType(Service.class).build(); }

@Override public InitState init(InitContext initContext) { annotatedClasses.addAll(initContext.scannedClassesByAnnotationClass().get(Service.class)); return InitState.INITIALIZED; }

@Override public Object nativeUnitModule() { return (Module) binder -> annotatedClasses.forEach(binder::bind); }}

Page 11: SeedStack, the lean development stack

11 of 24

So we built the core…Contains the kernel

Provides basic featuresLaunchingConfigurationIoCService commandsDiagnostics

Page 12: SeedStack, the lean development stack

12 of 24

Then we scaled up…10+ plugins

TestingSecurityTransactionsRESTMetrics / healthWeb…

Adding new technologies is quick and easy

All PSA requirements have been covered

50 satisfied projects over two years

Page 13: SeedStack, the lean development stack

13 of 24

FoundationJavaSet of technologies to build REST backends

WebSet of technologies to build Web apps

BusinessDomain-Driven Design (DDD) approach

Page 14: SeedStack, the lean development stack

14 of 24

Web focusLoader + fragments architecture

A fragment per concernComposable

Configure and initialize an SPA

Fragment download

Configuration computing Initialization

Page 15: SeedStack, the lean development stack

15 of 24

Sample fragment{ "id": "demo", "name": "W20 POSS demo", "modules": { "user": "{demo}/modules/user" }, "i18n": { "en": [ "{demo}/i18n/messages-en.json" ], "fr": [ "{demo}/i18n/messages-fr.json" ] }, "routes": { "hello": { "template": "<div class=\"container\"><h1>Hello World!</h1></div>", "hidden": true }, "user": { "templateUrl": "{demo}/views/user.html", "controller": "UserController" } }}

Page 16: SeedStack, the lean development stack

16 of 24

Main featuresBased on popular libraries

AngularJSRequireJS

Advanced enterprise features

Multi CSS frameworkBootstrapAngular material

Theming support2 Open-Source themes3 PSA proprietary themes

Page 17: SeedStack, the lean development stack

17 of 24

FoundationJavaSet of technologies to build REST backends

WebSet of technologies to build Web apps

BusinessDomain-Driven Design (DDD) approach

Page 18: SeedStack, the lean development stack

18 of 24

Level of involvement

Annotations

Interfaces

Base classes

Page 19: SeedStack, the lean development stack

19 of 24

Building blocks

Page 20: SeedStack, the lean development stack

20 of 24

Main featuresDDD semantic + injection

Easy-to-use default implementations

Smart DTO / domain mapping

Built-in identity generation strategies

Page 21: SeedStack, the lean development stack

21 of 24

Sampleclass SaleServiceImpl implements SaleService { private final Repository<Seller, Long> sellerRepository; private final DomainRegistry domainRegistry;

@Inject public SaleServiceImpl(Repository<Seller, Long> sellerRepository, DomainRegistry domainRegistry) { this.sellerRepository = sellerRepository; this.domainRegistry = domainRegistry; }

@Override public void updateBonus(Order order, Long sellerId) { Seller seller = sellerRepository.load(sellerId); if (seller == null) { throw new IllegalArgumentException("Seller " + sellerId + " cannot be found"); }

BonusPolicy bonusPolicy = domainRegistry .getPolicy(BonusPolicy.class, seller.getBonusPolicy());

double orderBonus = bonusPolicy.computeBonus(order); seller.addToMonthlyBonus(orderBonus);

sellerRepository.save(seller); }}

Page 22: SeedStack, the lean development stack

22 of 24

Extensibility20+ official add-ons

Audit, ElasticSearch, I18n, IO, JavaMail, JCache, JDBC, JMS, JPA, LDAP, MongoDB, Monitoring, Neo4J, Redis, Scheduling, Solr, Spring-bridge, Validation, W20-bridge, Web-Services, …

Open to third-partyhttp://seedstack.org/addons

PSA uses only 3 proprietary add-ons

Page 23: SeedStack, the lean development stack

23 of 24

DistributionGlobal packaging of all modules

Each organization can roll its own distribution

Open-Source reference distribution released 3 times per year

16.4 16.7 16.11

Page 24: SeedStack, the lean development stack

24 of 24

Thank you!Website: http://seedstack.orgGitHub: https://github.com/seedstackIRC: #seedstack on freenode

Contributions welcome!Pull requestsDocumentation fixesIssues