Hubbry Logo
Actor (UML)Actor (UML)Main
Open search
Actor (UML)
Community hub
Actor (UML)
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Actor (UML)
Actor (UML)
from Wikipedia
Parent-Teacher and Child - 2 actors, 5 usecases
UML use case diagram with two actors (Parent-Teacher and Child) and 5 use cases.

An actor[1] in the Unified Modeling Language (UML) "specifies a role played by a user or any other system that interacts with the subject."[1]

"An Actor models a type of role played by an entity that interacts with the subject (e.g., by exchanging signals and data), but which is external to the subject."[2]

"Actors may represent roles played by human users, external hardware, or other subjects. Actors do not necessarily represent specific physical entities but merely particular facets (i.e., “roles”) of some entities that are relevant to the specification of its associated use cases. A single physical instance may play the role of several different actors and a given actor may be played by multiple different instances."[2]

UML 2 does not permit associations between Actors.[2][3] The use of generalization/specialization relationship between actors is useful in modeling overlapping behaviours between actors and does not violate this constraint since a generalization relation is not a type of association.[4]

Actors interact with use cases.

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In the (UML), an is a specialized kind of classifier that models a type of played by an external to the subject system, such as a user, organization, hardware device, or another system, which interacts with the subject by exchanging signals and data. Actors are fundamental elements in UML diagrams, where they represent external participants that drive or collaborate in the system's observable behaviors, without being part of the system's internal structure. As specializations of the BehavioredClassifier , actors may own behaviors, realize interfaces, and communicate via signals, enabling them to specify roles relevant to interactions. They connect to s through associations, which can exhibit multiplicities greater than one to indicate multiple actor instances or use case involvements, and actors support hierarchies to model . Visually, actors are denoted by a stick-figure with the role name below it, or alternatively as a with the keyword «actor» in the name compartment, placed outside the system boundary in diagrams. This notation emphasizes their external nature and distinguishes them from internal system elements like classes or components. Constraints ensure actors have non-empty names and limit their associations to use cases, classes, or components. In broader UML modeling, actors facilitate by focusing on how external roles influence system functionality, making them essential for high-level system design and .

Definition and Fundamentals

Definition

In UML, an is defined as a kind of classifier that specifies a played by an external interacting with the subject of the model, such as a user, , or another . It represents a coherent set of behaviors external to the system under consideration, modeling how these entities engage with the through exchanges of signals and data. As a kind of classifier specializing the BehavioredClassifier , the captures rather than specific physical instances, allowing multiple entities to fulfill the same or a single entity to assume multiple . The UML 2.5 specification formalizes the actor within the UseCases package, emphasizing its position outside the subject and its interactions via s. Core attributes of an actor include name, a required providing a , and isAbstract, a with a default value of false, which supports hierarchies among actors. Additionally, actors maintain associations to use cases, typically with a multiplicity of [*] on the use case end, enabling an actor to participate in multiple use cases while ensuring binary relationships only with use cases, components, or classes. Constraints mandate that actors must have a name and only associate in the specified manner to maintain modeling integrity. The concept was introduced in UML 1.0 as an integral part of modeling, drawing from earlier object-oriented methods to represent external participants. It has been refined in UML 2.5 to enhance integration with other behavioral diagrams, such as activity and diagrams, through improved semantics for and interactions.

Role and Purpose

In UML modeling, actors serve the primary purpose of representing external entities that interact with the system, driving its behavior through initiation or participation in use cases and thereby delineating the system's boundaries. These entities, which may include human users, hardware devices, or other systems, are abstracted as roles focused on their interactions via signals and data exchanges with the subject under design. This approach ensures that the model captures the necessary external stimuli without specifying the internal structures or implementations of those entities. During requirements gathering in the lifecycle, actors fulfill a key role by identifying stakeholders and external interfaces upfront, allowing analysts to map out how the system responds to environmental demands. By associating actors with use cases, models express the subject's requirements concerning its surroundings, facilitating early elicitation of interaction patterns and dependencies. This early identification helps prioritize functional expectations and ensures comprehensive coverage of external influences. The incorporation of actors yields significant benefits, such as clarifying the system scope through boundary definition, enabling traceability from stakeholder needs to downstream design and implementation artifacts, and supporting validation of whether the model adequately addresses environmental interactions. Empirical insights from UML practitioner surveys highlight how actor representations in use case diagrams improve stakeholder communication, requirement verification, and overall modeling effectiveness by providing a high-level view of roles and responsibilities. In UML 2.5, actors are defined as behaviored classifiers, emphasizing their capacity to abstract external behaviors modularly without internal details, which enhances model maintainability and reusability across development phases.

Characteristics and Properties

Types of Actors

In UML modeling practice, actors are often categorized based on their in use cases (such as primary and secondary), their nature as representing or entities, and their level of (concrete or abstract). These distinctions help model external interactions precisely, focusing on roles rather than specific instances. Primary actors are those that initiate a to achieve a specific , driving the interaction from the outside; for instance, a user initiating a process represents a primary actor by requesting the system's response to fulfill their objective. In contrast, secondary actors, also known as supporting actors, provide a necessary service or response during the use case without initiating it, such as a supplying data in response to a query from the primary actor. This division highlights the directional flow of interactions, where primary actors seek value from the system while secondary ones enable its fulfillment. Actors can further be distinguished by their nature: human actors represent roles played by people, such as a "customer" engaging with an e-commerce system, whereas non-human actors model external systems or hardware, like a "payment gateway" processing transactions. The UML specification explicitly allows actors to encompass both, defining an actor as a role played by a user, organization, or any other system interacting with the subject through signals and data exchanges. Non-human actors are particularly useful for capturing dependencies on legacy systems or devices that behave predictably in interactions. Regarding abstraction, concrete actors denote specific, instantiable roles, such as a particular "administrator" in a system, while abstract actors serve as for hierarchies, allowing specialization through relationships like ; for example, an abstract "web client" actor could be specialized into subtypes like "" or "desktop browser." The UML metamodel supports this by treating actors as behaviored classifiers, which can be marked as abstract to indicate they are not directly instantiated but used for defining common behaviors. Under UML 2.5, actors extend beyond individuals or systems to include abstract roles like organizations or even time, enabling models to represent collective entities (e.g., a "" as an organizational actor) or temporal triggers (e.g., a "" actor for scheduled events) that interact with the system. This flexibility aligns with the specification's emphasis on actors as roles facilitating external stimuli, including non-entity abstractions when they meaningfully participate in use cases.

Notation and Representation

In UML 2.5, actors are visually represented using a standard icon consisting of a simple , depicting a -like form with a head, body, and arms, to symbolize roles played by external entities interacting with the system. This serves as the default notation for actors, with the actor's name placed below, above, or inside the figure for identification. For non-human actors, such as external systems or devices, an alternative notation uses a shaped like a element, annotated with the «actor» in guillemets to indicate its role. The textual representation of an includes its name, which follows standard UML (e.g., capitalized nouns), positioned adjacent to or within the ; optional multiplicity indicators may appear on associations connected to the actor, denoting the number of actor instances involved. can be applied to further classify the actor's role, displayed in guillemets near the name or . Custom icons may be defined by modelers for specific non-human actors, replacing the default shapes while maintaining the «actor» . Generalization relationships between actors are denoted by a solid line ending in a hollow triangle arrowhead, pointing from the specialized (sub) actor to the more general (super) actor, mirroring the notation used in class diagrams. This allows specialized actors, such as a "" extending a general "User," to inherit properties from the parent. In diagrams, are placed outside the system boundary rectangle to emphasize their external nature, typically positioned along the diagram's edges for clarity. UML 2.5 maintains the black-and-white and rectangle as the core standard notation, though modeling tools may support colored variants for enhanced distinction between actor types without altering the .

Usage in UML Diagrams

In Use Case Diagrams

