Skip to content

Commit

Permalink
Adds a basic landing page for the component finder.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Sep 25, 2024
1 parent db41ac8 commit dcc4b2a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
6 changes: 6 additions & 0 deletions dsl/14-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ Permitted children:
- [!adrs](#adrs)
- [group](#group)
- [component](#component)
- [!components](#components)
- [description](#description)
- [technology](#technology)
- [tags](#tags)
Expand Down Expand Up @@ -1251,6 +1252,11 @@ The `!adrs` keyword can be used to attach Markdown/AsciiDoc ADRs to the parent c

See [Architecture decision records](/dsl/adrs) for more details.

## !components

The `!components` keyword is a DSL wrapper around the [Structurizr for Java component finder](/java/component),
providing the ability to automatically discover components in a Java codebase.

## !script

The `!script` keyword can be used to run inline or external scripts in a number of JVM compatible languages.
Expand Down
41 changes: 41 additions & 0 deletions java/component/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: default
title: Component finder
nav_order: 40
parent: Structurizr for Java
has_children: true
permalink: /java/component
has_toc: false
---

# Component finder

[![Maven Central](https://img.shields.io/maven-central/v/com.structurizr/structurizr-component.svg?label=Maven%20Central)](https://search.maven.org/artifact/com.structurizr/structurizr-component)

The idea behind the [C4 model](https://c4model.com) is that there are a number of levels of abstraction, allowing you to zoom-in from a
high-level all the way down to the code:

1. Software systems
2. Containers
3. Components
4. Code

The word "component" is a hugely overloaded term in the software development industry, but it's a useful word to use to
describe the internal structure of an application, one level up from the code. In the context of the C4 model, a
component is defined as being a grouping of related functionality.
With a language like Java, the simplest way to think of a component is that it's a collection of one or more implementation
classes, potentially sitting behind an interface.

The `structurizr-component` library includes a facility to discover components in a Java codebase, providing a
way to automatically generate a component diagram from your codebase without showing all the detail associated
with the code level. See [C4 model - Components vs code?](https://c4model.com/abstractions/component#components-vs-code)
for more on this topic.

From an implementation perspective, Structurizr's component finder works using a combination of
[Apache Commons BCEL](https://commons.apache.org/proper/commons-bcel/) and [JavaParser](https://javaparser.org), using a pluggable and customisable set of matching and
filtering rules. It's available via a Java API and the Structurizr DSL [!components](/dsl/language#components) keyword.

## Links

- [GitHub](https://github.com/structurizr/java/tree/master/structurizr-component)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)
2 changes: 1 addition & 1 deletion java/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: FAQ
parent: Structurizr for Java
nav_order: 9
nav_order: 99
permalink: /java/faq
---

Expand Down
3 changes: 2 additions & 1 deletion java/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ Structurizr for Java consists of two artifacts, both of which are available on M
## Links

- [GitHub](https://github.com/structurizr/java)
- [Changelog](https://github.com/structurizr/java/blob/master/docs/changelog.md)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)

## Related projects

- [structurizr-dsl](/dsl): A text-based DSL wrapper around Structurizr for Java.
- [structurizr-component](https://github.com/structurizr/java/tree/master/structurizr-component): Facilities to discover components in a Java codebase.
- [structurizr-import](https://github.com/structurizr/java/tree/master/structurizr-import): Utilities to import diagrams and documentation into a Structurizr workspace.
- [structurizr-export](/export): Export models and views to external formats (e.g. PlantUML, Mermaid, etc).
- [structurizr-autolayout](https://github.com/structurizr/java/tree/master/structurizr-autolayout): Apply Graphviz automatic layout to views.
Expand Down

0 comments on commit dcc4b2a

Please sign in to comment.