# Web4 Model Driven Architecture Guide

## Core Principles
1. Every model element must have a unique identifier
2. Views reference model elements through their IDs
3. Multiple diagrams can show different aspects of the same model elements

## Analysis Process
1. Sentence Analysis:
   - Identify subjects → UML actors (tagged with @actor)
   - Identify verbs → Use cases (tagged with @usecase)
   - Identify objects → Classes (tagged with @class)
   - Identify relationships → Associations (tagged with @relation)

2. Model Organization:
   ```plantuml
   ' Example folder structure
   @startuml
   folder "ModelRepository" {
      folder "actors" {
         file "Actor.puml"
      }
      folder "classes" {
         file "Class.puml"
      }
      folder "usecases" {
         file "UseCase.puml"
      }
      folder "views" {
         file "ClassDiagram.puml"
         file "UseCaseDiagram.puml"
         file "SequenceDiagram.puml"
      }
   }
   @enduml
   ```

3. Model Element Annotations:
   ```plantuml
   ' Example annotation
   @startuml
   !$MODELID "UCP001" 
   actor Actor1 <<@ref UCP001>>
   class Class1 <<@ref UCP001>>
   @enduml
   ```

## View Types
1. Structural Views:
   - Class diagrams (show static structure)
   - Component diagrams (show runtime components)
   - Package diagrams (show organization)

2. Behavioral Views:
   - Use case diagrams (show functionality)
   - Sequence diagrams (show interactions)
   - Activity diagrams (show workflows)

## Best Practices
1. Always define model elements in central repository files
2. Use annotations to reference model elements in views
3. Keep views focused on specific aspects
4. Document relationships between views

## Questions for Continuous Improvement
1. What additional views would help understand the system?
2. Are all relationships properly documented?
3. Do model elements have clear responsibilities?
4. Is traceability maintained between views?