# lalilulelo1986/asytutorial architecture

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

- Interactive diagram: https://gitdiagram.com/lalilulelo1986/asytutorial
- Repository: https://github.com/lalilulelo1986/asytutorial

## Overview

##### Project Type and Purpose
- This is an Ariba “SOClass” extension tutorial.
- It comprises three logical modules:
– Client: UI code (Java views, controllers) delivered to the browser/ADK.
– Server: SOM plug-in code (business logic, server controllers).
– Shared: Common domain classes and utilities used by both sides.
- The build uses Ant (`build.xml`) and the Ariba ADK (configured via `build.properties`).

##### File Structure and Key Indicators
- Top-level modules:
– Client/ (kz.asytutorial/tutorialN/client packages)
– Server/ (kz.asytutorial/tutorialN/server packages + som/ configuration)
– Shared/ (kz.asytutorial/tutorialN domain classes C_, D_, F_)
- Server/som/ contains: config (properties), db (DDL/DML XML), format, locale, Info XML – these feed into Ariba’s SOM loader.
- Build scripts at project root and per-module (Ant targets to compile classes, assemble JARs, generate manifests).

##### Architectural Patterns
- MVC on the client:
– DC_TutorialN (Data Controller)
– VD_/VF_/VP_ classes (View Data, View Factory, View Presenter)
- Server uses controller classes (S_TutorialN, TC_TutorialN) to handle requests, manipulate shared domain objects, and persist via the Som framework.
- Shared module defines data/document classes (D_TutorialN), controllers/helpers (C_TutorialN), and factories/utilities (F_TutorialN) that are transported between client and server.