In use case diagrams, actors are positioned outside the system boundary to represent external entities interacting with the system, while use cases are placed inside the boundary to depict the system's functionalities. These diagrams illustrate the connections between actors and use cases through lines denoting associations, emphasizing the roles actors play in initiating or participating in system behaviors without specifying the sequence or timing of interactions. The system boundary itself is represented as a rectangular box that encloses the use cases, clearly delineating the scope of the system from its external environment, with the subject's name often placed in the top-left corner of the rectangle. According to the UML 2.5 specification, use case diagrams serve as behavioral views that capture , , and their relationships, providing a high-level overview of system functionality without delving into detailed execution sequences or internal processes. In this structure, are typically notated as stick figures or class rectangles labeled with the «actor» , reinforcing their external role. This arrangement highlights the diagram's purpose in modeling collaborations between the system and its surroundings. Actors in use case diagrams define the "who" behind the functional requirements by identifying external roles—such as users, other systems, or hardware—that drive the system's operations, thereby aiding in boundary analysis to clarify what lies inside versus outside the system scope. This focus helps stakeholders understand interaction points early in requirements gathering, ensuring the diagram remains a static representation of expected behaviors rather than dynamic flows. Such diagrams are commonly created using modeling tools like Visual Paradigm, which supports UML-compliant use case visualization, or draw.io (now diagrams.net), an open-source option for initial diagramming during software design phases.

Interactions and Associations

