I'm trying to design a web-application - and after doing a lot of reading on REST + design patterns, I'm at a loss on how to handle my requirements. I think I may be getting caught-up in all the design-patterns, but at the same time want to produce a well-architect-ed design.
I have 2 major business-objects,
Order, with a Has Many relationship. Currently, I have no service layer, and the REST API is in the BL:
GET Customers GET Orders GET Customers/id GET Orders/id POST Customers POST Orders PUT Customers/id PUT Orders/id DELETE Customers/id DELETE Orders/id
But things become hard to design when I have to architect for legacy means of user-data input, and well as for the future:
- Now: Users upload an Excel .xlsx file containing Customer, Order information, which I parse, extract, create
Orderbusiness-objects for, and perform validations. In order to have a pleasant User-experience, I don't save these objects right away, I return them to the User (along with any errors from the verifications) so they may make any needed changes before finally submitting them. (this 2-step submission just adverts the requirement of correcting sources of any validation errors directly in the Excel file).
- Future: Customer/Order data will be maintained, and uploaded, through a web service/platform.
I don't know how to handle these requirements gracefully, and intelligently. Is this a case where I need to expose a Service Layer that publishes an interface for the soon-to-be-legacy Excel-upload, as well as an interface for the web service?
Any design help would be appreciated, as I'm rather new to this type of development and rather not make a major architectural mistake that will come back to bite me later..
Thanks in advance.
edited as comments suggest