Download presentation
Presentation is loading. Please wait.
1
Package Diagram
2
Knowledge Graph
3
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
4
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
5
What is the Package In the perspective of object-oriented software development, the Class is obviously the basic building block of the whole system. But for large-scale systems, there are hundreds of Class, coupled with associations, multiplicity, etc., and it must be greatly beyond the people’s capacity due to the complexity. So, we introduce the concept of "package" to group the building blocks. The function of the package: 1)Group the elements that are related semantically (语义相关); 2)Define the “semantic boundary (语义边界)” in the model; 3)Provide configuration management unit; 4)Provide parallel operation units at the time of design; 5) Provide encapsulated namespaces where all names must be unique.
6
The Representation of the Package
Name: Each package must have a name which should be distinguished from other packages. Element:There are various elements in the package,including classes, interfaces, components, nodes, collaboration, use cases, and even other packages or graphs.
7
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
8
Reading the Package Diagram
The visibility of the package:the symbol“+” can represent “public”,the symbol“#” can represent “protected”,and the symbol “-” can represent“private”
9
The Dependency Types between Packages
《use》:This is a default dependency type between packages, indicating that the client packages (originator) use the public element provided by the provider packages (the packages pointed to by the arrow) in some way, that is the client package depends on the provider package. 《import》:This is a general dependency type between package, indicating that the provider's package namespace will be added to the client's package's namespace, and the elements in the client package will also be able to call all the public elements in the provider package.
10
The Dependency Types between Packages
《access》:This dependency type can only use the elements in the provider packages, but not merge the namespaces. 《trace》:This dependency type represent the development history of one package that evolve into another package.
11
The Reading Results of the Package
Firstly, we can find the Client Package use the Server Package according to the dependency type of 《use》,Server Package use the System.Data.SqlClient Package. Comparing the elements, we can find that the Client takes charge of the input of the Order,and manages the LoggingService and DataBase through the Server. Also, the Server Package can implement the real interaction with the database by the tool of SQL Server in .NET. Secondly, as for the dependencies of 《import》, we can find the Rule takes charge of handing the rules according to the namespace of the package and the elements as well as call a specific Window,while the Client Package can implement the exhibition and the input by calling Rule and also store the information of Order.
12
The Reading Results of the Package
Finally, as for the generalization between packages,we can find GUI has two specific implementations, one is WindowsGUI for C/S architecture, the other is the WebGUI for B/S 。
13
The Stereotype of the Package
《system》and《subsystem》:《system》represents the whole modeling system,while the《subsystem》represents a separate part of the modeling system. 《façade》:It is a view of another packages and it provides simple view of other complex packages. 《stub》:It is an agent package,which works for the common contents for other packages. Usually, it applied in the distributed system for modeling. 《framework》:It can represent a framework which is a application system in a domain and provide an extensive templates for architectural models.
14
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
15
The Principle of Drawing Package Diagram
Minimizing the dependencies between packages; Minimizing the number of public、protected elements in every package; Maximizing the private elements in every package. There aren’t cycle dependencies between the packages, that is to say there aren’t interdependencies situation. As for this issue, we should analyze as follows:
16
Finding the Packages The workflow of the system analysis: 1) Connecting to the stock information server through the Internet, so as to get real-time stock information, and store in the database. 2)Finding the appropriate information in the dataset according to the user’s input and display them on the screen. 3)Drawing large number of graphs during the presentation of the data. Organize the Packages according to the function modules: Packages Analysis and Function .NET Supporting Package SocketClient 负责连接Internet服务器,获取实时股票信息 System.Net.Sockets DataAccess 负责从数据库读写实时股票信息 System.Data.Sqlclient UI 负责响应用户输入和选择,并展现信息 System.Windows.Forms GraphicGenerate 负责根据数据库的信息生成相应的图表 System.Drawing
17
Determining the Dependencies between Packages
18
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
19
Modeling group elements
Each package should contain the elements that are similar in concepts and semantics; Finding out the pubic elements for each package, as small as possible ; Generally, we use the 《use》stereotype,and consider 《import》when mapping to the programming; Considering generalization to model special packages; In the presentation of the model, we should only pay attention to the elements which have core roles in the packages and identify tag values in each package document to make it more clear.
20
Modeling the Architecture
Modeling the architecture is a more meaningful use of the package. The architecture is the core logical structure of a software system. The architecture patterns used commonly include hierarchical, MVC, pipes, black boards, micro-kernel, etc., and hierarchical and MVC in application software.
21
Agenda What is the package? How to read the package diagram? How to draw the package diagram? The introduction of package diagram application Summary
22
Summary First, we point out the shortcomings of the class diagram in the modeling of large-scale systems: the lack of effective organization, and then introduce the concept of "package”. After explaining several common representations of the packages, a simple example is used to illustrate the concept of packet visibility, dependency, generalization, etc. The architectures of the five packages are briefly described. Describing how to find and determine the dependencies between the packages so as to draw a package to show the fundamental structure of the software. We briefly introduce the modeling methods of system architecture.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.