UML Component Diagram Lab
Which interfaces does the order service need?
Select a component role, square port or assembly connector. Inspect who needs the interface, who provides it and what it declares.
List of components, ports and connectors
A square marks a port on a role boundary. Each port in this case carries one required or provided interface.
A socket needs an interface. A ball provides one. A joined ball and socket show these two roles assembled.
This diagram shows component contracts. Checkout creates an order awaiting payment. A separate business flow triggers payment.
Notation and semantics
This case checks the declared interface identity and endpoint roles, with one provider per required port. Passing the check establishes this model’s assembly contract. Protocol, availability and behavioral compatibility require separate validation.
OMG · UML 2.5.1 §§10.4, 11.2–11.6, 19.2–19.4 ↗Order service requires
PaymentGatewayDeclared operationauthorize(orderId, amount): PaymentDecisionAdapter declares
PaymentGatewayDeclared operationauthorize(orderId, amount): PaymentDecisionList of components, ports and connectors
This case checks the declared interface identity and endpoint roles, with one provider per required port. Passing the check establishes this model’s assembly contract. Protocol, availability and behavioral compatibility require separate validation.
Check the model to see which connector or port needs repair.
List of components, ports and connectors
This case checks the declared interface identity and endpoint roles, with one provider per required port. Passing the check establishes this model’s assembly contract. Protocol, availability and behavioral compatibility require separate validation.
Types in the package diagram → Roles in the component diagram
Shop::Application::CheckoutService- CheckoutService is a type in the application package. It can serve as an internal implementation entry point for OrderService.
Shop::Contracts::Payments::PaymentGateway- PaymentGateway defines the contract. OrderService needs it, and both the card and wallet adapters provide it.
Shop::Infrastructure::PaymentAdapter- The infrastructure package models the PaymentAdapter type. Card and wallet adapters are two implementations in this case.
Example artifacts
«artifact» orders.jar«manifest»«component» OrderService«artifact» payment-adapter.jar«manifest»«component» CardPaymentAdapter
Artifacts carry implementations. In this example, orders.jar and payment-adapter.jar manifest their respective components. The deployment view shows where the artifacts are allocated.
Open the order deployment diagram ↗Which endpoint should show a socket?
Booking calls the calendar service’s Availability interface. Each side has a dedicated port.