We are designing a system that has functionality that is essentially the same at the presentation layer and the exposed API layer. My question is what technique / strategy to use so we can get the most reuse out of our code with performance in mind?
Here’s a simplified example:
A user can add a Customer via a web form. This will fire the Customer.Create() method.
An API consumer / user can add a Customer via a SOAP / HTTP-POST to a web service which will call the Customer.Create() method.
Imagine these layers:
PRESENTATION
|
|
WEB SERVICE API (Customer.Create() is available here
|
|
FACADE Business Object Interface - Customer.Create() signature is here
|
|
BUSINESS Business object - Customer.Create method() is fleshed out here
|
|
DATA ACCESS - Writes data
The presentation layer SOAP calls the Create() web method, which calls the facade’s Create() method which calls the business object’s Create() method which wires via the data access layer.
Questions:
Is there a concern about performance in using the API’s web services in our presentation layer, or are there alternatives to connect the presentation layer directly to the facade? If so, what technology to use (WCF, Remoting, Web Services, etc)?
Please let me know if you need any more clarification. I am having trouble finding out if it is common to consume your API in a presentation layer, or do you “go around it” for performance reasons.
Any other concerns that I may not be seeing?
Thanks!
Have a look at this question and answers given (one mine):
WCF and n-tier architecture and serialization performance
I think your tiers are fine if they are all logical although I would personally not use Facade and instead I would use an ORM for connecting to database.
Regarding technologies, WCF and ASP.NET MVC are so much better choices over web services which is old and ineffecient now. Remoting was superceded by WCF and should never be used now.