{"id":4390,"date":"2026-01-19T11:45:25","date_gmt":"2026-01-19T03:45:25","guid":{"rendered":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/"},"modified":"2026-01-26T14:54:17","modified_gmt":"2026-01-26T06:54:17","slug":"sequence-diagrams","status":"publish","type":"docs","link":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/","title":{"rendered":"Sequence Diagrams"},"content":{"rendered":"<h2 dir=\"auto\"><strong>Visualizing the time ordering of messages between participants in an interaction<\/strong><\/h2>\n<figure id=\"attachment_5140\" aria-describedby=\"caption-attachment-5140\" style=\"width: 961px\" class=\"wp-caption alignnone\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-5140\" src=\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png\" alt=\"Shipping cart checkout sequence diagram example\" width=\"961\" height=\"601\" srcset=\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png 961w, https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example-300x188.png 300w, https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example-768x480.png 768w, https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example-150x94.png 150w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><figcaption id=\"caption-attachment-5140\" class=\"wp-caption-text\">Shipping cart checkout sequence diagram example<\/figcaption><\/figure>\n<p dir=\"auto\"><strong>Sequence diagrams<\/strong> are one of the most widely used behavioral UML diagrams. They focus on <strong>how objects (or participants) collaborate<\/strong> to accomplish a specific scenario or use case by showing the <strong>time-ordered exchange of messages<\/strong> over time. The vertical dimension represents <strong>time<\/strong> (top to bottom), while the horizontal axis shows the <strong>participants<\/strong> (lifelines).<\/p>\n<p dir=\"auto\">Key elements of sequence diagrams:<\/p>\n<ul dir=\"auto\">\n<li><strong>Lifeline<\/strong> \u2014 Vertical dashed line representing a participant (object, actor, component, service, external system). Named as :ClassName or instanceName:ClassName.<\/li>\n<li><strong>Message<\/strong> \u2014 Horizontal solid arrow (synchronous call), dashed arrow (return\/asynchronous reply), or open arrow (asynchronous message).<\/li>\n<li><strong>Activation Bar<\/strong> (thin rectangle on lifeline) \u2014 Duration of execution\/processing.<\/li>\n<li><strong>Frame<\/strong> \u2014 Boxes like alt (alternative), opt (optional), loop, par (parallel), ref (reference to another interaction), sd (entire scenario).<\/li>\n<li><strong>Actor<\/strong> \u2014 Stick figure for external users\/systems.<\/li>\n<li><strong>Self-message<\/strong> \u2014 Arrow looping back to same lifeline.<\/li>\n<li><strong>Create\/Delete<\/strong> \u2014 Special messages for object creation (dashed arrow with \u00abcreate\u00bb) and destruction (X at end of lifeline).<\/li>\n<li><strong>Note\/Constraint<\/strong> \u2014 Text notes or guards on messages ([condition]).<\/li>\n<\/ul>\n<p dir=\"auto\">In Agile &amp; use-case-driven projects, sequence diagrams are used to:<\/p>\n<ul dir=\"auto\">\n<li>Detail the <strong>main success scenario<\/strong> and critical <strong>alternative\/exception flows<\/strong> of use cases<\/li>\n<li>Clarify interactions between system parts, especially integrations and APIs<\/li>\n<li>Discover missing operations on classes (automatically become method signatures)<\/li>\n<li>Identify concurrency, timing, and sequencing issues early<\/li>\n<li>Serve as basis for unit\/integration tests, mocking, and API contract definition<\/li>\n<li>Communicate precisely with developers, architects, and stakeholders<\/li>\n<\/ul>\n<h3 dir=\"auto\">Practical Examples of Sequence Diagrams in Real Projects<\/h3>\n<p dir=\"auto\">Here are numerous concrete examples across different domains, showing how sequence diagrams capture real interactions:<\/p>\n<ul dir=\"auto\">\n<li><strong>E-commerce \u2013 Successful Checkout with Credit Card<\/strong> Participants: Customer (actor), :ShoppingCart, :OrderService, :PaymentGateway, :BankService Flow:\n<ul dir=\"auto\">\n<li>Customer \u2192 ShoppingCart: proceedToCheckout()<\/li>\n<li>ShoppingCart \u2192 OrderService: createOrder(cartItems)<\/li>\n<li>OrderService \u2192 PaymentGateway: authorize(amount, cardDetails)<\/li>\n<li>PaymentGateway \u2192 BankService: processPayment()<\/li>\n<li>BankService &#8211;&gt; PaymentGateway: approved<\/li>\n<li>PaymentGateway &#8211;&gt; OrderService: authorizationToken<\/li>\n<li>OrderService \u2192 OrderService: confirmOrder() [self-message]<\/li>\n<li>OrderService &#8211;&gt; ShoppingCart: orderConfirmed alt [payment failed] PaymentGateway &#8211;&gt; OrderService: declined OrderService &#8211;&gt; Customer: showError(&#8220;Payment declined&#8221;) end Practical benefit: Clearly shows synchronous call chain and failure path; used to generate mock tests for PaymentGateway.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Mobile Banking \u2013 Secure Fund Transfer with MFA<\/strong> Participants: User (actor), :MobileApp, :AuthService, :CoreBankingService, :NotificationService Flow:\n<ul dir=\"auto\">\n<li>User \u2192 MobileApp: initiateTransfer(destination, amount)<\/li>\n<li>MobileApp \u2192 AuthService: requestMFA()<\/li>\n<li>AuthService \u2192 NotificationService: sendOTP()<\/li>\n<li>NotificationService &#8211;&gt; AuthService: OTP sent<\/li>\n<li>User \u2192 MobileApp: enterOTP(code)<\/li>\n<li>MobileApp \u2192 AuthService: validateOTP(code)<\/li>\n<li>AuthService &#8211;&gt; MobileApp: valid<\/li>\n<li>MobileApp \u2192 CoreBankingService: executeTransfer(destination, amount)<\/li>\n<li>CoreBankingService \u2192 CoreBankingService: debitSource()<\/li>\n<li>CoreBankingService \u2192 CoreBankingService: creditDestination()<\/li>\n<li>CoreBankingService &#8211;&gt; MobileApp: transferSuccessful opt [invalid OTP] AuthService &#8211;&gt; MobileApp: invalidOTP MobileApp &#8211;&gt; User: showRetryPrompt() end Outcome: Exposes MFA timeout and retry logic; critical for security audit.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Ride-Sharing \u2013 Driver Accepting a Ride Request<\/strong> Participants: RiderApp, MatchingService, DriverApp, GPSService Flow:\n<ul dir=\"auto\">\n<li>RiderApp \u2192 MatchingService: requestRide(pickup, destination)<\/li>\n<li>MatchingService \u2192 DriverApp: notifyNewRequest(rideDetails) [asynchronous]<\/li>\n<li>DriverApp \u2192 DriverApp: displayRequest()<\/li>\n<li>DriverApp \u2192 MatchingService: acceptRide()<\/li>\n<li>MatchingService \u2192 RiderApp: driverAssigned(driverInfo)<\/li>\n<li>MatchingService \u2192 GPSService: startTracking(driverLocation)<\/li>\n<li>loop [every 5s] GPSService &#8211;&gt; MatchingService: currentLocation MatchingService &#8211;&gt; RiderApp: updateETA() end Practical: Highlights asynchronous notifications and real-time polling loop.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Healthcare \u2013 Booking Appointment with Conflict Check<\/strong> Participants: PatientPortal, AppointmentService, CalendarService, EHRService Flow:\n<ul dir=\"auto\">\n<li>PatientPortal \u2192 AppointmentService: checkAvailability(doctor, dateTime)<\/li>\n<li>AppointmentService \u2192 CalendarService: querySlot()<\/li>\n<li>CalendarService &#8211;&gt; AppointmentService: available<\/li>\n<li>AppointmentService \u2192 EHRService: verifyPatientInsurance()<\/li>\n<li>EHRService &#8211;&gt; AppointmentService: valid<\/li>\n<li>AppointmentService \u2192 CalendarService: reserveSlot()<\/li>\n<li>CalendarService &#8211;&gt; AppointmentService: reserved<\/li>\n<li>AppointmentService &#8211;&gt; PatientPortal: bookingConfirmed alt [slot taken] CalendarService &#8211;&gt; AppointmentService: conflict AppointmentService &#8211;&gt; PatientPortal: suggestAlternatives() end Benefit: Shows parallel-like validation steps; used for integration test planning.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Library System \u2013 Borrow Book via Self-Service Kiosk<\/strong> Participants: Patron (actor), :Kiosk, :LibrarySystem, :NotificationService Flow:\n<ul dir=\"auto\">\n<li>Patron \u2192 Kiosk: scanCard()<\/li>\n<li>Kiosk \u2192 LibrarySystem: authenticate(memberID)<\/li>\n<li>LibrarySystem &#8211;&gt; Kiosk: authenticated<\/li>\n<li>Patron \u2192 Kiosk: scanBook(ISBN)<\/li>\n<li>Kiosk \u2192 LibrarySystem: requestLoan(ISBN, memberID)<\/li>\n<li>LibrarySystem \u2192 LibrarySystem: checkAvailability() [self]<\/li>\n<li>LibrarySystem \u2192 LibrarySystem: checkOverdues()<\/li>\n<li>LibrarySystem &#8211;&gt; Kiosk: loanApproved<\/li>\n<li>Kiosk &#8211;&gt; Patron: printReceipt() opt [book not available] LibrarySystem &#8211;&gt; Kiosk: outOfStock Kiosk &#8211;&gt; Patron: offerReservation() end Practical: Simple yet complete for kiosk UI flow validation.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Real-Time Stock Trading \u2013 Place Limit Order<\/strong> Participants: Trader (actor), :TradingPlatform, :OrderGateway, :MatchingEngine, :MarketDataFeed Flow:\n<ul dir=\"auto\">\n<li>Trader \u2192 TradingPlatform: placeLimitOrder(symbol, price, quantity)<\/li>\n<li>TradingPlatform \u2192 OrderGateway: submitOrder(order)<\/li>\n<li>OrderGateway \u2192 MatchingEngine: addToOrderBook()<\/li>\n<li>MatchingEngine &#8211;&gt; OrderGateway: accepted<\/li>\n<li>OrderGateway &#8211;&gt; TradingPlatform: orderAcknowledged<\/li>\n<li>par [parallel] MatchingEngine \u2192 MarketDataFeed: subscribePriceUpdates(symbol) loop [price changes] MarketDataFeed &#8211;&gt; MatchingEngine: newPrice MatchingEngine \u2192 MatchingEngine: checkForMatch() end end Outcome: Visualizes critical low-latency path and concurrent market monitoring.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p dir=\"auto\">In Visual Paradigm:<\/p>\n<ul dir=\"auto\">\n<li>Lifelines auto-populate from classes\/components.<\/li>\n<li>Use combined fragments (alt, opt, loop, par) for conditional\/parallel flows.<\/li>\n<li>Animate execution to walk through scenarios.<\/li>\n<li>Generate sequence from class operations or reverse from code.<\/li>\n<li>Semantic backplane links messages to class operations and use case flows.<\/li>\n<\/ul>\n<p dir=\"auto\">Sequence diagrams excel at making <strong>interaction order<\/strong>, <strong>synchronous\/asynchronous nature<\/strong>, and <strong>conditional behavior<\/strong> crystal clear\u2014making them indispensable for detailing risky or complex use case realizations.<\/p>\n<p dir=\"auto\">This prepares you for the complementary view of <a href=\"https:\/\/guides.visual-paradigm.com\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/communication-diagrams\/\"><strong>Communication Diagrams<\/strong><\/a> next, where structure takes precedence over strict timing.<\/p>\n","protected":false},"featured_media":0,"parent":4388,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_eb_attr":"","neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"doc_tag":[],"class_list":["post-4390","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sequence Diagrams - Visual Paradigm Guides Vietnamese<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sequence Diagrams - Visual Paradigm Guides Vietnamese\" \/>\n<meta property=\"og:description\" content=\"Visualizing the time ordering of messages between participants in an interaction Sequence diagrams are one of the most widely used behavioral UML diagrams. They focus on how objects (or participants) collaborate to accomplish a specific scenario or use case by showing the time-ordered exchange of messages over time. The vertical dimension represents time (top to bottom), while the horizontal axis shows the participants (lifelines). Key elements of sequence diagrams: Lifeline \u2014 Vertical dashed line representing a participant (object, actor, component, service, external system). Named as :ClassName or instanceName:ClassName. Message \u2014 Horizontal solid arrow (synchronous call), dashed arrow (return\/asynchronous reply), or open arrow (asynchronous message). Activation Bar (thin rectangle on lifeline) \u2014 Duration of execution\/processing. Frame \u2014 Boxes like alt (alternative), opt (optional), loop, par (parallel), ref (reference to another interaction), sd (entire scenario). Actor \u2014 Stick figure for external users\/systems. Self-message \u2014 Arrow looping back to same lifeline. Create\/Delete \u2014 Special messages for object creation (dashed arrow with \u00abcreate\u00bb) and destruction (X at end of lifeline). Note\/Constraint \u2014 Text notes or guards on messages ([condition]). In Agile &amp; use-case-driven projects, sequence diagrams are used to: Detail the main success scenario and critical alternative\/exception flows of use cases Clarify interactions between system parts, especially integrations and APIs Discover missing operations on classes (automatically become method signatures) Identify concurrency, timing, and sequencing issues early Serve as basis for unit\/integration tests, mocking, and API contract definition Communicate precisely with developers, architects, and stakeholders Practical Examples of Sequence Diagrams in Real Projects Here are numerous concrete examples across different domains, showing how sequence diagrams capture real interactions: E-commerce \u2013 Successful Checkout with Credit Card Participants: Customer (actor), :ShoppingCart, :OrderService, :PaymentGateway, :BankService Flow: Customer \u2192 ShoppingCart: proceedToCheckout() ShoppingCart \u2192 OrderService: createOrder(cartItems) OrderService \u2192 PaymentGateway: authorize(amount, cardDetails) PaymentGateway \u2192 BankService: processPayment() BankService &#8211;&gt; PaymentGateway: approved PaymentGateway &#8211;&gt; OrderService: authorizationToken OrderService \u2192 OrderService: confirmOrder() [self-message] OrderService &#8211;&gt; ShoppingCart: orderConfirmed alt [payment failed] PaymentGateway &#8211;&gt; OrderService: declined OrderService &#8211;&gt; Customer: showError(&#8220;Payment declined&#8221;) end Practical benefit: Clearly shows synchronous call chain and failure path; used to generate mock tests for PaymentGateway. Mobile Banking \u2013 Secure Fund Transfer with MFA Participants: User (actor), :MobileApp, :AuthService, :CoreBankingService, :NotificationService Flow: User \u2192 MobileApp: initiateTransfer(destination, amount) MobileApp \u2192 AuthService: requestMFA() AuthService \u2192 NotificationService: sendOTP() NotificationService &#8211;&gt; AuthService: OTP sent User \u2192 MobileApp: enterOTP(code) MobileApp \u2192 AuthService: validateOTP(code) AuthService &#8211;&gt; MobileApp: valid MobileApp \u2192 CoreBankingService: executeTransfer(destination, amount) CoreBankingService \u2192 CoreBankingService: debitSource() CoreBankingService \u2192 CoreBankingService: creditDestination() CoreBankingService &#8211;&gt; MobileApp: transferSuccessful opt [invalid OTP] AuthService &#8211;&gt; MobileApp: invalidOTP MobileApp &#8211;&gt; User: showRetryPrompt() end Outcome: Exposes MFA timeout and retry logic; critical for security audit. Ride-Sharing \u2013 Driver Accepting a Ride Request Participants: RiderApp, MatchingService, DriverApp, GPSService Flow: RiderApp \u2192 MatchingService: requestRide(pickup, destination) MatchingService \u2192 DriverApp: notifyNewRequest(rideDetails) [asynchronous] DriverApp \u2192 DriverApp: displayRequest() DriverApp \u2192 MatchingService: acceptRide() MatchingService \u2192 RiderApp: driverAssigned(driverInfo) MatchingService \u2192 GPSService: startTracking(driverLocation) loop [every 5s] GPSService &#8211;&gt; MatchingService: currentLocation MatchingService &#8211;&gt; RiderApp: updateETA() end Practical: Highlights asynchronous notifications and real-time polling loop. Healthcare \u2013 Booking Appointment with Conflict Check Participants: PatientPortal, AppointmentService, CalendarService, EHRService Flow: PatientPortal \u2192 AppointmentService: checkAvailability(doctor, dateTime) AppointmentService \u2192 CalendarService: querySlot() CalendarService &#8211;&gt; AppointmentService: available AppointmentService \u2192 EHRService: verifyPatientInsurance() EHRService &#8211;&gt; AppointmentService: valid AppointmentService \u2192 CalendarService: reserveSlot() CalendarService &#8211;&gt; AppointmentService: reserved AppointmentService &#8211;&gt; PatientPortal: bookingConfirmed alt [slot taken] CalendarService &#8211;&gt; AppointmentService: conflict AppointmentService &#8211;&gt; PatientPortal: suggestAlternatives() end Benefit: Shows parallel-like validation steps; used for integration test planning. Library System \u2013 Borrow Book via Self-Service Kiosk Participants: Patron (actor), :Kiosk, :LibrarySystem, :NotificationService Flow: Patron \u2192 Kiosk: scanCard() Kiosk \u2192 LibrarySystem: authenticate(memberID) LibrarySystem &#8211;&gt; Kiosk: authenticated Patron \u2192 Kiosk: scanBook(ISBN) Kiosk \u2192 LibrarySystem: requestLoan(ISBN, memberID) LibrarySystem \u2192 LibrarySystem: checkAvailability() [self] LibrarySystem \u2192 LibrarySystem: checkOverdues() LibrarySystem &#8211;&gt; Kiosk: loanApproved Kiosk &#8211;&gt; Patron: printReceipt() opt [book not available] LibrarySystem &#8211;&gt; Kiosk: outOfStock Kiosk &#8211;&gt; Patron: offerReservation() end Practical: Simple yet complete for kiosk UI flow validation. Real-Time Stock Trading \u2013 Place Limit Order Participants: Trader (actor), :TradingPlatform, :OrderGateway, :MatchingEngine, :MarketDataFeed Flow: Trader \u2192 TradingPlatform: placeLimitOrder(symbol, price, quantity) TradingPlatform \u2192 OrderGateway: submitOrder(order) OrderGateway \u2192 MatchingEngine: addToOrderBook() MatchingEngine &#8211;&gt; OrderGateway: accepted OrderGateway &#8211;&gt; TradingPlatform: orderAcknowledged par [parallel] MatchingEngine \u2192 MarketDataFeed: subscribePriceUpdates(symbol) loop [price changes] MarketDataFeed &#8211;&gt; MatchingEngine: newPrice MatchingEngine \u2192 MatchingEngine: checkForMatch() end end Outcome: Visualizes critical low-latency path and concurrent market monitoring. In Visual Paradigm: Lifelines auto-populate from classes\/components. Use combined fragments (alt, opt, loop, par) for conditional\/parallel flows. Animate execution to walk through scenarios. Generate sequence from class operations or reverse from code. Semantic backplane links messages to class operations and use case flows. Sequence diagrams excel at making interaction order, synchronous\/asynchronous nature, and conditional behavior crystal clear\u2014making them indispensable for detailing risky or complex use case realizations. This prepares you for the complementary view of Communication Diagrams next, where structure takes precedence over strict timing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/\" \/>\n<meta property=\"og:site_name\" content=\"Visual Paradigm Guides Vietnamese\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-26T06:54:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png\" \/>\n\t<meta property=\"og:image:width\" content=\"961\" \/>\n\t<meta property=\"og:image:height\" content=\"601\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 ph\u00fat\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/\",\"url\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/\",\"name\":\"Sequence Diagrams - Visual Paradigm Guides Vietnamese\",\"isPartOf\":{\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png\",\"datePublished\":\"2026-01-19T03:45:25+00:00\",\"dateModified\":\"2026-01-26T06:54:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#breadcrumb\"},\"inLanguage\":\"vi\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"vi\",\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage\",\"url\":\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png\",\"contentUrl\":\"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png\",\"width\":961,\"height\":601,\"caption\":\"Shipping cart checkout sequence diagram example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/guides.visual-paradigm.com\/vn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mastering UML 2.5: A Use Case Driven Approach to Agile Modeling\",\"item\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Module 4: The Heartbeat \u2013 The 7 Behavioral UML Diagrams\",\"item\":\"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Sequence Diagrams\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/guides.visual-paradigm.com\/vn\/#website\",\"url\":\"https:\/\/guides.visual-paradigm.com\/vn\/\",\"name\":\"Visual Paradigm Guides Vietnamese\",\"description\":\"Smart guides for an AI-driven world\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/guides.visual-paradigm.com\/vn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"vi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sequence Diagrams - Visual Paradigm Guides Vietnamese","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/","og_locale":"vi_VN","og_type":"article","og_title":"Sequence Diagrams - Visual Paradigm Guides Vietnamese","og_description":"Visualizing the time ordering of messages between participants in an interaction Sequence diagrams are one of the most widely used behavioral UML diagrams. They focus on how objects (or participants) collaborate to accomplish a specific scenario or use case by showing the time-ordered exchange of messages over time. The vertical dimension represents time (top to bottom), while the horizontal axis shows the participants (lifelines). Key elements of sequence diagrams: Lifeline \u2014 Vertical dashed line representing a participant (object, actor, component, service, external system). Named as :ClassName or instanceName:ClassName. Message \u2014 Horizontal solid arrow (synchronous call), dashed arrow (return\/asynchronous reply), or open arrow (asynchronous message). Activation Bar (thin rectangle on lifeline) \u2014 Duration of execution\/processing. Frame \u2014 Boxes like alt (alternative), opt (optional), loop, par (parallel), ref (reference to another interaction), sd (entire scenario). Actor \u2014 Stick figure for external users\/systems. Self-message \u2014 Arrow looping back to same lifeline. Create\/Delete \u2014 Special messages for object creation (dashed arrow with \u00abcreate\u00bb) and destruction (X at end of lifeline). Note\/Constraint \u2014 Text notes or guards on messages ([condition]). In Agile &amp; use-case-driven projects, sequence diagrams are used to: Detail the main success scenario and critical alternative\/exception flows of use cases Clarify interactions between system parts, especially integrations and APIs Discover missing operations on classes (automatically become method signatures) Identify concurrency, timing, and sequencing issues early Serve as basis for unit\/integration tests, mocking, and API contract definition Communicate precisely with developers, architects, and stakeholders Practical Examples of Sequence Diagrams in Real Projects Here are numerous concrete examples across different domains, showing how sequence diagrams capture real interactions: E-commerce \u2013 Successful Checkout with Credit Card Participants: Customer (actor), :ShoppingCart, :OrderService, :PaymentGateway, :BankService Flow: Customer \u2192 ShoppingCart: proceedToCheckout() ShoppingCart \u2192 OrderService: createOrder(cartItems) OrderService \u2192 PaymentGateway: authorize(amount, cardDetails) PaymentGateway \u2192 BankService: processPayment() BankService &#8211;&gt; PaymentGateway: approved PaymentGateway &#8211;&gt; OrderService: authorizationToken OrderService \u2192 OrderService: confirmOrder() [self-message] OrderService &#8211;&gt; ShoppingCart: orderConfirmed alt [payment failed] PaymentGateway &#8211;&gt; OrderService: declined OrderService &#8211;&gt; Customer: showError(&#8220;Payment declined&#8221;) end Practical benefit: Clearly shows synchronous call chain and failure path; used to generate mock tests for PaymentGateway. Mobile Banking \u2013 Secure Fund Transfer with MFA Participants: User (actor), :MobileApp, :AuthService, :CoreBankingService, :NotificationService Flow: User \u2192 MobileApp: initiateTransfer(destination, amount) MobileApp \u2192 AuthService: requestMFA() AuthService \u2192 NotificationService: sendOTP() NotificationService &#8211;&gt; AuthService: OTP sent User \u2192 MobileApp: enterOTP(code) MobileApp \u2192 AuthService: validateOTP(code) AuthService &#8211;&gt; MobileApp: valid MobileApp \u2192 CoreBankingService: executeTransfer(destination, amount) CoreBankingService \u2192 CoreBankingService: debitSource() CoreBankingService \u2192 CoreBankingService: creditDestination() CoreBankingService &#8211;&gt; MobileApp: transferSuccessful opt [invalid OTP] AuthService &#8211;&gt; MobileApp: invalidOTP MobileApp &#8211;&gt; User: showRetryPrompt() end Outcome: Exposes MFA timeout and retry logic; critical for security audit. Ride-Sharing \u2013 Driver Accepting a Ride Request Participants: RiderApp, MatchingService, DriverApp, GPSService Flow: RiderApp \u2192 MatchingService: requestRide(pickup, destination) MatchingService \u2192 DriverApp: notifyNewRequest(rideDetails) [asynchronous] DriverApp \u2192 DriverApp: displayRequest() DriverApp \u2192 MatchingService: acceptRide() MatchingService \u2192 RiderApp: driverAssigned(driverInfo) MatchingService \u2192 GPSService: startTracking(driverLocation) loop [every 5s] GPSService &#8211;&gt; MatchingService: currentLocation MatchingService &#8211;&gt; RiderApp: updateETA() end Practical: Highlights asynchronous notifications and real-time polling loop. Healthcare \u2013 Booking Appointment with Conflict Check Participants: PatientPortal, AppointmentService, CalendarService, EHRService Flow: PatientPortal \u2192 AppointmentService: checkAvailability(doctor, dateTime) AppointmentService \u2192 CalendarService: querySlot() CalendarService &#8211;&gt; AppointmentService: available AppointmentService \u2192 EHRService: verifyPatientInsurance() EHRService &#8211;&gt; AppointmentService: valid AppointmentService \u2192 CalendarService: reserveSlot() CalendarService &#8211;&gt; AppointmentService: reserved AppointmentService &#8211;&gt; PatientPortal: bookingConfirmed alt [slot taken] CalendarService &#8211;&gt; AppointmentService: conflict AppointmentService &#8211;&gt; PatientPortal: suggestAlternatives() end Benefit: Shows parallel-like validation steps; used for integration test planning. Library System \u2013 Borrow Book via Self-Service Kiosk Participants: Patron (actor), :Kiosk, :LibrarySystem, :NotificationService Flow: Patron \u2192 Kiosk: scanCard() Kiosk \u2192 LibrarySystem: authenticate(memberID) LibrarySystem &#8211;&gt; Kiosk: authenticated Patron \u2192 Kiosk: scanBook(ISBN) Kiosk \u2192 LibrarySystem: requestLoan(ISBN, memberID) LibrarySystem \u2192 LibrarySystem: checkAvailability() [self] LibrarySystem \u2192 LibrarySystem: checkOverdues() LibrarySystem &#8211;&gt; Kiosk: loanApproved Kiosk &#8211;&gt; Patron: printReceipt() opt [book not available] LibrarySystem &#8211;&gt; Kiosk: outOfStock Kiosk &#8211;&gt; Patron: offerReservation() end Practical: Simple yet complete for kiosk UI flow validation. Real-Time Stock Trading \u2013 Place Limit Order Participants: Trader (actor), :TradingPlatform, :OrderGateway, :MatchingEngine, :MarketDataFeed Flow: Trader \u2192 TradingPlatform: placeLimitOrder(symbol, price, quantity) TradingPlatform \u2192 OrderGateway: submitOrder(order) OrderGateway \u2192 MatchingEngine: addToOrderBook() MatchingEngine &#8211;&gt; OrderGateway: accepted OrderGateway &#8211;&gt; TradingPlatform: orderAcknowledged par [parallel] MatchingEngine \u2192 MarketDataFeed: subscribePriceUpdates(symbol) loop [price changes] MarketDataFeed &#8211;&gt; MatchingEngine: newPrice MatchingEngine \u2192 MatchingEngine: checkForMatch() end end Outcome: Visualizes critical low-latency path and concurrent market monitoring. In Visual Paradigm: Lifelines auto-populate from classes\/components. Use combined fragments (alt, opt, loop, par) for conditional\/parallel flows. Animate execution to walk through scenarios. Generate sequence from class operations or reverse from code. Semantic backplane links messages to class operations and use case flows. Sequence diagrams excel at making interaction order, synchronous\/asynchronous nature, and conditional behavior crystal clear\u2014making them indispensable for detailing risky or complex use case realizations. This prepares you for the complementary view of Communication Diagrams next, where structure takes precedence over strict timing.","og_url":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/","og_site_name":"Visual Paradigm Guides Vietnamese","article_modified_time":"2026-01-26T06:54:17+00:00","og_image":[{"width":961,"height":601,"url":"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"4 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/","url":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/","name":"Sequence Diagrams - Visual Paradigm Guides Vietnamese","isPartOf":{"@id":"https:\/\/guides.visual-paradigm.com\/vn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage"},"image":{"@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage"},"thumbnailUrl":"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png","datePublished":"2026-01-19T03:45:25+00:00","dateModified":"2026-01-26T06:54:17+00:00","breadcrumb":{"@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#primaryimage","url":"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png","contentUrl":"https:\/\/guides.visual-paradigm.com\/vn\/wp-content\/uploads\/sites\/10\/2026\/01\/shopping-cart-checkout-sequence-diagram-example.png","width":961,"height":601,"caption":"Shipping cart checkout sequence diagram example"},{"@type":"BreadcrumbList","@id":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/sequence-diagrams\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/guides.visual-paradigm.com\/vn\/"},{"@type":"ListItem","position":2,"name":"Mastering UML 2.5: A Use Case Driven Approach to Agile Modeling","item":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/"},{"@type":"ListItem","position":3,"name":"Module 4: The Heartbeat \u2013 The 7 Behavioral UML Diagrams","item":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/"},{"@type":"ListItem","position":4,"name":"Sequence Diagrams"}]},{"@type":"WebSite","@id":"https:\/\/guides.visual-paradigm.com\/vn\/#website","url":"https:\/\/guides.visual-paradigm.com\/vn\/","name":"Visual Paradigm Guides Vietnamese","description":"Smart guides for an AI-driven world","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/guides.visual-paradigm.com\/vn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/comments?post=4390"}],"version-history":[{"count":5,"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4390\/revisions"}],"predecessor-version":[{"id":5264,"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4390\/revisions\/5264"}],"up":[{"embeddable":true,"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4388"}],"next":[{"title":"Communication Diagrams","link":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/communication-diagrams\/","href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4393"}],"prev":[{"title":"Activity Diagrams","link":"https:\/\/guides.visual-paradigm.com\/vn\/docs\/mastering-uml-2-5-a-use-case-driven-approach-to-agile-modeling\/module-4-the-heartbeat-the-7-behavioral-uml-diagrams\/activity-diagrams\/","href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/docs\/4389"}],"wp:attachment":[{"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/media?parent=4390"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/guides.visual-paradigm.com\/vn\/wp-json\/wp\/v2\/doc_tag?post=4390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}