locked
A booking or shopping system as SPA? RRS feed

  • Question

  • User434878223 posted

    Hello,

    I am very new in SPA and still learning about it and I would like to start a new project for a booking and shopping system.

    Is it a good idea to makea SPA or just simple MVC application will be better and less complicated? Are there any simple examples regarding that?

    On the other hand, which template could be most comprehensive and quick implementable for my purpose? 

    - I know more about knockout.js but I see that Hot Towel SPA template is highly recomended.

    Thanks for your help.

    Monday, October 28, 2013 11:59 PM

All replies

  • User-105429085 posted

    For me, it will be depending on if your project is going to involve with other clients (i.e. native mobile apps).

    If it's website only, MVC will be easier with less client code to debug. There are existing MVC tutorials and projects for such system, such as http://www.asp.net/mvc/tutorials/mvc-music-store

    If it's going to involve many different type of clients, SPA + WebAPI approach wil be best for you.

    Hot Towel SPA uses knockout.js as well, so it should be an easy choice for you.

    If you use SPA, take a look of VS2013 SPA project to see how it handles authentication.

    Tuesday, October 29, 2013 1:02 AM
  • User-1620313041 posted

    In addition to xinqiu

    Of course implementing the application in Mvc is easier. In general, the classic "web pattern" is the easiest way to keep modularity and separation of concern in a complex application because communication between modules takes place through a relational database, thus avoiding direct communication among modules that might undermine the modularity of the application: it is enough to use the repository pattern and layering the application into UI, business and data layers, to ensure modularity and to avoid "spaghetti code", since database based communication takes care of mantaining separation between modules that perform different tasks.

    As you move more logics to the client side with the purpose of reducing the server round-trips, and to improve the user experience you have to face the problem of the communication between several modules cooperating on the client side. If you don't design a well founded interfacte based architecture you risk to produce "spaghetti code".

    Now the above problems are common to all client side technologies: WPF, Silverlight and SPA. In the case of SPA you have also the difficulty of maintaining a big code base written in Javascript. Javascript code  is not easy to mantain and re-engineer (no command for finding all occurrences of a method..to mention one).

    Summing up the advantage of SPA is to offer an UI similar to the one of a native application while keeping all other advantages of a web application, but the cost of producing the code is higher, and the web application cannot be indexed by the search engines since all html is produced dynamically. This doesn't mean SPA are not worth the effort to produce them...on the contrary with their adoption ...the improvement in the user experience changes of some order of magnitude...actually another planet...however as all beatiful stuffs they cost more :)

    Some improvements in the user experience maybe obtained also with the use of some classical ajax techniques, where you refresh just a part of a page with fresh html coming from the server. This way the application is also visible to search engine (at least the static parts that are not updated through ajax). The disadvantage of this approach is that you don' have data strucure that represent explicitely the application state on the client side...but just html, so if you move too much logics on the client side you ends up with "spaghetti code". As a conclusion with this hybrid approach, you can't do too complex dynamic handling...but just to improve a little a static classic Mvc application.

    Tuesday, October 29, 2013 3:57 AM