In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to use the UML class diagram of Pycharm extension functions", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the UML class diagram of how to use Pycharm extensions.
1. What is UML
UML class diagrams can quickly check the structure of the code.
2. Theme
The use of UML class diagrams in Pycharm.
3. Preparatory work
(1) Pycharm version 2.7 or higher
(2) install Python interpreter
(3) UML plug-in and UML class diagram plug-in are installed and can be used normally
4. Prepare an example
Create an Animals module and a Mammal.py file (Alt+Insert → Python Package, Python File), and enter the following code:
Continue to add more classes to it, such as Carnivore and Herbivore.
5. Browse the program structure through UML class diagram
Suppose we want to view the derived structure of mammals, in the Project tool window window, right-click Mammal.py, point to the Diagrams node in the shortcut menu, and select the following available commands:
(1) Show Diagram: open the UML class diagram in the current editing tab
(2) Show Diagram Popup: display the UML class diagram in a separate window
Select a class in mammals (for example, marsupials) and view it with the UML class diagram:
You can also use the shortcut keys Ctrl+Alt+U (current window) or Ctrl+Alt+Shift+ U (stand-alone window).
Click the and buttons to view details:
You can also use the shortcut menu:
For more toolbars and shortcut menu functions, see the Class Diagram Toolbar and Context Menu page.
Next, add comments to it. Select the element you want to comment and press Alt+Insert:
Enter and enter the comments:
Click OK, and the comments are added:
6. Structure diagram and navigation between source code
How do I jump from the structure diagram to the source location of the response?
Select a node element in the structure diagram and press F4 or right-click the shortcut menu to select the Jump to Source command:
7. The function of UML structure diagram
8. Find all references
Select a node element in the structure diagram, right-click, select Find Usages from the shortcut menu, or use the Alt+F7 shortcut key:
9. Reconstruct
Classes or members can be refactored (renamed, etc.) directly in the class diagram.
Right-click the node to be modified in the class diagram, point to the Refactor command, and select the corresponding command in the submenu.
For example, if you want to rename a class, select it in the class diagram and choose the Refactor → Rename shortcut menu command or press Shift+F6:
10. Add elements to the model
Press Space and enter the type and name in the pop-up window:
Add Carnivore:
Next, manually create more classes, such as Carnivore or Herbivore, and specify the mammal type. For example, Cow inherits Herbivore and Eutherian. Tiger inherits Carnovire and Eutherian. Duckbill inherits Herbivore and Marsupial,TasmanianDevil inherits Carnivore and Marsupial:
Press Space to add these classes to the class diagram:
Click the button to optimize the display style:
11. Remove elements from the class diagram
Select an element in the class diagram, Delete:
At this point, the deleted class still exists in the source code, but is not visible in the class diagram:
12. Browse the code changes through the class diagram
It is recommended to use Ctrl+Alt+Shift+D shortcuts, or buttons.
At this point, I believe you have a deeper understanding of "how to use the UML class diagram of Pycharm extensions". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.