Skip to content

add UML page #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: source
Choose a base branch
from
Draft

add UML page #399

wants to merge 1 commit into from

Conversation

yardasol
Copy link
Contributor

Summary of changes

This PR adds a page describing UML diagrams and points to some tools for generating them.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Associated Issues and PRs

  • Issue: #

Associated Developers

  • Dev: @

Checklist for Reviewers

Reviewers should use this link to get to the
Review Checklist before they begin their review.

code with someone new to the software, UML diagrams can be a useful tool.

Rather than writing UML diagrams by hand, we can generate them from existing
code using existing software tools. T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
code using existing software tools. T
code using existing software tools.


Universal Modeling Language (UML) diagrams are a common way to visually
represent software components (such as classes and functions). When reviewing
code with someone new to the software, UML diagrams can be a useful tool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes these diagrams are automatically generated as part of the automated documentation (e.g. Doxygen). It may be worth mentioning that one can just check if that's the case for the software you're dealing with. (https://fuelcycle.org/cyclus/classcyclus_1_1Agent.html)


`clang-uml` uses `clang`, and as such requires the `compile_commands.json` file.
The creator of `clang-uml` wrote a [blog
post](https://blog.bkryza.com/posts/compile-commands-json-gallery/) blog post
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
post](https://blog.bkryza.com/posts/compile-commands-json-gallery/) blog post
post](https://blog.bkryza.com/posts/compile-commands-json-gallery/)

| Language | Tools |
| -------- | ----- |
| C++ | [clang-uml](https://clang-uml.github.io/index.html) |
| Python | [pyreverse](https://pylint.pycqa.org/en/latest/additional_tools/pyreverse/index.html) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should be able to just use the native "inheritance diagram" functionality inside sphinx (which is probably what folks are using for automated documentation anyway).

Alternatively, if that's somehow not working and your tool already uses sphinx for documentation, there's a compatible tool called PlantUML. https://github.com/sphinx-contrib/plantuml

options outside of using an IDE.

The most common type of UML diagram is the _class diagram_. This represents the
static state of the code, including any inhertiance structures. An example of a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static state seems redundant.

Suggested change
static state of the code, including any inhertiance structures. An example of a
state of the code, including any inheritance structures. An example of a


The most common type of UML diagram is the _class diagram_. This represents the
static state of the code, including any inhertiance structures. An example of a
UML diagram is below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any UML diagram example here.

Rather than writing UML diagrams by hand, we can generate them from existing
code using existing software tools. T

| Language | Tools |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table is a little squished, so I'll make separate pr to update the bootstrap css and add some padding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@katyhuff
Copy link
Member

Sorry I jumped the gun. Just realized this was a draft PR.

@katyhuff katyhuff mentioned this pull request Mar 18, 2025
9 tasks
Comment on lines +3 to +4
title: Generating UML Diagrams
subtitle: "Generating UML Diagrams"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little redundant.
image

Suggested change
title: Generating UML Diagrams
subtitle: "Generating UML Diagrams"
title: Inheritance Diagrams
subtitle: "Generating Inheritance Diagrams with UML"

@katyhuff
Copy link
Member

katyhuff commented Apr 1, 2025

@yardasol -- pinging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants