UML Common Diagram-class diagram, use case diagram, sequence diagram (sequential diagram), collaboration diagram (communication diagram), state diagram, activity diagram __JAVA/J2EE

Source: Internet
Author: User

Choose a few UML common diagram, tidy up, convenient for their own inquiries

Most of them are due to the designer exam, the examination is not dedicated to the use of spray;

Class diagram example Class Diagrams:
Implementation: Class implementation interface, [performance] Implements
Generalization: Class inheritance class, [performance] extends
Combination: A special relationship, which is the relationship between the whole and the part, the part with the whole life cycle, [performance] member variable
Aggregation: A special relationship is the relationship between the whole and the part, partly with the whole life cycle, [performance] Member Variable Association: One class knows the behavior of another class (method), [performance] member variable
Dependencies: The implementation of a class requires assistance from another class, [performance] local variables, method parameters, or calls to static methods

Relationship Strength:
generalization = implementation > combination > Aggregation > Association > Dependency

Example Description:
1. Vehicle and aircraft to achieve the interface of vehicles
2. Engine assembled into cars, car radios converged into cars
3. Taxis are inherited from automobiles
4. The taxi and the driver are many to many two-way correlation relations, the driver one-way correlation driving licence (one driver holds a driving licence)
5. Drivers rely on onboard WiFi


Use case diagram example

Use case diagram:

Participant: External contributor (user/Other System)

Use cases: Features

Include relationship: One use case contains another use case (essential)

Expanding relationships: A use case exists to extend another use case (icing on the cake)

Inheritance relationship: A use case inherits from a use case

Dependencies: One use case relies on another use case

--------------------------------------------static diagram End---------------------------------------------------

Static view: Use case diagram, deployment diagram, Class diagram, object graph

Dynamic view: Sequence diagram, collaboration diagram, statechart diagram, activity diagram

Start--------------------------------------------dynamic Diagram---------------------------------------------------



Sequence diagram example

Timeline diagram:

Objects: Instances of classes

Focus: Execution of object operations

Sync message (Black solid arrow): Waiting for response

Asynchronous message (sharp-angle arrows): No need to wait for response

Return message: Action response

Example Description:

1. The user sends a synchronous login message to the controller (the login method that invokes the controller)

2. The controller first checks the user information (query db or session), after the successful match sends an information request to the account

3. The account receives the request, returns an account information, the controller returns to the user

4. The controller sends itself an asynchronous user logged in message (Save session information)




Communication diagram Example

The sequence diagram and the collaboration diagram can transform each other! This graph is from the above sequence diagram;




Status Diagram example

State diagram:

Super state: Parent state of State

Events: Firing State transitions

Actions: State transitions accompanied by behavior

Guardianship condition: satisfies the condition state to be able to convert

Example Description: (Suppose to be a coffee machine)

1. Turn on the switch, the power-on light, the status of On::ready

2. Press the Make button to judge the guardianship conditions: whether there is water with coffee powder, to meet the working status, work lights

3. Finished, ready to light, the state converted to ready

4. Press the Close button, the light goes off in the off state


Activity diagram Example

Activity diagram

is similar to a flowchart, but it's different:

1. The activity diagram focuses on the sequence of object activity and shows the system behavior; The flow chart focuses on the control structure and the performance process;

2. Activity diagram object oriented, flow chart oriented process;

3. Activity diagrams can represent concurrent activities;


Finally, summarize the drawings not drawn:

Object graph: Instance snapshots of system classes, graphical elements of similar graphs

Deployment diagram: A physical-related diagram related to a component diagram;


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.