gpt4 book ai didi

java - 必须使用什么 UML 元素才能在类图上显示 JPMS 模块?

转载 作者:行者123 更新时间:2023-11-30 06:45:55 25 4
gpt4 key购买 nike

我试图在我的 UML 类图上显示两个 JPMS 模块以及它们内部的包和类。问题是我无法理解使用什么元素来显示模块。请帮忙。

最佳答案

在 UML 中:

组件

:见reference 1

Package is a namespace used to group together elements that are semantically related and might change together. It is a general purpose mechanism to organize elements into groups to provide better structure for system model.

reference 2 中:

Pretty much all UML elements can be grouped into packages. Thus, classes, objects, use cases, components, nodes, node instances etc. can all be organized as packages, thus enabling a manageable organization of the myriad elements that a real-world UML model entails.

组件:参见reference 3

A component is a class representing a modular part of a system with encapsulated content and whose manifestation is replaceable within its environment.

A component has its behavior defined in terms of provided interfaces and required interfaces (potentially exposed via ports).

Component serves as a type whose conformance is defined by these provided and required interfaces (encompassing both their static as well as dynamic semantics). One component may therefore be substituted by another only if the two are type conformant.


在 Java 9 中:

引用:书籍:Java 9 Modularity Revealed,Alexandru Jecan,2017 年,第 5 页

模块的特点:

Some of the characteristics of a module include the following:

  • A module must define interfaces for communication with other modules.
  • A module defines a separation between the module interface and the module implementation.
  • A module should present a set of properties that contain information.
  • Two or more modules can be nested together.
  • A module should have a clear, defined responsibility. Each function should be implemented by only one module.
  • A module must be able to be tested independently from other modules.
  • An error in a module should not propagate to other modules.


因此:
Java 9 JPMS 模块应由 UML 组件显示。我们不能使用 UML 包来建模 Java 9 模块。 UML 包用于对 Java 包建模。众所周知,Java 9 的包和模块之间存在巨大差异。

关于java - 必须使用什么 UML 元素才能在类图上显示 JPMS 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48258875/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com