I'm trying to improve my overall coding skills and also improve our codebase for the shipping integration system. I want IShippingProcesses to implement one of the ShippingProviders but I can't make the T an Enum member, and I don't want to implement it as an integer. I'm pretty sure this is bad design overall. I'm not experienced in generic types or the IoC.
//Interface
public interface IShippingProcesses<T> where T : new()
{
void DispatchOrder();
void CancelDispatch();
}
//Implementation
class MNGShippingProcesses : IShippingProcesses<>
{
public void DispatchOrder()
{
//implementation
}
public void CancelDispatch()
{
//implementation
}
}
//Shipping Companies
public enum ShippingProviders
{
UPSKargo,
MNGKargo,
ArasKargo
}