I have multiple services each service calls database and fetch some data based on some criteria. For example;
StateService fetch state based on id from database
BusinessLineService fetch business object
There are couple more like this.
Now for single page I need data from these services. I am not sure where should I call these methods? I was thinking to do that in my controller. But then I have a scenario where I have to actually fetch data from two services and merge them. Not sure what should be the way. Can any one guide me on this? Thanks.
When you say services, are they deployed and hosted separately? If they are deployed and hosted separately from the web application, i believe more importantly, it will lead to chatty interfaces. But to address your concern, you need to have a facade/Service agent in your web application that does the calls and wraps the resulting data into a single class and returns it.