سؤال

The scenario is to have a Mobile App and Web App too.

So currently I can think of two scenarios

enter image description here

Which one do you guys think is better?

PS : If needed I can also implement DAL Layer in both the cases in between DB and Business Layer.

Edit 1 : I must mention here that, the functionality of the Mobile App is identical to that of the Web App. Actually the Mobile App is intended to expose few of the functionalities so that user can use the software on the go.

Edit 2 : Architectural wise, I prefer the first one, because the Mobile App will be a Hybrid Mobile App. So whatever I'll develop for the web, I can compile the same thing in Cordova and publish with minimal changes for the native device specific api (such as Camera).

هل كانت مفيدة؟

المحلول

I would go this way:

enter image description here

This uses a service to expose all of the bussiness functionality. Then, your MVC app could grab all the data returned from a service a create a View with it, while the API would use the same service to return JSON/XML.

Your MVC app and you API would then have the same funcionality and you mobile app could grab whatever info is needed from the API.

This avoids code duplication and is in my opinion a good way to structure your code, also, there's the benefit that your web app will not have to do calls to your API and performance will be better.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى softwareengineering.stackexchange
scroll top