A use-case diagram is a collection of actors, use-cases, and the communications between them., Actors, Actors are people or other users of the system, An actor is a role that people or objects play in the system., An actor is the thing or person that initiates the events involved in a task, the summary of scenarios for which task comprise one use case., In a use-case diagram, actors are represented by stick figures., A use case is a summary of scenarios for a single task or goal, A scenario is an example of what happens when someone uses the system., In a UML use-case diagram, a use-case is depicted as an oval., The connection between an actor and a use case is called a "communication association" or just a communication.
A UML use-case diagram describes what the system does from perspective of outside observer
The emphasis in a UML use-case diagram is on what the system does, rather than how it does it.
Helpfulness, UML use-case diagrams are helpful in determining features (a.k.a. requirements) of an application., UML use-case diagrams are helpful for communicating with Clients, UML use-case diagrams are helpful for generating Test Cases
A UML use-case diagram describes relationships and dependencies between a group of "use cases" and the actors participating in the process.
rules, Each use case is related to at least one actor., Each use case has one initiating actor., Each use case leads to a relevant result, i.e. a result with business value.
A UML class diagram gives an overview of the system by indicating all its classes and the relations between them.
UML Class diagrams are static, not dynamic.
A UML class diagram displays what interacts, but not what happens when that interaction occurs.
In UML, a class diagram consists of representations of classes, associations, and multiplicities, Drawing Classes in UML, In UML, classes are notated as a rectangle divided into three vertically-stacked segments., name, Attributes, Operations, In UML, the names of abstract classes are in italics., In UML, relationships among classes are displayed as connecting links., In UML, the ends of the connecting link may be notated with a role name, The role clarifies the nature of the relationship represented by the connecting link, The role is what in real life the object represents, In UML, a navigation arrow on the connecting link indicates a direction in which the link can be traversed or queried., The arrow points away from the object that knows about the object toward which the arrow points, The object away from which the arrow points is said to "have" or to "own" the object toward which the arrow points., A bidirectional link has no arrows., In UML, relationships can be either associations or generalizations, Association, An association is a relationship between instances of two classes., There is an association between two classes if one class must know about the other in order to do its work., An aggregation is a particular type of association, in which one class belongs to a collection., In UML, an aggregation is notated by putting a diamond on the end of the link connected to the part containing the whole., Generalization, A generalization is an inheritance relationship between two object classes., A generalization link in a UML class diagram indicates that one class is a superclass of the other class., A generalization is notated by a link with a triangle pointing toward the superclass, A relationship is said to have a "multiplicity,", A multiplicity is a number that indicates the number of instances on one end of the relationship that can be related to one instance on the other end of the link., A multiplicity can be a single number or a range., 0..* indicates that there can be any number of instances, 1..0 indicates "at least one instance"
In complex class diagrams, classes are grouped into packages, All the elements in a UML package are logically related., In UML, a package is represented as a rectangle with a square on the leftmost side of the rectangle's top edge., In UML, a package in drawn with its name in the rectangle, In UML, one package is said to depend on another package if changes in the other package could possibly force changes in the one.
A UML object diagram is similar to a class diagram, except that an object diagram displays instances instead of classes.
In UML, the name of an instance and the name of the class, separated by a colon and underlined appears in the rectangle.
UML permits the omission of an instance or class name if the meaning is clear from the diagram.
Utility of UML object diagrams, UML object diagrams are useful for explaining small pieces with complicated relationships, UML object diagrams are especially good for explaining recursive relationships
A sequence diagram shows how objects collaborate
A sequence diagram details how operations are carried out., A UML sequence diagram shows objects and a sequence of message calls they make to other objects., Sequence Diagrams show the message exchange (i.e. method call) between several Objects in a specific time-delimited situation., Sequence Diagrams put special emphasis in the order and the times in which the messages to the objects are sent., A sequence diagram shows what messages are sent, and when., Like a collaboration diagram, a UML sequence diagram is an interaction diagram, Sequence diagrams are dynamic, as opposed to class and object diagrams which are static., A UML sequence diagram differs from a collaboration diagram is that it focules on the times at which messages are sent, rather than on the object roles., Sequence diagrams clearly show the time flow of method or function calls between modules, sequence diagrams help with complex call stacks just as data model diagrams help with complex database schema
How to draw, Sequence diagrams are organized according to time, In a UML sequence diagram, lower on the page indicates later in time., In a UML sequence diagram, objects involved in an operation are shown from left to right in the order in which they take part in a message sequence., In a UML sequence diagram, dotted vertical lines called "lifelines" represent the time that an object exists., A lifeline is drawn with an activation bar., The activation bar represents the duration of the execution of a message., In a UML sequence diagram, rightward-facing arrows represent message calls., The arrow leads away from the object that sends the message., The arrow points toward the top of he activation bar of the message receiver, Conditions appear in square brackets, Iterations are indicated with asterisks.
Comparison of UML collaboration diagrams with UML sequence diagrams., UML collaboration diagrams convey the same information as sequence diagrams., Like UML sequence diagrams, UML collaboration diagrams are also interaction diagrams., Collaboration diagrams differ from sequence diagrams in that they focus on object roles instead of the times that messages are sent.
How to draw a UML collaboration diagram:, In a UML collaboration diagram, object roles are drawn as rectangles labeled with the class names, object names, or both separated by a colon., In a UML collaboration model, the links connecting the object roles are messages., Each message in a collaboration diagram has a sequence number., The top-level message is sequence number 1., Messages sent during the same call are at the same level., Messages at the same level have sequence numbers that start with the same prefix and a dot.
UML collaboration diagrams show objects and their relationships, with emphasis on the objects that participate in the message exchange.
UML statechart diagrams or "state" diagrams show the possible states of objects., UML statechart diagrams show events and transitions that causes changes in an object's state., Unlike an activity diagram, which shows the flow of activities involved in a single process, a UML statechart diagram, shows either an object undergoing a process, or a process as an object.
How to draw a UML statechart diagram, In UML, a state is drawn as a rectangle with ronded corners., In UML, transitions are arrows connecting one state to another., "Events or conditions" that trigger the transition are written next to the arrows., The name of the action that occurs as a result of an "event or condition" is written preceded by a slash., Initial and final states are "dummy" states, represented by small black circles.
All objects have an enumerated set of states., Every object is always in one of its finite set of states., An object's state changes is reaction to one of a finite set of stimili., There are two special states in every object's state set: "start" and "end." The "start" state can never be entered after it is initially left, and the end state is always the final state., The names of states usually end in "ing," or may be "stopped" or "ready.", listening for connection, validating login data, getting password
A UML activity diagram shows how activities involved in a single process are dependent on one another., Unlike a statechart diagram, which shows either an object undergoing a process or a process as an object, a UML activity diagram shows the flow of activities involved in a single process., A UML activity diagram is little more than a glorified flowchart.
Drawing a UML activity diagram, In a UML activity diagram, activities are drawn as rounded rectangles., emerging from each activity rectangle is a single transition that leads to the next activity., A single transition may branch into two or more exclusive transitions., The transitions coming out of a branch are labeled with "guard expressions" within square brackets., A "merge" marks the end of a branch., In a UML activity diagram, branches and merges are drawn as large diamonds., A transition may fork into one or more parallel activities., A "join" marks the end of a fork., In a UML activity diagram, forks and joins are drawn as solid bars., UML Activity Diagrams are divided into "swim lanes.", Swimlanes determine which object is responsible for which activity
One Activity is one state in the system with internal activity and, at least, one outgoing transition., Activities can also have more than one outgoing transition if they have different conditions., Activities can form hierarchies, An Activity can be composed of several “detail” Activities., Where an Activity is composed of several “detail” Activities, the incoming and outgoing transitions should match the incoming and outgoing transitions of the detail diagram
A UML component diagram is a physical analog of a class diagram.
A component is a code module.
A UML component diagram shows high-level programming components.
A UML deployment diagram show the physical configuration of hardware and software.
The physical hardware is made up of "nodes."
Each component code module belongs on a node.
A UML deployment diagram shows instances of the components and their relationships
Attributes (state), An object's state depends on the object's current condition or activity, An object may be in a "validating" state., When an object is in a validating state, it performs an activity without waiting for an outside event to trigger a transition., The result of that activity determines the object's subsequent state.