Last post May 14, 2019 10:38 AM by DA924
May 12, 2019 02:58 PM|alex.kvitchasty|LINK
I have a question but I can't find answer anywhere, maybe you can help me.
I have a 3 tier architecture and now I need to add integration with warehouse system. I created integration and now I can use it like:
var provider = IntegrationFactory.GetDataProvider("integration name");
var integrationOrders = await provider.Orders.GetAllAsync();
What a problem - I have a service layer that usually works with my DAL like CRUD operation and filling DTO Models. I have to create Method that will SYNC my Orders for example with Warehouse Orders - Let's call this method like "SyncWarehouseOrders" where
I'll get all orders from the Warehouse side and Sync them with orders from my database, so I don't really understand is it possible to keep this method in my OrderService that I use for working with DAL ? Or it will break SRP principle...
If I create specific service for WarehouseOrders I'll should keep logic where I can get Orders from My DB and sync it with Warehouse. But anyway I will need DAL layer too when I want to SyncWarehouseOrders...
And such Methods Like if I need to send a specific order to Warehouse? For example I can get order by id from my database and I need to send it to my Warehouse provider like provider.Orders.Create(orderFromMyDatabase).
Can I still have it inside my OrderService like "SendOrderToWarehouse" ? Thanks in advance.
May 14, 2019 10:38 AM|DA924|LINK
Myself, I don't see why you can't have a WarehouseOrder service. I don't see why the WarehouseOrder service can't call upon the classes in the OrderService or vice versa. Some of the purposes of a DTO is to shape data, send data to other processes and decouple