My manager has asked me to "just wrap the stored procedure".
The requirements are to create a microservice that will do the following:
- Accept parameters from the user.
- Pass those parameters to the stored procedure.
- Return to the client the resultset of the stored procedure.
In the beginning of my career this was definitely my approach: tightly coupling everything, hardcoding, no abstractions, etc.
The requirements that I have been given, are to do just this.
Is it possible to tightly-couple several layers, yet still maintain a level of abstraction?
To give slightly more context, the flow is as follows:
Accept user input through an ApiController:
public class MyController : ApiController
{
public ResponseObject Get ( RequestObject request )
{
string sql = GenerateSql(request);
ResponseObject response = ExecuteSql (sql);
return response;
}
}
What's tightly coupled here?
- If the stored procedure changes, then the RequestObject needs to change.
- If the stored procedure changes, then the ResponseObject needs to change.
- If the stored procedure changes, then GenerateSql logic will need to change.
- etc
Can I still implement robust design here, given that the time-constraints reflect that everything needs to be hard-coded?