In UML use case diagrams, actors interact with the system primarily through associations to use cases, represented as solid lines connecting the actor symbol to the use case oval, signifying direct communication or collaboration between them. These associations model the channels via which actors invoke or participate in use case behaviors, with UML 2.5 specifying that only binary associations are permitted between actors and use cases. Multiplicity can be indicated at either end of the association; for instance, a multiplicity of 1..* at the use case end denotes that one actor instance may engage with multiple use cases, while a multiplicity greater than one at the actor end implies involvement of multiple actor instances in a single use case execution, though the precise temporal interpretation (e.g., simultaneous or sequential) remains intentionally underspecified in the semantics. Generalization relationships among actors allow for of roles, depicted as a solid line with a hollow arrowhead (white triangle) pointing from the specialized ( to the generalized (parent) actor, enabling reuse of common behaviors and associations. For example, a "Manager" actor might an "Employee" actor, where the Manager all associations of the Employee while potentially adding specialized ones. This mechanism supports hierarchical modeling of actor roles without direct actor-to-actor associations, as UML prohibits such links to maintain focus on system interactions via . Indirect interactions involving occur through relationships like include and extend. In an include relationship, a base incorporates a common subroutine , potentially involving the same associated with the base; similarly, an extend relationship allows conditional extension of a base by another, where from the base may participate in the extended scenario if applicable. These do not create direct ties to but leverage existing associations to extend interaction scopes. Per UML 2.5 semantics, associations between and represent abstract communication channels, often with implied from the to the to indicate initiation of interactions, though explicit arrowheads may be omitted in notation for simplicity. It is recommended that every connect to at least one to ensure all defined roles contribute meaningfully to the system's behavioral model; isolated , while semantically allowed, are typically avoided in practice.

Examples and Applications

Basic Example

A basic example of an in UML can be seen in a for an Automated Teller Machine (ATM) system, where the primary is the "" who interacts with the system to perform banking transactions. In this scenario, the Customer initiates a cash withdrawal by inserting a card, entering a PIN, and specifying the amount, representing a straightforward external entity driving the system's functionality. The diagram depicts the as a stick-figure positioned outside a rectangular boundary that encloses the subsystem, connected by a solid line to an oval-shaped labeled "Withdraw Cash" within the boundary. This notation highlights the 's external role, with the line indicating a direct association where the Customer triggers the use case. Additionally, a secondary actor, the "Bank Database," associates with the "Withdraw Cash" use case via another line to verify account balances and authorize the transaction, illustrating how external systems support the primary interaction without being the initiator. This example demonstrates the fundamental boundary between the system and its actors, emphasizing simple associations that show initiation and support roles essential for introductory UML modeling.

Advanced Scenarios

In advanced UML modeling, actor hierarchies enable the representation of specialized roles within broader categories, enhancing reusability and clarity in complex systems. Consider an e-commerce platform where the general "User" actor is specialized into "Buyer" and "Seller" through generalization relationships. The "Buyer" inherits the basic interaction capabilities of "User," such as authentication, while adding specific behaviors like order placement; a generalization arrow points from "Buyer" to "User," indicating inheritance of associations and attributes. Similarly, "Seller" generalizes "User" to include inventory management functions. This structure allows shared use cases, such as "Authenticate User," to be associated with the general actor, while specialized use cases like "Place Order" connect directly to "Buyer" via an association line. Secondary actors, often external systems, further complicate interactions by supporting primary actors across multiple use cases. In the e-commerce example, the "Payment Processor" serves as a secondary actor, handling financial transactions independently of the primary "Buyer." It associates with the "Process Payment" use case through a directed line, typically initiated by the system rather than the actor itself. Multiplicity refines these associations; for instance, a single "Payment Processor" instance (multiplicity 1 on the actor end) can participate in many "Process Payment" instances (multiplicity * on the use case end), reflecting real-world where one gateway supports numerous transactions. This multiplicity is specified at the association ends, ensuring precise modeling of participation constraints. Such advanced actor configurations find application in modeling distributed architectures like , where external APIs function as s to represent interactions with third-party services. For example, an external payment can act as an associating with use cases like "Validate Transaction," encapsulating boundary interactions without delving into internal service details. This approach highlights system boundaries, treating APIs as black-box entities that provide or consume value. UML 2.5 supports modeling interactions with external entities like actors through ports in composite structure diagrams, allowing depiction of how they engage with the internal parts of structured classifiers such as subsystems for more granular behavioral analysis. For instance, in a subsystem for , an external "" actor can connect via ports to internal parts, facilitating the specification of subsystem-level interactions without flattening the entire view. This capability supports hierarchical modeling in large-scale systems, aligning actors with the encapsulation principles of structured classifiers.

Comparison with Use Cases

In UML, represent external entities or roles that interact with a , such as users, other , or hardware devices, while use cases encapsulate the internal behaviors and functionalities provided by the system itself. are positioned outside the system's boundary, defining the external perspectives that drive interactions, whereas use cases focus on the observable results and value delivered within the system to those or stakeholders. The relationship between actors and use cases is one of collaboration and initiation, where actors trigger or participate in use cases through associations, but actors remain separate from the system's implementation details. For instance, an actor may initiate a use case to achieve a , but the use case describes the system's response and behavior without incorporating the actor's internal logic. This separation ensures that actors model "who" or "what" interacts with the system, while use cases specify "what" the system does in response. According to the UML 2.5 specification, are classifiers external to the subject (the system under consideration), often stereotyped as such to emphasize their role-based nature, whereas use cases are behavioral classifiers that reside within the subject and may not require actor initiation in all cases. This distinction highlights scope as interaction initiators or supporters outside the system's boundary, in contrast to use cases' scope as self-contained units of functionality. A common misconception is that actors equate directly to specific users, whereas they actually represent abstract roles that any entity—human or otherwise—may fulfill during interactions. Similarly, use cases are often confused with simple system features, but they instead model complete interaction scenarios yielding value through observable behaviors.

Distinction from Other UML Elements

In UML, actors are distinguished from classes primarily by their focus on external behavioral roles rather than internal structural modeling. A class defines the structure of objects within a , including attributes, operations, and relationships that encapsulate and for internal entities. In contrast, an represents a role played by an external entity—such as a user, hardware device, or another —that interacts with the subject but does not model its internal structure; actors lack attributes and operations, emphasizing only the behavioral interface at the system boundary. Unlike objects or instances, which are runtime realizations of classifiers with specific states, values, and lifecycles, actors do not represent instantiable entities or maintain state within the modeled system. An object is an instance specification that embodies a particular set of values for a classifier's features during execution. Actors, however, abstract roles without instantiation, serving solely to denote external participants in interactions like use cases, without attributes for state or behavior beyond association endpoints. Actors also differ from components, which are structural elements that encapsulate modular parts of a with provided and required interfaces for both internal and external interactions. Components focus on deployable units of , including realization of through ports and connectors. Actors, by comparison, are purely behavioral classifiers constrained to external contexts, without structural or interface specifications, highlighting only the in system-external collaborations. In the UML 2.5 metamodel, actors extend the Classifier metaclass but are specialized as a kind of BehavioredClassifier with constraints limiting their use to external roles; they inherit and association capabilities but are prohibited from owning internal features like methods or properties that apply to system-inherent elements. This metamodel positioning ensures actors remain boundary-focused, unlike classifiers such as classes or components that support internal modeling hierarchies. A key best practice in UML modeling is to reserve actors exclusively for defining system boundaries and external interactions, avoiding their use for internal entities; instead, internal roles or subsystems should be represented using stereotypes on classes, components, or other structural elements to maintain clear separation between external and internal concerns.
Add your contribution
Related Hubs
User Avatar
No comments yet.