I am working on a scenario, where I have a list of orders.
Order DTO:
public class Order{
private int orderId;
private String orderType;
private String orderingSystem;
... GETTER & SETTERS
}
- orderTypes can have
NEW,EXCHANGE,RETURN
possible values. - orderingSystem can have
INTERNAL_SYSTEM, EXTERNAL_SYSTEM
possible values.
Based on the orderType & orderingSystem I have to process every order.
Common business to be applied on every order:
- Order validation.
- Order Enrichment
- Execute ordering algorithm(will vary on the orderType & orderingSystem).
- Finally persist the list of processed orders into DB.
Possible combinations can be
- NEW order with INTERNAL_SYSTEM
- NEW order with EXTERNAL_SYSTEM
- EXCHANGE order with INTERNAL_SYSTEM
- EXCHANGE order with EXTERNAL_SYSTEM
& so on..
How can I design my application to accommodate each and every possible combination?
Aucun commentaire:
Enregistrer un commentaire