What is? UML Class diagram
- Class Diagram: Used to represent class 、 Interface 、 The static relationship between instances
- Although the name is class diagram , But there are not only classes in the class diagram
Memory skills
UML Arrow direction :
From child to parent
I Believe Many students will have the same idea as me , Think that subclasses are based on parent classes , The arrow should point from the parent class to the child class
So how do we remember ?
- Subclasses need to be defined through extends Keyword to specify the parent class
- The subclass must know the definition of the parent class , But the parent class doesn't know the definition of the subclass
- Only by knowing the definition of the other party can we point to the other party
- So the direction of the arrow is that the subclass points to the parent
The meaning of line
Solid line --> Inherit Dotted line --> Realization
- You can see Wild geese are a class An interface implemented It points to the interface Because the interface doesn't know the definition of geese
- Duck is the parent of Donald Duck is just a subclass So it points to the parent duck
How to remember ?
- The hollow triangle represents : To inherit or implement
- Realization - Inherit : is a The relationship between , Extended purpose , Don't empty , It's very strong
- Dotted line - Realization : The dotted line represents ‘ Need to be ’ No entity
Solid line --> relation Dotted line --> rely on
- The relationship is stable , A real relationship , Iron elder brothers
- Indicates that one class object is associated with another class object
- Usually, there is another class object in a class as an attribute
- You can see The emergence of penguins is related to the climate So they are related
- Dotted line --> rely on
- Use it temporarily , be neither friendly nor aloof , with no reality whatever , not much , if any
- Represents a usage relationship , One class needs to implement functions with the help of another class
- Generally, one class uses another class as a parameter , Or as a return value
The diamond
- A diamond is a vessel for holding things ( Plates, for example )
polymerization ∶ It means you can put a lot of the same things in an empty vessel , Get together ( The class indicated by the arrow direction )
Combine ∶ It represents the existence of physical structure in the full vessel , go through thick and thin together
The relationship between the whole and the part
Weak relationship
Negative words : weak - empty
The relationship between the whole and the part , Compared with the relationship of aggregation , The relationship is stronger, and they have the same life cycle ,contains-a The relationship between
A strong relationship
Positive words ∶ strong - full
UML Figure more related articles on memory skills
- 【UML】 How to see Android Of UML chart
UML There are many types of graphs , Here are just two of the most important and commonly used - Class diagram and sequence diagram . 1. Class diagram By class diagram , We can easily understand the code architecture , Clarify the relationship between modules , Including inheritance (Inheritance), Realization (realiz ...
- The illustration Android - How to see Android Of UML chart ?
How to see UML chart ? UML What can we bring ? This is the answer this article is looking for .UML There are many types of graphs , We will only discuss the two most important and commonly used - Class diagram and sequence diagram . 1. Class diagram By class diagram , We can easily understand the code architecture , Clear the mold ...
- [ Design patterns ] Read UML chart
The relationship between classes ( From strong to weak ) realize( Inherit ): Triangle + Solid line ( Pointing class ), Inheritance class (SUV It's a kind of car ) generalization( Realization ): Triangle + Dotted line ( Point to interface ), Implementation interface ( A car is a kind of car ) composi ...
- UML Several relationship legends are often used in diagrams
It's strange to learn this thing , It's easy to forget after a long time , Or I can't remember . Today I saw some UML The relationship between graphs , There's something wrong with it , Just write it down , Come and have a look when you forget later . stay UML In the class diagram of , There are several common relationships : Inherit (Gener ...
- use rose draw UML chart ( Use case diagram , Activity diagrams )
use rose draw UML chart ( Use case diagram , Activity diagrams ) First , install rose2003, Computer from win8 Rise to win10 in the future , Find out win10 Does not support rose2003 Installation , Changed rose2007 in the future , You can't find it . The solution : ...
- 【 turn 】UML The relationship between graph and software development process
First , Software engineering documents , Software engineering documents , That's the plan , Design , describe , Use some files of the software , Its biggest feature is that it is fixed , For different people and computers to read . During , Documents serve as bridges , This picture is very vivid : Let's take a look at the unified national regulations ...
- Chapter one :Retrofit Main categories UML chart
2016-05-06 16:07:09 1. Take the last one Retrofit The code structure diagram of : You can see ,Retrofit Its structure is very simple , The amount of code is not very large . In the red box are some annotation classes , Just some markers . Take a simple look at the guest ...
- [zt]Singleton and Double-Checked Locking Design patterns —UML Diagram and code implementation
Singleton and Double-Checked Locking Design patterns , It refers to singleton mode and double check lock mode respectively , They can all be used to ensure that only one object is instantiated in a class . The difference between the two modes is :Singleton Mode use ...
- Eclipse Automatic generation UML chart ( Reprint )
*ModelGoon What is it? ? It's a Eclipse plug-in unit , Used based on UML Model design of graph , And reverse engineering ( That is, generate class diagrams from existing source code , For code analysis or documentation ). * Applicable conditions ModelGoon The latest version ...
- Use PHP_UML Generating code UML chart
When reading someone else's code , In the absence of detailed documentation , How to quickly see the structure of the whole code ( Class structure ), It has become a real problem . Today I will introduce one , Automatic generation UML Graph method . hypothesis , I have a project folder :laruen ...
Random recommendation
- A carriage return (CR) With line breaks (LF), '\r' and '\n' The difference between
enter ”(Carriage Return) and “ Line break ”(Line Feed) The origin and difference of these two concepts . Before computers came along , There is a type called teletypewriter (Teletype Model 33,Linux/Unix Next ...
- 161215、MySQL See table structure simple command
One . Simply describe the table structure , Field type desc tabl_name; Display table structure , Field type , Primary key , Whether it is empty or not , But don't show foreign keys . Two . Query the comment information of the columns in the table select * from information_sche ...
- ComboGrid Click inside the line to edit the content
lately easyui You need to edit the selected item in the row , But the edited content shows the currently selected column value , And others , More trouble , Let's take a look at this code columns: [[ { field: 'GuestID', title: ' Number ', ...
- One day JavaScript Example - determine web Area of the page
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- windows service and process The relationship between
1. Inquire about windows Corresponding services sc query > 1.txt notepad 1.txt 2. Query the corresponding process information tasklist /m > tasks.txt notepad t ...
- Javascript Create classes and objects
Now to summarize Javascript Several ways to create classes and objects : 1. The original creation method : <script type="text/javascript"> var person = ...
- Configuration and use dwr Finish receiving email tips
DWR(Direct Web Remoting) It's one for improving web The page with Java The remote server side of class interaction Ajax Open source framework , Can help developers develop include AJAX Technology website . It allows code in the browser to run in ...
- Java Analysis of atomic operation principle
◆CAS The concept of ◆ For concurrency control , Using locks is a pessimistic strategy . It always assumes that every request has a conflict , If multiple threads request the same resource , The use of locks would rather sacrifice performance to ensure thread safety . And no lock is a more optimistic view of the problem , It assumes ...
- ajax The return data is defined as a global variable
var result; // Define global variables $(document).ready(function(){ $.ajax({ type:'PO ...
- Java Basics - Common tools ( One )
object class Object Class is the parent of all classes , If a class is not explicitly used EXPENTS Keyword explicitly identifies inheriting another class , So this class inherits by default object class ,oject Methods in a class are suitable for all subclasses 1)toStri ...