在 Java 代码中代表此 class 图的是什么?
What is represents this class diagram in Java code?
在 Java 代码中代表这个图表的是什么?
此外,修饰符有默认值吗
或者这取决于语言(Java - 包,C++ - 私有)?
现在,我猜是这样,但不知道{disjoint, complete}的含义:
class PaymentService {
private List<Payment>;
}
class Payment {
private int amount; // f.e. int
private PaymentService unnamedPaymentService;
private Customer unnamedCustomer;
}
class Customer {
private List<Payment>;
}
class MileagePayment extends Payment {
// and so on
}
图表和 java 代码相当吻合。
图中没有关于修饰符的信息,没有任何暗示隐私或数据封装的信息。
{disjoint}表示只能是其中之一。例如,您不能拥有同时也是里程支付实例的现金支付实例。在逆向工程方面我不会太担心它。
在 Java 代码中代表这个图表的是什么?
此外,修饰符有默认值吗 或者这取决于语言(Java - 包,C++ - 私有)?
现在,我猜是这样,但不知道{disjoint, complete}的含义:
class PaymentService {
private List<Payment>;
}
class Payment {
private int amount; // f.e. int
private PaymentService unnamedPaymentService;
private Customer unnamedCustomer;
}
class Customer {
private List<Payment>;
}
class MileagePayment extends Payment {
// and so on
}
图表和 java 代码相当吻合。
图中没有关于修饰符的信息,没有任何暗示隐私或数据封装的信息。
{disjoint}表示只能是其中之一。例如,您不能拥有同时也是里程支付实例的现金支付实例。在逆向工程方面我不会太担心它。