Tag: 静态工厂

这是工厂方法创build模式?

现在我一直在使用工厂方法创build模式。 我刚刚才被告知这个: public static class ScheduleTypeFactory { public static IScheduleItem GetScheduleItem(ScheduleTypeEnum scheduleType) { IScheduleItem scheduleItem = null; switch (scheduleType) { case ScheduleTypeEnum.CableOnDemandScheduleTypeID: { scheduleItem = new VODScheduleItem(); break; } case ScheduleTypeEnum.BroadbandScheduleTypeID: { scheduleItem = new VODScheduleItem(); break; } case ScheduleTypeEnum.LinearCableScheduleTypeID: { scheduleItem = new LinearScheduleItem(); break; } case ScheduleTypeEnum.MobileLinearScheduleTypeID: { scheduleItem = new LinearScheduleItem(); break; […]