0

好的,让我们看看下面的场景:

我有两节课。时间表和事件。

一个时间表有许多事件。这很简单。

那么,对于获取所有事件,我应该将 getAllEvents 方法留在哪里?安排课程或活动课程?最佳实践?

谢谢。

4

1 回答 1

5

If you'd like to get all events for a given schedule, define a method called getAllEvents() in the Schedule object.

If you'd like to get all events - globally, across all schedules - I would encourage you to create an EventCollection object, and add all events to it - besides registering them in the respective Schedule.

于 2013-03-13T23:57:18.170 回答