Last active
August 29, 2015 14:03
-
-
Save simonbrowndotje/711f3867c464d6958cb6 to your computer and use it in GitHub Desktop.
Creating one component view per controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void createComponentViewsForWebApplication(Model model) { | |
SoftwareSystem techTribes = model.getSoftwareSystemWithName("techtribes.je"); | |
Container contentUpdater = techTribes.getContainerWithName("Content Updater"); | |
Container webApplication = techTribes.getContainerWithName("Web Application"); | |
// create one component view per Spring controller | |
Set<Component> controllers = webApplication.getComponents().stream().filter(c -> c.getTechnology().equals("Spring Controller")).collect(Collectors.toSet()); | |
for (Component controller : controllers) { | |
ComponentView view = model.createComponentView(techTribes, webApplication); | |
view.setDescription(controller.getName()); | |
view.addAllSoftwareSystems(); | |
view.addAllContainers(); | |
view.remove(contentUpdater); | |
view.addAllComponents(); | |
view.remove(webApplication.getComponentWithName("LoggingComponent")); | |
view.removeElementsThatCantBeReachedFrom(controller); | |
view.addAllPeople(); | |
view.removeElementsWithNoRelationships(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment