Note that there are some explanatory texts on larger screens.

plurals
  1. POSome architectural advice on ASP.NET MVC 3 replacement of php web site
    text
    copied!<p>I am rewriting a web (application?). I'll try to set things up, briefly (haha). My client's website is built in with/in a CMS. Most of it is static content. The website is hosted somewhere but there is a login area for customers to track their orders and other dynamic business content which is stored on my client's servers. Authentication happens on both sides (the [php] cms manages the session, but business logic and customer data including passwords resides on my client's servers in my client's database and is served up via wcf). Each php request to the wcf webservice posts a json authentication string and if authenticated, my wcf webservice returns a json result populated with the requested data (which is then used with the smarty templates to generate an output that the cms sends to the browser). </p> <p>This would all be fine except that the php code is monumental spaghetti. Actually, it's probably not too bad by php standards, but I'm used to... well, who cares, because it comes down to the fact that I didn't write it, but I have to extend it, and each modification takes 10(0?) times longer than it should and only drowns the haystack in more noodles (to mix metaphors). And damningly, there is no testing changes before they go live. Any change or addition has to be made in the production environment (due to dependencies on the CMS environment). So I have to mix blitz tactics with edit and pray, as well as keeping an 11th finger on the proverbial revert button (wouldn't it be nice if it were just a single step to revert?). I have toyed with refactoring the php side many times, and have even written about 75% of a complete reimplementation. But...</p> <p>This web app is getting more and more responsibilities and change requests. For this client I have written a 500,000 line ERP in C# and all their business logic resides therein. So, I figure there is a definite ROI in having all their code in .NET, for me or whoever follows. </p> <p>The only real constraint on any solution is that whatever the CMS is to display has to be appended to a variable "$output". That leaves things pretty open. </p> <p>Anyway, (the often superfluous but hopefully nerdly entertaining) narrative is complete. So, with that, I have set up a simple php wrapper that uses cURL to get the contents of a url that is backed by my new mvc app. That works fine for get. My question is what is the best way to proceed with this. Every request from the cms side needs to include some authentication information that it will retreive from a database (or whatever) and post with its request. I figure I'll just cannibalize the wcf webservice and serve all content from within the mvc app. </p> <p>So basically, what is the best way to write an mvc app where each request is a post that contains authentication information (it can be json or xml)? I'm trying to avoid decorating every controller method with [HttpPost] and having every action method require an argument of my authentication dto so that at some point I can switch all authentication quickly and easily to asp forms authentication. </p> <p>Thanks (for reading)!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload