# modeldriven-hu/cameo_lesson_1 architecture

> Architecture diagram of the GitHub repository modeldriven-hu/cameo_lesson_1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/modeldriven-hu/cameo_lesson_1
- Repository: https://github.com/modeldriven-hu/cameo_lesson_1

## Overview

##### Project type and purpose
- This is a Java-based plugin project for the Cameo/MagicDraw modeling tool (a Hello-World example).
- It uses Maven to compile, assemble and package into a ZIP that is dropped into the Cameo “plugins” folder.

##### File structure
- pom.xml: standard Maven project descriptor.
- src/main/java/hu/modeldriven/cameo/Lesson1Plugin.java: main plugin class.
- src/main/resources/plugin.xml: plugin manifest that registers the plugin with Cameo.
- src/main/assembly/assembly.xml: assembly descriptor to produce the distributable ZIP.

##### README for additional insights
- Requirements: Cameo/MagicDraw, JDK 11, Maven
- Workflow: clone → set CAMEO_ROOT environment variable → mvn package → unzip target ZIP into CAMEO_ROOT/plugins → restart Cameo

##### Detailed but concise
- Three roles (source code, build, host) as separate nodes.
- Plugin.xml as a separate resource artifact.
- Maven phases (compile, package, assembly).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer Workstation"]:::external

    subgraph "Maven Build"
        pom["pom.xml"]:::build
        srcDir["src/main/java"]:::build
        lesson["Lesson1Plugin.java"]:::build
        resDir["src/main/resources"]:::build
        pluginXml["plugin.xml"]:::build
        asmDir["src/main/assembly"]:::build
        assemblyXml["assembly.xml"]:::build
        buildTask["mvn package\n(compile→package→assembly)"]:::build
    end

    artifact["lesson1.zip\n(Plugin ZIP)"]:::artifact
    deployment["CAMEO_ROOT/plugins"]:::external
    cboHost["Cameo/MagicDraw Host"]:::runtime
    loader["Plugin Loader"]:::runtime
    runtimePlugin["Lesson1Plugin (runtime)"]:::runtime

    Developer -->|"invokes mvn package"| buildTask
    pom -->|"reads descriptor"| buildTask
    srcDir -->|"compiles Java code"| buildTask
    lesson --> buildTask
    resDir -->|"processes resources"| buildTask
    pluginXml --> buildTask
    asmDir -->|"assembly configuration"| buildTask
    assemblyXml --> buildTask
    buildTask -->|"produces ZIP"| artifact
    artifact -->|"deploys to"| deployment
    deployment -->|"loaded by"| cboHost
    cboHost -->|"uses"| loader
    loader -->|"loads manifest"| pluginXml
    loader -->|"instantiates"| runtimePlugin

    click pom "https://github.com/modeldriven-hu/cameo_lesson_1/blob/main/pom.xml"
    click lesson "https://github.com/modeldriven-hu/cameo_lesson_1/blob/main/src/main/java/hu/modeldriven/cameo/Lesson1Plugin.java"
    click pluginXml "https://github.com/modeldriven-hu/cameo_lesson_1/blob/main/src/main/resources/plugin.xml"
    click assemblyXml "https://github.com/modeldriven-hu/cameo_lesson_1/blob/main/src/main/assembly/assembly.xml"
    click srcDir "https://github.com/modeldriven-hu/cameo_lesson_1/tree/main/src/main/java"
    click resDir "https://github.com/modeldriven-hu/cameo_lesson_1/tree/main/src/main/resources"
    click asmDir "https://github.com/modeldriven-hu/cameo_lesson_1/tree/main/src/main/assembly"

    classDef build fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef artifact fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef runtime fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
