I have 2 classes which are derived from an abstract class
abstract class Order
{
public virtual boolean Export()
{
...
}
}
class TradeOrder : Order
{
public override bool Export()
{
//Create a new order
}
}
class LibraryOrder : Order
{
public override bool Export()
{
//Dont create order but Update an existing order
}
}
TradeOrder is created for customertype "Trade" and LibraryOrder is created for customertype "Library".
The customer type will grow in near future.
How do I create instance of the derived class based on the customer type without using if...else or swicth ...case?
The instance of the class will call the export method to either create or update a sales order.
-Alan-