正在加载图片...
●●●●● ●●●● ●●● 代码中的集合类 ●●● ●●●● 一对多的关系非常常见,这些关系通常使用集 合( Collection)对象(例如List或Map)或者是 简单的数组来实现。 Sale public class Sale iS Complete: Boolean time: Date Time Saleslineltem lineltems private List lineltems new Array Listo become Complete 刻 quantity: Integer make Lineltemo make PaymentO getsubtotalo getT total A collection class is necessary to maintain attribute visibility to all the Saleslineltems代码中的集合类 ⚫ 一对多的关系非常常见,这些关系通常使用集 合(Collection)对象(例如List或Map)或者是 简单的数组来实现。 SalesLineItem quantity : Integer getSubtotal() 1..* Sale isComplete : Boolean time : DateTime becomeComplete() makeLineItem() makePayment() getTtotal() public class Sale { ... private List lineItems = new ArrayList(); } A collection class is necessary to maintain attribute visibility to all the SalesLineItems. lineItems
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有