I’m relatively new to web development, and I’m amazed at the variety of new concepts in the field. I could probably use some help to synthetize.
I have to deal with is a backend written in Delphi, that provides some poorly written SOAP services. I originally developed an ASP MVC 5 web app making use of the SOAP API. My fatty controllers select and call the SOAP services, use a bunch of Mappers to transform the DTOs into my C#-wise model objects, and execute some business logic at times. Sometimes, they have to use consecutively two mappers, one to transform the DTO into a “model object”, and one to transform the model object into the “view model” object. I know… I’m anxious just thinking about it.
Besides, I wanted to do a Single-page app (at the time, I didn’t even know that this concept existed) with a mix of Razor, JQuery, and a third-party MVC components library (DevExpress).
This project proved to be extremely cumbersome. I managed to bring the monster to life nonetheless, but performances are still an issue, and any modification of the beast requires an excessive amount of time. As an aside, approximately half of my controllers’ methods returns PartialView, and the other half return Json objects.
I recently started creating a “Service” layer, in a separate VS project, whose purpose is to handle the SOAP end point, sometimes execute some business logic, and mostly to do the mapping from DTOs to some model objects (I think I could also introduce some caching here, that’s another debate).
For the web client, I started writing an AngularJs app, which framework indeed simplifies my life a lot. So far I outlined a handful of views, and I can switch from one view to the other in a snap, having total control on the round trips to the server. I had to do little work to outline this new app as compared to my previous approach.
I immediately see at least one drawback here. My Angular services could only be used in that specific context. Let’s say I want to create a native Android app, it would have to call the SOAP web services and would probably need another Service layer, which probably would do most of what my Angular services layer already does. Moreover, the SOAP end-point, which I didn’t write and is currently only available to the IIS apps on the same server, would need to be exposed to the outside world. It is not ready for that in terms of security.
An intermediate solution could be that I keep my services layer written in C#, and create a REST end-point on top of it, for the use of my angular app as well as various other apps that could be written, in the future, for any platform in any language.
Would this solution mean that I don’t need the “MVC framework” anymore? What would be the role of “ASP” in this context? Only mapping request parameters to .NET objects, and some routing? Let’s not forget about authentication. My previous app used [Authenticate] on every controller as well as some basic roles management. I believe I would have to deal with this “manually” in the context of a REST API?
I also get confused because of things changing so fast. I find information about “Web API” that was true for ASP MVC4, and is no longer true for MVC5. Now, ASP.NET 5 is out, but I wasn’t able to find a clear and comprehensive list of ASP’s features and new features. I also heard of Rails and Node.js, but I’m afraid I currently use a lot ASP features without even knowing