Provider Interface Changes in Q3 2010
Motivation
It is often necessary to send additional data to the underlying data provider. This can be any form of meta-data that is not part of the appointments themselves. The interface defined by the original SchedulerProviderBase abstract base class did not provide any means of doing so. Side-channels, such as the Session, had to be used to transfer such meta-data.
We also chose to simplify the retrieving of resources and it now requires implementing one method instead of two.
The Q3 2010 version of RadScheduler introduces a number of important changes that aim to resolve these issues while maintaining full compatibility with existing implementations.
Changes to the provider interface
-
The GetAppointments, Insert, Update and Delete methods now have overloads that take ISchedulerInfo as first parameter instead of RadScheduler.
-
A new GetResources method replaces GetResourceTypes and GetResourcesByType. It also takes ISchedulerInfo as first parameter.
-
The legacy methods are no longer abstract. A runtime exception will be throw if you don't implement either the new or the old version of each method.
public abstract class SchedulerProviderBase : ProviderBase
{
// New methods
public virtual IEnumerable<Appointment> GetAppointments(ISchedulerInfo schedulerInfo);
public virtual void Insert(ISchedulerInfo schedulerInfo, Appointment appointmentToInsert);
public virtual void Update(ISchedulerInfo schedulerInfo, Appointment appointmentToUpdate);
public virtual void Delete(ISchedulerInfo schedulerInfo, Appointment appointmentToDelete);
// Replaces both GetResourceTypes and GetResourcesByType
public virtual IDictionary<ResourceType, IEnumerable<Resource>> GetResources(ISchedulerInfo schedulerInfo);
// No change - returns a thread-safe wrapper of this provider instance
public virtual SchedulerProviderBase Synchronized();
// Legacy methods - used to be abstract
public virtual IEnumerable<Appointment> GetAppointments(RadScheduler owner);
public virtual IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner);
public virtual IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType);
public virtual void Insert(RadScheduler owner, Appointment appointmentToInsert);
public virtual void Update(RadScheduler owner, Appointment appointmentToUpdate);
public virtual void Delete(RadScheduler owner, Appointment appointmentToDelete);
}
Upgrading existing providers
Your existing provider implementations will continue to work without change. The upgrade can be done if and when necessary.
-
Replace the "RadScheduler owner" parameter with "ISchedulerInfo schedulerInfo"
-
Merge GetResourceTypes and GetResourcesByType into a single method overriding GetResources