【发布时间】:2015-12-15 03:41:01
【问题描述】:
你能告诉我我的图表是否正确吗?
我特别关心PaymentService和Customer之间的关系,
Payment, Customer
我猜:
class Customer {
private List<Payment> payments;
//..
public boolean pay() {
return PaymentService.pay(this.payments);
// calling the static method of the class PaymentService
}
}
interface Payment {
// knows nothing about Customer
}
class PaymentService {
public static boolean pay (List<ayment> payments) {
// the magic here is return result
}
}
UPD:现在,我注意到为什么我使用静态成员,但这并没有触及我的问题。
构建支付系统的常用方法是什么(看起来像是一般任务)?
我猜 FFCustomer 应该只有一个帐户。 只有当 FFCustomer 存在时,帐户才会存在。
【问题讨论】:
标签: class associations uml diagram