Our team originally consisted of mostly server side developers with minimum expertise in Javascript. In ASP.NET we used to write a lot of UI logic in code-behind or more recently through controllers in MVC.

A little while ago 2 high level client side developers joined our team. They can do in HTMl/CSS/Javascript pretty much anything that we could previously do with server-side code and server-side web controls:

  • Show/hide controls
  • Do validation
  • Control AJAX refreshing

So I started to think that maybe it would be more efficient to just create a high level API around our business logic, kinda like Amazon Fulfillment API: http://docs.amazonwebservices.com/fws/latest/APIReference/, so that client side developers would fully take over the UI, while server side developers would only concentrate on business logic.

So for ordering system you would have a high level API like:


CreateOrderResponse CreateOrder(CreateOrderRequest)

There would be JSON/REST access to API, so it would be easy to consume from client-side UI. We could use this API for both internal UI development and also for 3-rd parties to create their own applications.

With advances in Javascript and availability of good client side developers, is it a good time to get rid of code-behind/controllers and just concentrate on developing high level APIs (ala Amazon) that client side developers can consume?

2 Answers 2


Validation on the client side to offload the server side side and increase responsiveness of the application is fine but always do server side validation. One can turn off JavaScript and when using the REST API directly no JavaScript won't ever be needed.

  • Yes, validation would also be a part of the Domain/API. Client side would pull what needs to be validated from API or we would document what is required, etc... for each method. If there are still validation errors on submits from client side - we would throw exceptions.
    – Mag20
    Feb 23, 2011 at 11:15

One thing to be aware of is that complex UIs may require an additional "UI assist" layer to support things like hierarchies, master/detail relationships and other UI concepts that don't really exist in the business layer. It's often not possible to implement some of these capabilities w/o making multiple round trips to the business layer, which degrades performance. At least, I prefer having the "UI assist" layer to giving the UI direct access to the database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.