@@ -0,0 +1,3282 @@
+package com.github.joostvdg.keepwatching;%0A%0Aimport com.structurizr.Workspace;%0Aimport com.structurizr.io.WorkspaceWriterException;%0Aimport com.structurizr.io.plantuml.PlantUMLWriter;%0Aimport com.structurizr.model.*;%0Aimport com.structurizr.view.ComponentView;%0Aimport com.structurizr.view.ContainerView;%0Aimport com.structurizr.view.ViewSet;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.io.StringWriter;%0Aimport java.nio.file.FileSystems;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0A%0A/**%0A * Created by joost on 5-6-17.%0A */%0Apublic class ApplicationModel %7B%0A%0A    private Workspace workspace;%0A    private Model model;%0A    private SoftwareSystem keepWatchingSystem;%0A    private Container backend;%0A%0A    @Before%0A    public void setup()%7B%0A        workspace = new Workspace(%22Keep-Watching%22, %22Keep-Watching%22);%0A        model = workspace.getModel();%0A        Person user = model.addPerson(%22Watcher%22, %22Watcher%22);%0A        keepWatchingSystem = model.addSoftwareSystem(%22Keep-Watching%22, %22Keep-Watching%22);%0A        backend = keepWatchingSystem.addContainer(%22Backend%22, %22Backend for Keep-Watching%22, %22Spring Boot%22);%0A        Container postgresql = keepWatchingSystem.addContainer(%22postgresql%22, %22Postgresql Database%22, %22RDBMS%22);%0A        backend.uses(postgresql, %22Data storage%22);%0A%0A        Component movie = backend.addComponent(%22Movie%22, %22A movie to watch%22, %22Java%22);%0A        Component watchList = backend.addComponent(%22WatchList%22, %22A watchlist to manage what to watch%22, %22Java%22);%0A%0A        watchList.delivers(user, %22Movie watchlist management%22);%0A        watchList.uses(movie,%22to watch%22);%0A        user.uses(watchList, %22to manage list of movies to watch%22);%0A    %7D%0A%0A    @Test%0A    public void generateContainerView() throws WorkspaceWriterException, IOException %7B%0A        ViewSet viewSet = workspace.getViews();%0A        ContainerView view = workspace.getViews().createContainerView(keepWatchingSystem, %22Backend%22, %22Container View%22);%0A        view.addAllContainers();%0A        view.addAllElements();%0A        StringWriter stringWriter = new StringWriter();%0A        PlantUMLWriter plantUMLWriter = new PlantUMLWriter();%0A        plantUMLWriter.write(workspace, stringWriter);%0A        // System.out.println(stringWriter.toString());%0A        String basePath = FileSystems.getDefault().getPath(%22.%22).toAbsolutePath().toString();%0A        Path filePath = FileSystems.getDefault().getPath(basePath, %22src/main/resources/container-model.txt%22);%0A        Files.write(filePath, stringWriter.toString().getBytes());%0A    %7D%0A%0A%0A    @Test%0A    public void generateComponentView() throws IOException, WorkspaceWriterException %7B%0A        ComponentView componentView = workspace.getViews().createComponentView(backend, %22backend%22, %22Backend Components%22);%0A        componentView.addAllComponents();%0A        StringWriter stringWriter = new StringWriter();%0A        PlantUMLWriter plantUMLWriter = new PlantUMLWriter();%0A        plantUMLWriter.write(workspace, stringWriter);%0A        // System.out.println(stringWriter.toString());%0A        String basePath = FileSystems.getDefault().getPath(%22.%22).toAbsolutePath().toString();%0A        Path filePath = FileSystems.getDefault().getPath(basePath, %22src/main/resources/component-model.txt%22);%0A        Files.write(filePath, stringWriter.toString().getBytes());%0A    %7D%0A%7D%0A

Use structurizr to create a Object model