views:

12

answers:

1

I am thinking of a certain application. It should have a database driven back-end and clients can be: Browsers (Via HTTP/S and XHTML/JS), Applications (windows, mac, mobile devices) via Web-Service SOAP requests.

I thought about designing the back end in layers.

the initial layer would be the database, of course. Above it, Web Service servers, capable of talking to SOAP capable clients making requests, reading and writing data into a database. For those clients, the application context would be in the client itself and the SOAP would be used only when needing to read or write data from the application backend.

I was wondering regarding the Browser Presentation Layer. Should it make use of the web services layer? or just access the database directly to serve the requests made by web browser clients?

A: 

Use a common API that the web service is a wrapper around. Implement the web front-end so it also uses this API. Try to keep as much code as possible inside the shared API. Try to avoid multiple code paths that do the same thing on the same database.

Building the front-end on top of the web services is doable, but only if you use an appropriate javascript toolkit (e.g. dojo, extjs). It depends on how much you like writing javascript whether this is the right fit for your project. I build all my web apps this way, but then I like writing javascript.

Joeri Sebrechts