##### Main Components
- Client Module
– UI layer: VF_, VP_, VD_, DC_ classes
– Delivered as a JAR to the browser/ADK runtime
- Shared Library
– Shared JAR containing domain objects & helpers
– Included on both client and server classpaths
- Server Module
– SOM plug-in loaded into Ariba application server
– Business logic: S_*, TC_* classes
– Resource folders under som/ for config, db, formats, localization
- Ariba SOM Framework & App Server
– Hosts the plug-in, provides lifecycle & persistence
- Database
– Populated via som/db/*.xml on install
- Build Infrastructure
– Ant scripts and properties (build.xml, build.properties, classpath.properties)

##### Relationships and Interactions
– Client → Server: Remote procedure calls (ADK API) invoking server controllers
– Server → Database: SOM framework commits/retrieves data
– Client ↔ Shared: Client code uses shared domain classes at runtime
– Server ↔ Shared: Server code manipulates same shared types
- Packaging flow: Source → compile → JARs → deploy to ADK (client) or SOM (server).

##### Important Architectural Principles
- Layer separation: UI / shared domain / server logic / persistence.
- Reuse via Shared module avoids DTO duplication.
- Tutorial packages (tutorial1…tutorial6) demonstrate incremental feature builds but follow identical layering.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Module" 
        CMVC1["Data Controllers"] 
        CMVC2["View Data"]
        CMVC3["View Factories"]
        CMVC4["View Presenters"]
        CMVC5["Client Rules"]
    end

    subgraph "Shared Library" 
        SLsrc["Shared Source"]
        SLjar["asytutorial.jar"]
    end

    subgraph "Server Module" 
        Sctrl["Server Controllers/Services"]
        Splugin["AsytutorialModule.java"]
        Sjar["asytutorials.jar"]
        subgraph "SOM Resources"
            SRconfig["config/*.properties"]
            SRdb["db/*.xml"]
            SRfmt["format/*.properties"]
            SRlng["lng/*"]
            SRinfo["Info/info_src.xml"]
            SRinst["install_src.xml/install_ml_src.xml"]
            SRdesc["prop.xml"]
        end
    end

    Ariba["Ariba App Server + SOM Framework"]
    DB["Database"]

    subgraph "Build Infrastructure"
        Broot["build.xml/.properties/classpath.properties"]
        Bclient["Client/build.xml & .properties"]
        Bshared["Shared/build.xml & .properties"]
        Bserver["Server/build.xml & .properties"]
    end

    CMVC1-->|"uses Shared Domain"|SLsrc
    CMVC2-->SLsrc
    CMVC3-->SLsrc
    CMVC4-->SLsrc
    CMVC5-->SLsrc

    SLsrc-->Sctrl
    SLsrc-->CMVC1

    CMVC1-->|"ADK RPC"|Sctrl
    Sctrl-->|"SOM Persistence"|DB
    Sctrl-->SRdb

    Splugin-->Ariba
    Sjar-->Ariba

    SLjar-->CMVC1
    SLjar-->Sctrl

    Ariba-->Sctrl
    Ariba-->SRconfig
    Ariba-->SRfmt
    Ariba-->SRlng
    Ariba-->SRinfo
    Ariba-->SRinst
    Ariba-->SRdesc

    Broot-->Bclient
    Broot-->Bshared
    Broot-->Bserver

    Bclient-->CMVC1
    Bshared-->SLsrc
    Bserver-->Sctrl

    click CMVC1 "https://github.com/lalilulelo1986/asytutorial/blob/master/Client/src/kz/asytutorial/tutorial*/client/DC_*.java"
    click CMVC2 "https://github.com/lalilulelo1986/asytutorial/blob/master/Client/src/kz/asytutorial/tutorial*/client/VD_*.java"
    click CMVC3 "https://github.com/lalilulelo1986/asytutorial/blob/master/Client/src/kz/asytutorial/tutorial*/client/VF_*.java"
    click CMVC4 "https://github.com/lalilulelo1986/asytutorial/blob/master/Client/src/kz/asytutorial/tutorial*/client/VP_*.java"
    click CMVC5 "https://github.com/lalilulelo1986/asytutorial/tree/master/Client/src/kz/asytutorial/tutorial[5|6]/client/rules"
    click SLsrc "https://github.com/lalilulelo1986/asytutorial/tree/master/Shared/src/kz/asytutorial/tutorial*/"
    click SLjar "https://github.com/lalilulelo1986/asytutorial/blob/master/lib/asytutorial.jar"
    click Sctrl "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/src/kz/asytutorial/tutorial*/server/S_Tutorial*.java"
    click Splugin "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/src/kz/asytutorial/module/AsytutorialModule.java"
    click Sjar "https://github.com/lalilulelo1986/asytutorial/blob/master/lib/asytutorials.jar"
    click SRconfig "https://github.com/lalilulelo1986/asytutorial/tree/master/Server/som/config"
    click SRdb "https://github.com/lalilulelo1986/asytutorial/tree/master/Server/som/db"
    click SRfmt "https://github.com/lalilulelo1986/asytutorial/tree/master/Server/som/format"
    click SRlng "https://github.com/lalilulelo1986/asytutorial/tree/master/Server/som/lng"
    click SRinfo "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/som/Info/info_src.xml"
    click SRinst "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/som/install_src.xml"
    click SRdesc "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/som/prop.xml"
    click Broot "https://github.com/lalilulelo1986/asytutorial/blob/master/build.xml"
    click Bclient "https://github.com/lalilulelo1986/asytutorial/blob/master/Client/build.xml"
    click Bshared "https://github.com/lalilulelo1986/asytutorial/blob/master/Shared/build.xml"
    click Bserver "https://github.com/lalilulelo1986/asytutorial/blob/master/Server/build.xml"

    class CMVC1,CMVC2,CMVC3,CMVC4,CMVC5 client
    class SLsrc,SLjar shared
    class Sctrl,Splugin,Sjar,SRconfig,SRdb,SRfmt,SRlng,SRinfo,SRinst,SRdesc server
    class Ariba,DB external

    classDef client fill:#ccffcc,stroke:#333
    classDef shared fill:#cce5ff,stroke:#333
    classDef server fill:#ffdd99,stroke:#333
    classDef external fill:#dddddd,stroke:#333
```
