Last post Oct 29, 2013 03:57 AM by francesco abbruzzese
Oct 28, 2013 11:59 PM|emil_bg|LINK
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.
Oct 29, 2013 01:02 AM|xinqiu|LINK
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
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.
Oct 29, 2013 03:57 AM|francesco abbruzzese|LINK
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".
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.