VPasCode Docs

PlantUML Object Diagram Syntax Guide

What is an Object Diagram? An Object Diagram is a structural UML diagram that acts as a concrete, real-time snapshot of your application state. While a Class Diagram outlines the abstract blueprints, data types, and structural rules of a system, an object diagram visualizes a live execution instance at a specific point in time. It models actual objects instantiation, displays the exact values assigned to their fields, and highlights the specific linkages that exist between those instances during runtime. This specific UML diagram type is incredibly valuable for debugging complex data structures, explaining highly nested relation states (such as parent-child tree graphs), or verifying that an engineering design pattern behaves as expected under specific edge-case variables. With VPasCode, you can script out live object relations cleanly, bypassing manual box-drawing tools entirely. Core Syntax Guide: Elements and Constructs To design an accurate, standards-compliant UML object diagram in PlantUML, you need to understand object instantiations, field value assignments, and instance link mappings. 1. Instantiating Objects (Name vs. Class Types) Objects are declared using the object keyword. Based on standard UML modeling conventions, you define an object by providing its unique instance name, followed by a colon, and its parent class blueprint type: PlantUML Edit PlantUML in VPasCode object “currentUser : Account” as activeUser Edit PlantUML in VPasCode Pro Tip: Always use the as keyword to map a long instance name declaration to a short, internal shorthand ID (like activeUser) to make drawing linkage lines fast and clean. 2. Assigning Field States and Run-Time Values To populate your objects with test data values, open up a body block using trailing curly braces and write your data key-value allocations on separate lines. Unlike class definitions, do not append data types here—use actual operational values: PlantUML Edit PlantUML in VPasCode object “adminCart : ShoppingCart” as cart1 { cartId = “CART-9081” itemCount = 3 isTaxExempt = false } Edit PlantUML in VPasCode 3. Mapping Instance Linkages Connections between concrete instances in an object diagram represent real-world memory pointers rather than abstract structural patterns. You map these links using solid double dashes (–). You can also append string labels to indicate the functional context of the link: PlantUML Edit PlantUML in VPasCode activeUser — cart1 : “owns and modifies” Edit PlantUML in VPasCode Best Practices for Practical Object Maps Focus on What Matters: Do not list every single field from a class definition. Only include key variable values that directly explain the specific runtime state or bug you are trying to illustrate. Keep Links Neutral: Avoid using inheritance triangles or strict composition diamonds on an object diagram. Use simple, flat relationship lines (–) or basic arrow tips (–>) to show references. Align Iterations Horizontally: If you are mapping an array list or sequence of historical objects, use horizontal navigation arrows like -right-> to force instances to render cleanly in a single line. Real-World PlantUML Object Diagram Examples Example 1: Identity Token Session State (Concrete Value Mappings) This boilerplate maps a live security authorization state, demonstrating how a single authenticated user links out to multiple specific active machine session instances with distinct data variables. PlantUML Edit PlantUML in VPasCode @startuml object “targetUser : UserAccount” as user { userId = 1042 username = “dev_admin” status = “ACTIVE” } object “sessionMobile : UserSession” as session1 { sessionId = “SESS-AAA-99” deviceOS = “iOS 17” ipAddress = “192.168.1.54” } object “sessionDesktop : UserSession” as session2 { sessionId = “SESS-BBB-11” deviceOS = “macOS 14” ipAddress = “72.44.12.102” } ‘ Establish runtime linkages user — session1 : “authenticated on” user — session2 : “authenticated on” @enduml Edit PlantUML in VPasCode Syntax Breakdown: This layout captures a definitive scenario in production code: one specific user record (ID 1042) driving two completely separate runtime session instances simultaneously. Each session container tracks its own isolated metadata layout parameters. Example 2: E-Commerce Invoice Fulfillment State (Multi-Entity Maps) This advanced system blueprint maps a completed financial transaction graph. It charts exactly how order records, transaction logs, and warehouse packages relate to one another at a specific point in time. PlantUML Edit PlantUML in VPasCode @startuml object “buyerProfile : Customer” as customer { email = “[email protected]” tier = “VIP” } object “activeOrder : Order” as order { orderNumber = “#99122” subtotal = 149.99 currency = “USD” } object “stripeTransaction : LedgerEntry” as ledger { referenceId = “ch_3Mv8x” gatewayStatus = “SUCCESS” settledAt = “2026-05-26” } object “packageA : Shipment” as ship1 { trackingCode = “1Z999AA1” carrier = “UPS” weightKg = 1.4 } object “packageB : Shipment” as ship2 { trackingCode = “1Z999AA2” carrier = “UPS” weightKg = 0.8 } ‘ Structural execution links customer — order : “submitted” order — ledger : “funded by” order — ship1 : “fulfilled via” order — ship2 : “fulfilled via” @enduml Edit PlantUML in VPasCode Syntax Breakdown: This template provides a highly structured overview of a complex system state. It shows a single order linked to a successful checkout transaction log, and split into two distinct physical shipment files. This level of detail makes it an excellent blueprint for auditing data structures and system processes.

PlantUML State Diagram Syntax Guide

What is a State Diagram? A State Diagram (often called a State Machine or Statechart Diagram) is a behavioral UML diagram that models the lifecycle of a single system object, business entity, or runtime process. As a fundamental component of the Unified Modeling Language (UML) specification, this specific UML diagram type illustrates the various states an object can inhabit from its initial instantiation to its final destruction, along with the specific events or conditions that trigger a change from one state to another. Whether you are documenting the intricate connection flags of a WebSocket connection, the order processing steps of an e-commerce checkout model, or the behavior of an autonomous hardware system, a UML state machine provides software developers and software architects with a clear, unambiguous blueprint of complex reactive logic. With VPasCode, you can script out complex state transitions instantly without wrestling with grid alignments or overlapping boundary arrows. Core Syntax Guide: Elements and Constructs To write high-quality, standard-compliant statechart layouts, you need to understand start and end points, state definitions, event transitions, nested composite states, and conditional choice points. 1. Initial and End States Every state machine must have an entry point and, optionally, a terminal point. In PlantUML syntax, these boundary elements are represented by a clean asterisk symbol wrapper: [*] –> StateName (Defines the initial start state) StateName –> [*] (Defines the terminal end state) 2. Defining States and Event Transitions States are declared automatically whenever they are linked by a directional arrow (–>). To add context to a transition, append a colon (:) followed by the specific event, API trigger, or method call that causes the state change: PlantUML Edit PlantUML in VPasCode [*] –> Disconnected Disconnected –> Connecting : “connect()” Connecting –> Connected : “auth_success” Edit PlantUML in VPasCode 3. Composite / Nested States Complex applications often feature individual states that contain their own nested sub-states. You can implement these composite structures by using the state keyword followed by an opening curly brace: PlantUML Edit PlantUML in VPasCode state ActiveWorkspace { [*] –> Idle Idle –> Typing : “keypress” Typing –> Idle : “timeout” } Edit PlantUML in VPasCode 4. Choice Points (Conditional Branching) When an event occurs, the system often has to evaluate internal data flags before determining the next state destination. To draw a standard UML choice diamond, use the <<choice>> stereotype token: PlantUML Edit PlantUML in VPasCode state check_payment <<choice>> OrderPlaced –> check_payment : “process()” check_payment –> Paid : [balance >= total] check_payment –> Failed : [balance < total] Edit PlantUML in VPasCode Best Practices for Clean Statecharts Leverage State Descriptions: You can append clear operational details, entry hooks, or exit functions straight inside a state node by using a colon wrapper inline (e.g., StateName : entry / logTimestamp()). Keep State Names Compact: Use CamelCase or snake_case for your internal state variable codes (e.g., PaymentProcessing), and use quotation marks if you need to attach a long human-readable label to them. Manage Vector Routing directions: If your multi-tier lifecycle maps become cluttered vertically, inject inline spatial rules inside the connection arrows (e.g., -right-> or -down->) to balance layout density. Real-World PlantUML State Diagram Examples Example 1: IoT Device Network Lifecycle (Composite States & Choices) This boilerplate tracks the connection behavioral state loops of an IoT sensor module, demonstrating complex structural nested blocks and conditional evaluation choice pins. PlantUML Edit PlantUML in VPasCode @startuml [*] –> Offline Offline –> Connecting : “power_on” state Connecting { [*] –> Initializing Initializing –> ResolvingDNS : “hardware_ready” ResolvingDNS –> SendingHandshake : “ip_acquired” } state authentication_check <<choice>> Connecting –> authentication_check : “receive_server_challenge” authentication_check –> Online : [token_valid] authentication_check –> Offline : [token_expired] : “blink_red_led” state Online { [*] –> Idle Idle –> TransmittingData : “timer_trigger” TransmittingData –> Idle : “ack_received” Idle –> PowerSaving : “low_battery_detected” } Online –> Offline : “connection_lost” @enduml Edit PlantUML in VPasCode Syntax Breakdown: This map clearly segregates individual operational loops. When the hardware transitions into the composite Connecting wrapper state, it tracks localized sub-states like DNS resolution before reaching the authentication_check choice diamond. The brackets ([token_valid]) represent standard UML guard conditions. Example 2: E-Commerce Order Fulfillment State Machine (Concurrent Sub-States) This advanced enterprise blueprint models a multi-threaded order system showing orthogonal concurrent behaviors (processing shipping packages and billing records simultaneously) using split lines (–). PlantUML Edit PlantUML in VPasCode @startuml [*] –> ShoppingCart ShoppingCart –> OrderSubmitted : “checkout_click” OrderSubmitted –> ProcessingPayment : “authorize_funds” state ProcessingPayment { [*] –> ContactingBank ContactingBank –> SettlementSettled : “capture_success” } ProcessingPayment –> OrderConfirmed : “payment_cleared” state OrderConfirmed { [*] –> LogisticsHandling state LogisticsHandling { [*] –> PickingItems PickingItems –> PackingBox : “inventory_secured” PackingBox –> OutForDelivery : “label_printed” } — [*] –> BillingRecords state BillingRecords { [*] –> CompilingInvoice CompilingInvoice –> InvoiceEmailed : “pdf_generated” } } OrderConfirmed –> OrderArchived : “delivery_confirmed” OrderArchived –> [*] @enduml Edit PlantUML in VPasCode Syntax Breakdown: Inside the OrderConfirmed composite structure, the double dash delimiter (–) acts as an orthogonal divider. This instructs PlantUML to split the diagram into two concurrent states that execute in parallel: the physical logistics pipeline on the left, and the corporate billing updates on the right.

PlantUML Activity Diagram Syntax Guide

What is an Activity Diagram? An Activity Diagram is a behavioral UML diagram that functions as a high-powered, formalized flowchart for software applications. As a vital component of the Unified Modeling Language (UML) specification, it maps out the step-by-step operational workflow of a system component, business process, or algorithmic execution loop. By tracking the sequential flow of control from an initial starting point to a final conclusion, this specific UML diagram type helps software engineers, product managers, and business analysts chart complex system logic, identify edge cases, and visually isolate parallel execution paths before writing a single line of backend logic. With VPasCode, you don’t need to manually arrange flow boxes, calculate arrow intersections, or balance layout spacing. The engine uses a modernized, script-like formatting standard to instantly generate clean, highly readable layout vectors as you code. Core Syntax Guide: Elements and Constructs To design an elegant, standards-compliant UML activity diagram in PlantUML, you need to master execution checkpoints, activity states, conditional branches, parallel splits, and vertical swimlanes. 1. Execution Checkpoints and Basic Activities Unlike legacy UML notations, modern activity scripts use clean, explicit command tags to mark the boundaries of your workflow. An activity node is defined simply by placing text inside a trailing colon and semicolon: PlantUML Edit PlantUML in VPasCode start :Initialize Application Context; :Load Local Configuration Cache; stop Edit PlantUML in VPasCode 2. Conditional Logic Branches (if / else / switch) To branch your control logic based on operational parameters, use standard programming syntax loops. You can append labels inside parenthesis to indicate the specific evaluation criteria required to pass down an arrow line: Binary Forks (if / elseif / else): Ideal for simple true/false validation checks: PlantUML Edit PlantUML in VPasCode if (Is Token Valid?) then (yes) :Grant API Access; else (no) :Redirect to Login; endif Edit PlantUML in VPasCode Multi-Path Switches (switch): Perfect for evaluating numerical ranges, role tiers, or string matching patterns without nesting endless if statements: PlantUML Edit PlantUML in VPasCode switch (User Role Type) case ( Admin ) :Render Full Console; case ( Moderator ) :Render Control Panel; case ( Guest ) :Render Read-Only Feed; endswitch Edit PlantUML in VPasCode 3. Parallel Executions (fork / join) When modeling contemporary cloud environments or multi-threaded code loops, you often need to represent tasks that occur concurrently. Use the fork construct to split your execution string into independent, parallel lanes, and conclude with a join token to merge them back into a single thread: PlantUML Edit PlantUML in VPasCode fork :Generate Email Invoice; fork again :Deduct Warehouse Inventory; end fork Edit PlantUML in VPasCode 4. Organizing Responsibility with Swimlanes To clearly define which actor, service team, or microservice infrastructure boundary owns a specific action, use vertical partitions known as swimlanes. You declare a swimlane by wrapping a title string inside pipe characters (|Lane Title|): PlantUML Edit PlantUML in VPasCode |Client App| start :Click Purchase Button; |#LightBlue Payment Gateway| :Authorize Credit Card; Edit PlantUML in VPasCode Best Practices for Clean Activity Flows Use Active Verb Labels: Keep your activity text blocks compact and clear by starting with action-oriented verbs (e.g., :Parse Payload; instead of :The payload data is parsed by the worker application;). Color-Code High-Risk Nodes: Append custom hex colors directly onto sensitive background nodes (e.g., :#Crimson:Purge Database Records;) to make critical steps stand out visually in large enterprise maps. Avoid Crossing Lines: If your multi-branch diagram begins to look cluttered, break up the text blocks by injecting a clean, circular connector node using the detach notation (detach) or terminal anchors. Real-World PlantUML Activity Diagram Examples Example 1: User Onboarding and Identity Validation (Branches & Switches) This boilerplate models a standard user onboarding workflow containing deep binary conditional logic and an identity verification check inside a clean UML diagram layout. PlantUML Edit PlantUML in VPasCode @startuml start :User Submits Sign-Up Form; if (Email Already Exists?) then (yes) :Show Account Conflict Warning; stop else (no) :Create Pending User Record; endif :Send Verification OTP Code; repeat :Await User OTP Input; backward:Log Failed Attempt Alert; repeat while (Is OTP Correct?) is (no) not (yes) switch (Account Selection Tier) case ( Premium Paid ) :Provision Database Clusters; :Trigger Stripe Subscription Loop; case ( Free Tier ) :Apply Basic API Rate Limits; endswitch :Mark User Profile as Verified; stop @enduml Edit PlantUML in VPasCode Syntax Breakdown: This template showcases a standard repeat / backward / repeat while validation loop that continuously captures user entries until the correct security key is passed. The multi-path switch wrapper neatly segregates account setup logic based on tier status values. Example 2: Distributed Order Fullfillment Engine (Swimlanes & Parallel Forks) This complex enterprise architecture map leverages structural vertical swimlanes to trace exactly how an automated checkout flow processes tasks concurrently across a browser client, an API gateway, and a physical fulfillment center. PlantUML Edit PlantUML in VPasCode @startuml |#White|Client Application| start :Submit Shopping Cart; :Select Shipping Address; |#LightCyan|Checkout API Engine| :Validate Product Inventory; if (Items In Stock?) then (no) :Return Out Of Stock Error; stop else (yes) :Lock Inventory Allocations; endif fork :Process Payment via Stripe; :Generate Digital PDF Receipt; fork again |#Lavender|Warehouse Management System| :Print physical Packing Slip; :Assign Warehouse Robot Picker; end fork |#LightCyan|Checkout API Engine| :Dispatch Order Confirmation Hook; stop @enduml Edit PlantUML in VPasCode Syntax Breakdown: The use of color-coded swimlanes (like |#Lavender Warehouse Management System|) forces the automated layout engine to build crisp, separate columns. The parallel fork statement clearly shows that payment processing on the API engine and packing slip generation in the physical warehouse happen concurrently, merging back cleanly before the terminal stop block.

PlantUML Sequence Diagram Syntax Guide

What is a Sequence Diagram? A Sequence Diagram is a behavioral UML diagram that details how software operations are carried out over time. As a core standard of the Unified Modeling Language (UML) specification, it models the precise chronological order in which objects, processes, or microservices exchange messages. By mapping lifelines vertically and sequential interactions horizontally, this specific UML diagram type allows software engineers and system architects to clearly visualize complex API call sequences, network data handshakes, and database transaction boundaries before writing production code. With VPasCode, you don’t have to spend hours aligning parallel arrows, stretching message lines, or shifting bounding boxes around to make space for a new step. Our layout engine computes the entire timeline grid dynamically as you type your plain-text declarative scripts. Core Syntax Guide: Elements and Constructs To design an actionable, standards-compliant UML sequence diagram in PlantUML, you need to master component declarations, message arrow styles, lifelines, and logical control structures. 1. Declaring UML Participants and Shapes By default, components in this UML diagram inherit a standard square box shape. However, you can change the visual archetype of your entities to give readers instant architectural context about your system boundaries using specific UML keywords: PlantUML Edit PlantUML in VPasCode actor Client boundary “API Gateway” as Gateway control Controller database “PostgreSQL” as DB Edit PlantUML in VPasCode 2. Message Arrows and Synchronicity The style of your arrow lines and heads establishes the exact communication protocol occurring across your infrastructure pipelines based on UML diagram standards: Synchronous Request (Blocking): Indicated by a solid line and a solid arrow head. The sender waits for a response: A -> B Asynchronous Message (Non-Blocking): Indicated by a solid line and an open thin arrow head. The sender passes data and proceeds immediately: A ->> B Response / Return Value: Indicated by a dotted line and an open arrow head: B –> A 3. Managing Lifelines (Activation and Deactivation) To prevent your components from looking like flat bars, you should explicitly show when a process is actively consuming CPU threads or memory capacity. Use the activate and deactivate markers, or use the shorthand inline increment syntax (++ / –): PlantUML Edit PlantUML in VPasCode Gateway -> Controller ++ : “processPayment()” Controller –> Gateway — : “return receipt” Edit PlantUML in VPasCode 4. Logic Blocks: Alternatives, Loops, and Parallels Complex business logic (such as if/else forks, database retries, or parallel execution threads) must be wrapped inside structured global frame boundaries known as combined fragments in the UML diagram specification: Conditional Logic (alt / else): Models conditional forks. PlantUML Edit PlantUML in VPasCode alt successful condition A -> B : “Proceed with request” else failure state A -> B : “Throw error code” end Edit PlantUML in VPasCode Repetition Loops (loop): Models iterations, retries, or queue processing blocks until a condition is satisfied. PlantUML Edit PlantUML in VPasCode loop until queue is empty Worker -> Queue : “Fetch next job” end Edit PlantUML in VPasCode Parallel Executions (par): Models separate operations executing simultaneously across independent threads. PlantUML Edit PlantUML in VPasCode par Run parallel processes A -> LogService : “Write trace analytics” else A -> DB : “Commit customer profile data” end Edit PlantUML in VPasCode Best Practices for Clean Sequences Group Messages Using Dividers: Use double equal signs (== Your Phase ==) to break a massive authentication-to-checkout sequence into distinct logical milestones. Utilize Autonumbering: Place the autonumber directive directly below @startuml. This forces the workspace to stamp step integers on every arrow, making code reviews significantly easier. Keep Responses Clean: Avoid writing huge descriptive sentences on return arrows (–>). Instead, simply label what raw data object or HTTP code is traveling back (e.g., “201 Created Token”). Real-World PlantUML Sequence Diagram Examples Example 1: Microservice Authentication Loop (Alt Blocks & Lifelines) This boilerplate handles a standard security sequence where a client authenticates against a gateway, showcasing explicit lifelines and an alternate conditional outcome framework inside a standard UML diagram format. PlantUML Edit PlantUML in VPasCode @startuml autonumber actor User boundary “Web App” as App control “Auth Service” as Auth User -> App ++ : “Submit Credentials” App -> Auth ++ : “POST /v1/auth” alt #LightGreen Successful Login Auth –> App : “200 OK (JWT Token)” App –> User : “Render Dashboard” else #LightPink Invalid Credentials Auth –> App : “401 Unauthorized” App –> User : “Show Error Toast” end deactivate Auth deactivate App @enduml Edit PlantUML in VPasCode Syntax Breakdown: The autonumber tag automatically manages numbers 1 through 5. The alt and else blocks are appended with custom hex color flags (e.g., #LightGreen) to add an immediate visual highlight to success vs. failure execution paths. The ++ tokens ensure the lifelines remain active during the network call block. Example 2: Advanced Order Processing (Loops, Parallels, and Dividers) This enterprise architecture blueprint models a robust checkout system that splits tasks across parallel workers, executes database writes, and relies on an external system sync loop. PlantUML Edit PlantUML in VPasCode @startuml autonumber boundary “Checkout API” as API database “Orders DB” as DB control “Worker Queue” as Queue boundary “Stripe” as Stripe == Phase 1: Transaction Ledger Validation == API -> DB ++ : “Write Pending Order” DB –> API — : “Order ID Confirmed” == Phase 2: Payment & Async Fulfillment == API -> Stripe ++ : “Charge Customer Account” Stripe –> API — : “Payment Authorized” par Parallel Background Operations API -> Queue ++ : “Publish ‘Order_Placed’ event” deactivate Queue else API -> DB ++ : “Update status to ‘Paid'” deactivate DB end loop Retrying Up To 3 Times on Network Failure API -> API : “Ping Notification Sync Webhook” end API –> Client : “Return HTTP 200 (Success)” @enduml Edit PlantUML in VPasCode Syntax Breakdown: The == dividers split the layout into distinct operational phases. The par block cleanly branches off the messaging arrow path into two separate horizontal paths, illustrating that event publication and database status updates occur simultaneously without blocking each other. The self-pointing arrow (API -> API) maps

PlantUML Class Diagram Syntax Guide

What is a Class Diagram? A UML Class Diagram is the foundational structural blueprint of object-oriented modeling. It maps out a software system by visualizing its classes, their internal attributes (data fields), their methods (functions), and the structural relationships between them. While code bases can become sprawling and hard to parse, a clean class diagram provides engineers with an immediate visual reference of how code objects interact, inherit behaviors, and manage data boundaries. Using VPasCode, you can design detailed class layouts entirely in plain text, leaving the layout engineering, box sizing, and line spacing completely to our integrated cloud engines. Core Syntax Guide: Elements and Constructs To write high-quality class diagrams, you need to understand three core structural markers: defining the class body, assigning visibility modifiers to members, and mapping object relationships. 1. Declaring Classes and Members You declare a standard object blueprint using the class keyword. Inside the trailing curly braces, you list your fields and methods on separate lines: PlantUML Edit PlantUML in VPasCode class CustomerAccount { String accountId String emailAddress Boolean isActive() } Edit PlantUML in VPasCode 2. Visibility Modifiers (Access Control) PlantUML maps standard object-oriented encapsulation rules (public, private, protected, and package-private) using simple text prefixes right before the field or method name: + Clear Public access (Accessible by any other class) – Strict Private access (Only accessible within this specific class) # Protected access (Accessible within this class and its subclasses) ~ Package/Internal access (Accessible only within the local code module) 3. Defining Object Relationships Connecting classes requires specific arrow notations to indicate the structural dependency or composition of your application code: Inheritance / Generalization (Is-A): Uses an open triangle arrow head pointing to the parent class: SubClass –|> ParentClass Implementation / Realization: Uses a dotted line with an open triangle to show an interface execution: ConcreteClass ..|> IInterface Composition (Strict Ownership): Uses a solid diamond to show that the child object cannot exist without the parent container: Parent *– Child Aggregation (Shared Collection): Uses an open diamond to show a temporary collection relationship: Department o– Employee Best Practices for Practical Class Maps Separate Layouts with Abstract Classes: Use the abstract class or interface keywords to visually differentiate your structural boundaries from concrete database models. Label Multiplicities Early: Always add numerical multiplicities (like “1” or “0..*”) on both ends of your relationship arrows to make data constraints explicit for developers. Control Vertical Spacing: Class diagrams can grow extremely tall. If your layout stretches too far vertically, replace a double dash (–) with a single dash (-) inside your relationship arrows to force a side-by-side horizontal alignment. Real-World PlantUML Class Diagram Examples Example 1: E-Commerce Domain Model (Visibility & Encapsulation) This blueprint demonstrates standard access modifiers, basic data objects, and basic data multiplicity mappings between core online shopping entities. PlantUML Edit PlantUML in VPasCode @startuml class User { – String userId – String hashedSecret + Boolean verifyLogin(String input) } class Order { + String orderId + Date timestamp – Double calculateTotal() } User “1” –> “0..*” Order : “places and owns” @enduml Edit PlantUML in VPasCode Syntax Breakdown: The – prefix keeps sensitive fields like credentials strictly private inside the User class block, while public access functions use the + marker. The connection string explicitly highlights that one user can look up zero or many orders seamlessly. Example 2: Advanced Payment Gateway (Inheritance & Interfaces) This comprehensive software engineering map showcases how to organize interfaces, class inheritance loops, and complex compositions within a unified framework. PlantUML Edit PlantUML in VPasCode @startuml interface IPaymentProcessor { + Boolean authorizeAmount(Double cash) + void captureFunds() } abstract class BaseGateway { # String merchantApiKey # String endpointUrl + void logTransaction(String payload) } class StripeGateway { – String stripeToken + Boolean authorizeAmount(Double cash) + void captureFunds() } class PayPalGateway { – String paypalEmail + Boolean authorizeAmount(Double cash) + void captureFunds() } class ShoppingCart { – List items + void checkout(IPaymentProcessor engine) } ‘ Structural relationship declarations BaseGateway ..|> IPaymentProcessor StripeGateway –|> BaseGateway PayPalGateway –|> BaseGateway ShoppingCart *– IPaymentProcessor @enduml Edit PlantUML in VPasCode Syntax Breakdown: The ..|> notation establishes that the abstract class implements our primary root interface. The solid triangle lines (–|>) route the child gateways cleanly into their base parent class, while the solid diamond (*–) declares that a ShoppingCart fundamentally owns its payment engine processor during a session lifecycle.

PlantUML Use Case Diagram Syntax Guide

What is a Use Case Diagram? A Use Case Diagram is a behavioral blueprint used to visualize the relationships between a system’s users (known as actors) and the specific actions or goals they want to accomplish (known as use cases). Rather than showing step-by-step logic loops, a use case diagram provides a high-level overview of a system’s functional scope, making it an excellent tool for defining project requirements, system boundaries, and stakeholder workflows. With VPasCode, you can instantly build clear, professional use case diagrams without fighting visual canvas alignment. This guide skips the obscure, legacy notations and focuses purely on the practical syntax elements you need for day-to-day software documentation. Core Syntax Guide: Elements and Constructs Building a use case diagram in PlantUML relies on a few straightforward structural elements wrapped inside your standard @startuml and @enduml tags. 1. Declaring Actors An actor represents an external entity that interacts with your application (such as a human user, a background service, or an external hardware API). You declare an actor by using the actor keyword followed by an internal shorthand ID: PlantUML Edit PlantUML in VPasCode actor customer actor admin as “System Administrator” Edit PlantUML in VPasCode Pro Tip: Use the as keyword to assign a clean, human-readable display string to complex actor IDs. 2. Defining Use Cases A use case represents a functional goal or business process. You can define a use case in two ways: by enclosing the text within parentheses (Your Use Case), or by explicitly using the usecase keyword for complex formatting: PlantUML Edit PlantUML in VPasCode (Login to Dashboard) usecase checkout as “Process Credit Card Payment” Edit PlantUML in VPasCode 3. Mapping Basic Interactions To connect your actors to their corresponding use cases, use basic directed or undirected relationship lines. You can also append textual labels to add critical context to an interaction: PlantUML Edit PlantUML in VPasCode customer –> (Login to Dashboard) admin –> checkout : “Approves refunds” Edit PlantUML in VPasCode 4. Advanced Relationships: Include and Extend When modeling complex system behaviors, you frequently need to show dependencies between different use cases using standard UML stereotyping: Include (Mandatory Dependency): Indicates that a base use case relies on another helper use case to successfully complete its execution. Use a dotted connector line (..>) appended with a text label: PlantUML Edit PlantUML in VPasCode (Process Checkout) ..> (Verify Balance) : <<include>> Edit PlantUML in VPasCode Extend (Optional/Conditional Behavior): Indicates that an optional workflow can branch off from a base use case under specific conditions. Note that the arrow points from the *extension* use case back to the *base* use case: PlantUML Edit PlantUML in VPasCode (Apply Promo Code) ..> (Process Checkout) : <<extend>> Edit PlantUML in VPasCode 5. Enforcing System Boundaries To clearly distinguish what happens inside your software application versus what happens externally, use the rectangle keyword to wrap your internal use cases. Crucially, actors should remain outside of this container block to reflect their status as external participants: PlantUML Edit PlantUML in VPasCode actor customer rectangle “E-Commerce Platform” { (Browse Catalog) (Add to Cart) } customer –> (Browse Catalog) customer –> (Add to Cart) Edit PlantUML in VPasCode Best Practices for Clean Layouts Keep Text Brief: Use cases should always start with a clear, active verb (e.g., “Generate Report”, “Update Profile”) rather than a long sentence. Leverage Directional Anchors: If your actors and use cases clump together in a messy stack, use spatial direction arrows like -right-> or -down-> to gently nudge the layout engine into a clean, readable structure. Isolate System Boundaries: Always use a boundary rectangle when documenting applications that interact with multiple third-party microservices. It makes it instantly clear who owns which process. Real-World PlantUML Use Case Diagram Examples Copy and paste the following practical blueprints directly into your VPasCode live editor panel to see how they render dynamically. Example 1: Core User Authentication & Account Management This blueprint models a standard application ecosystem containing a primary user, an administrative operator, and a boundary box containing core security mechanics. PlantUML Edit PlantUML in VPasCode @startuml ‘ Set layout orientation from left to right left to right direction actor “End User” as user actor “Security Admin” as admin rectangle “Identity Provider Service” { (Sign In) (Reset Password) (Update Profile Data) (Review Security Logs) (Deactivate Accounts) } user –> (Sign In) user –> (Reset Password) user –> (Update Profile Data) (Review Security Logs) <– admin (Deactivate Accounts) <– admin @enduml Edit PlantUML in VPasCode Syntax Breakdown: The directive left to right direction forces the layout engine to position actors on the outer wings and grow the use cases horizontally rather than vertically. Notice how placing the actor declarations cleanly outside the rectangle wrapper keeps them organized, while reversing the arrow bracket direction for the admin user (<– admin) pins them cleanly to the right-hand side of the diagram matrix. Example 2: Advanced E-Commerce Checkout with External Dependencies This real-world system layout maps a complex checkout workflow that relies on external banking APIs, structural inclusions, and optional extension flags. PlantUML Edit PlantUML in VPasCode @startuml left to right direction actor “Customer” as customer actor “Warehouse Staff” as staff actor “Stripe Gateway” as stripe rectangle “Online Store Fulfillment System” { (Place Order) (Apply Coupon) (Generate Invoice) (Pick Pack Items) (Update Shipping Status) } ‘ External interactions to system boundaries customer –> (Place Order) (Place Order) –> stripe : “Authorize Funds” ‘ Include and Extend structures (Place Order) ..> (Generate Invoice) : <<include>> (Apply Coupon) ..> (Place Order) : <<extend>> ‘ Fulfillment paths (Pick Pack Items) <– staff (Update Shipping Status) <– staff (Generate Invoice) –> staff : “Email Copy” @enduml Edit PlantUML in VPasCode Syntax Breakdown: This template highlights how a single use case (Place Order) mandates an invocation of (Generate Invoice) using the <<include>> tag over a dotted line. Meanwhile, applying a coupon code is correctly modeled as an optional branch via <<extend>> pointing backward toward the base execution. All external actors remain clearly isolated outside the system envelope.

PlantUML Syntax Basics

Before diving into specific architectural layouts like C4 models or sequence timelines, it is essential to understand the foundational rules that govern the PlantUML Playbook. PlantUML relies on a clean, highly intuitive text notation system. Once you understand how the engine opens documents, names structural components, and routes connection lines, writing any complex system layout becomes completely natural. This quick primer covers the global structural syntax mechanics that apply across almost every PlantUML diagram type inside the VPasCode workspace. 1. The Mandatory Document Wrappers Every single block of PlantUML code must begin and end with explicit framework tags. These tags tell the VPasCode parser to spin up the correct rendering engine in your preview canvas: @startuml — This exact line must be placed at the absolute top of your script. Nothing else should precede it. @enduml — This exact line must be placed at the absolute bottom of your script, marking the conclusion of your diagram data block. Any code written outside of these two markers will be safely ignored by the compiler, or it may trigger a syntax validation warning in your workspace diagnostic panel. 2. Declaring Elements: IDs vs. Display Labels When modeling a software system, you will create various structural elements like components, databases, actors, or microservices. In PlantUML, you can declare an element explicitly by defining its type, an internal shorthand ID, and a user-friendly display name wrapped in quotation marks: component microservice_id as “Payment Processing API” database db_id as “User Transaction SQL” Why this is a best practice: Using a short, clean internal ID (like microservice_id) makes drawing relationship lines much faster later on. If you ever need to change the customer-facing label from “Payment Processing API” to “Global Checkout Service”, you only have to edit it in one single line of code, rather than updating dozens of lines across your script. 3. Mastering Relationship Arrows and Directional Routing Connections between system nodes are drawn using combinations of dashes (-) and arrow brackets (>). The length of your dashes and the inclusion of directional keywords give you implicit control over how the automated layout engine scales your diagram: Basic Connections: A –> B draws a standard directed arrow pointing from element A straight to element B. Dotted Dependency Lines: Substituting dashes with periods creates a dotted line, which is the industry standard for indicating asynchronous dependencies or network calls: A ..> B. Forcing Layout Orientation: While the layout engine spaces boxes out automatically, you can explicitly steer the orientation by inserting a direction keyword directly inside the arrow string: A -up-> B (Forces B to render above A) A -down-> B (Forces B to render below A) A -left-> B (Forces B to render to the left of A) A -right-> B (Forces B to render to the right of A) 4. Adding Context Inline: Labels and Code Comments Clear documentation relies heavily on putting appropriate context around your visual lines and text scripts: Labeling Connection Lines You can add explanatory text straight to any connection line by appending a colon (:) right after your relationship mapping: client_id –> api_id : “HTTPS POST /v1/checkout” Writing Code Comments If you want to leave an administrative note, design credit, or architectural explanation inside your script file without rendering a visual box on the canvas, use a single quote character (‘). This tells the engine to skip parsing that line entirely: ‘ TODO: We need to update this boundary box once the DevOps migration finishes [Legacy Monolith] –> [New Microservice] Now that you are familiar with the global syntax wrappers, component declarations, and directional arrow parameters of PlantUML, you are perfectly equipped to start building advanced system shapes. Proceed to the next page to unlock our collection of Architecture & High-Level Design Diagrams!

Asset Export Routines

While sharing live, interactive links is the fastest way to collaborate, you frequently need to embed your diagrams directly into external environments like code repositories, production wikis, engineering slide decks, or internal messaging channels. VPasCode provides built-in asset export routines that let you instantly convert your text-driven scripts into clean, production-ready image files. You can access these options directly from the top control toolbar of your workspace, allowing you to generate both vector graphics and high-resolution static images with a single click. Exporting Crystal-Clear Vector Graphics (SVG) The Export as SVG (Scalable Vector Graphics) routine is the highly recommended choice for technical documentation. Unlike standard images, an SVG is an XML-based text file that instructs the browser or document viewer exactly how to draw the lines, shapes, and text blocks dynamically. Choosing SVG provides several critical workflow advantages: Infinite Scalability: Because SVGs are vector-based, your diagrams will never become blurry, pixelated, or distorted. Whether a teammate is viewing your software architecture layout on a small laptop display or a massive 4K monitor, every node and label remains perfectly sharp. Lightweight Footprint: SVG files have a incredibly small file size compared to raster images, making them perfect for loading quickly inside web documentation hubs or online wiki pages. Ideal for Markdown Embeds: You can save the downloaded `.svg` file directly into your project’s Git repository and embed it cleanly into your README.md or documentation files using standard Markdown image syntax. Generating High-Resolution Static Images (PNG) The Export as PNG (Portable Network Graphics) routine provides a universal snapshot format that is recognized by virtually every piece of software on the market today. When you trigger this routine, VPasCode instantly packages your layout into a clean, standalone raster image file. The PNG export is perfectly suited for fast-paced communication across your product teams: Frictionless Chat Drops: If you need to quickly align with your engineering team on a bug fix, user flow modification, or data pipeline adjustment, you can export a PNG snapshot and drop it straight into Slack, Microsoft Teams, or Discord chats for immediate feedback. Presentation Ready: PNG files can be dropped directly into slide decks (like PowerPoint or Keynote) or product management dashboards (like Jira or Trello) without worrying about vector layout compatibility. Optimized Framing: The engine automatically crops the bounding box of your PNG to match the exact boundaries of your rendered diagram, ensuring you don’t have to deal with awkward blank margins or whitespace padding. Which Export Format Should You Choose? To help maximize the efficiency of your team documentation pipeline, follow this quick reference guide to select the right asset format for your task: Your Target Environment Recommended Format Key Advantage Git Repositories, GitHub/GitLab Markdown, Technical Wikis SVG Text remains infinitely sharp upon zooming; fits natively into Git file tracking. Slack, Microsoft Teams, Immediate Chat Reviews PNG Renders instantly as an expandable preview directly inside the chat window. Executive Presentations, PDF Reports, Product Overviews PNG / SVG PNG works universally; SVG ensures perfect clarity if printing or resizing documents. Now that you have mastered the core features, workflows, and asset management controls of the platform, you are ready to jump into our specific syntax handbooks. Proceed to the next section to explore the PlantUML Playbook!

Zero-Database URL Sharing Mechanics

One of the most powerful features of VPasCode is how it handles collaboration and file sharing. Unlike traditional modeling platforms that require you to save your diagrams to an account folder, configure team permissions, or store your private design scripts inside centralized databases, VPasCode utilizes a unique, decentralized approach to sharing. Everything you create is fully portable. Your entire diagram structure is securely captured right inside the web link itself, guaranteeing instant collaboration, seamless portability, and absolute privacy. How URL-Based Sharing Works for You As you type your Diagram-as-Code script in the workspace, the web link in your browser’s address bar updates automatically. VPasCode packages your diagram data natively inside the link string. This introduces a major paradigm shift in how technical assets are managed: Your Code Stays Private: Because your data is kept directly within the web link, your diagram scripts are never stored or permanently cached on our servers. Your architectural information remains entirely your own. No Account Sign-Up Friction: Your team members do not need to register for accounts, fill out forms, or wait for enterprise organization approvals just to review a system layout. If they have the link, they have immediate access. Infinite Lifespan: Since your diagram is captured completely in the text link, you can paste these URLs directly into Jira tickets, GitHub Pull Requests, Confluence docs, or Slack channels. They will remain fully readable and interactive forever, independent of any cloud database migrations. Frictionless Collaboration with a Single Link When you click the Share button on the top control toolbar, VPasCode copies a single, unified link straight to your clipboard. This one link handles everything: When a teammate opens this link, the workspace instantly populates the text panel with your exact code and renders the interactive layout right alongside it. Your colleague can immediately review the design, modify nodes, or test new syntaxes. Because editing dynamically updates the link string in their address bar, they can simply make their adjustments and send a new link back to you with their revisions. It is a completely open-ended, rapid hand-off workflow. Perfect Integration with Your Workflow Because sharing relies entirely on text strings, backing up your diagrams is as simple as saving a text footnote. You can paste your shareable VPasCode URLs directly into your project’s local README.md markdown files, tracking your documentation history alongside your standard git branches. Now that you know how to share live, interactive diagram states with your team using our single-link workflow, proceed to the next section to learn how to produce physical vector and image assets using our Asset Export Routines.

Navigating the Live Editor Workspace

The VPasCode Workspace is an integrated environment engineered specifically for high-velocity text-to-diagram creation. By combining a professional-grade text editor with a highly responsive rendering canvas, the platform eliminates the need to switch between local code files and external image viewers. Understanding the core components of this workspace will help you streamline your technical documentation workflow. The Dual-Panel Interface Layout The workspace is split into two primary zones designed to provide immediate visual feedback as you iterate on your system designs: The Code Editor Panel (Left Side): This is your primary input canvas. It functions similarly to modern IDE text environments and includes developer essentials like continuous line numbering, bracket matching, and block folding. The editor handles raw script text for all supported specifications natively. The Preview Renderer Panel (Right Side): This panel houses our cloud-assisted layout engine. Every time you pause typing or change a relationship string in the left panel, this canvas compiles the updated text and re-renders the diagram graphics instantly. Smart Engine Detection and Multi-Tab Workspaces VPasCode handles the complexity of managing different diagram languages behind the scenes, allowing you to focus purely on documenting your systems: You don’t need to manually tell the editor whether you are writing a Mermaid flowchart, a PlantUML model, or a Graphviz data pipeline. The platform’s smart parser automatically inspects your text and instantly spins up the corresponding compiler runtime in the preview window. Real-Time Syntax Validation and Error Diagnostics Writing declarative code diagrams means occasionally hitting syntax errors, such as a missing arrow bracket, an unclosed quote string, or an unmapped node variable. VPasCode treats diagram logic like software code, providing instant debugging feedback: If you break an engine’s syntax validation rules, the live renderer panel safely pauses its regular graphics loop. Instead of displaying a broken or corrupted layout, it displays an inline error diagnostic log. This trace pinpoint exactly which line of text caused the engine to stall and gives you explicit feedback on what semantic element is missing. The moment you correct the string in the code editor, the diagnostic log clears and your diagram pops back into full visual clarity. Canvas Control Tools When working on expansive, highly detailed system models, reading small text blocks or tracking massive data flows can become challenging. The preview canvas includes built-in navigation controls to keep your workflow fluid: Dynamic Pan and Mouse Zoom: Click and drag anywhere inside the preview canvas to freely scroll across massive multi-tiered infrastructure maps. Use your mouse scroll wheel or laptop trackpad to zoom deep into specific microservice clusters without losing image resolution. Fit-to-Screen Toggle: Instantly resets the entire diagram view matrix, perfectly centering and scaling your asset to match the exact dimensions of your display panel. Dark / Light Render Modes: Toggle the aesthetic background theme of your rendered diagram. Switch to light backgrounds for printing and official whitepapers, or dark backgrounds to match your dark-themed coding IDE environment. With a firm grasp of the workspace mechanics, you are ready to explore how to share and export your completed assets seamlessly. Proceed to the next section to learn about our Zero-Database URL Sharing Mechanics.

Scroll to Top