New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Hartmut Wilms on Dec 28, 2007
The official CTP release of the ASP.NET MVC Framework does not include any support for AJAX, yet. In the meantime there are several samples available, which show how to add AJAX features to ASP.NET MVC applications.
Nikhil Kothari offers a sample application and sample code, which shows how to add AJAX support (like APS.NET AJAX) to the ASP.NET MVC Framework:
AjaxController is a class I added, and it introduces a new property IsAjaxRequest, which I can use in my action methods to do things like render different views. It also introduces members such as RenderPartial, which can be used to render a portion of the user interface defined within a partial view as opposed to the full page. So here is my updated controller and the updated Add method with the changes and additions in bold.
public class TaskListController : AjaxController {
public void Add(string name) {
Task newTask = null;
if (String.IsNullOrEmpty(name) == false) {
newTask = _taskDB.AddTask(name);
}
if (IsAjaxRequest) {
if (newTask != null) {
RenderPartial("TaskView", newTask);
}
} else {
[...]
}
}
}
In addition to the controller extensions Nikhil provided some extension methods to be used within the views: "RenderBeginForm which renders a regular form tag, RenderBeginAjaxForm which renders an Ajax-enabled form [...], and RenderEndForm". The sample "shows in brief a first stab at getting the core aspects of the Ajax functionality that exists in ASP.NET pages - partial rendering, behaviors and extender controls - and bringing those concepts to MVC views".
Kevin Hoffmann utters his concerns in the article "How to Hack AJAX Into the ASP.NET MVC Framework". At first he criticizes that Nikhils example only shows how to update small parts of a web page by rendering HTML. In his opinion
Ajax, in enterprise applications, is not just about rendering small partial divs dynamically. Sure, that's a big part of it, but by and large when people are using an XML HTTP Request object to hit the server controller for data, they're getting raw data back, they're not usually getting a pre-rendered div. This is often the case when the controller being hit is also providing raw data to smart clients through a REST/POX/web services type of action. So, while I like the notion of RenderPartial for some scenarios, A better example would have been to render a view that outputs simple XML or, even better, JSON.
He is even more worried about the IsAjaxRequest property within the controller:
MVC is all about proper separation of concerns. There's one line of code in the sample that I think is violating that, and that's the IsAjaxRequest property. This all smacks of someone attempting to make the MVC framework feel more like the old Postback world and quite frankly, the old postback world can eat my shorts. The controller, IMHO, is just a controller. It should not ever have to determine if it is rendering Ajax or rendering Regular. Ajax or regular HTML is a view decision not a controller decision. The job of the controller is to fetch the appropriate data required for rendering a view, and then pick the view to render.
Kevin concludes that "What [he] really want[s] to see from Microsoft is a really compelling reason why [he] shouldn't just take some off-the-shelf Ajax library and make it work with the MVC stuff."
For those who comply with Kevin's reasoning, Chad Myers has provided two ways of integrating an off-the-shelf Ajax library with ASP.NET MVC. In Using script.aculo.us with ASP.NET MVC Chad shows how to integrate the script.aculo.us client-side JavaScript + AJAX framework and use some of their controls within ASP.NET MVC views. script.aculo.us is "A collection of Web 2.0 style JavaScript libraries that help web developers to easily add visual and ajax effects to projects".
The second approach shows how to use jQuery with ASP.NET MVC. jQuery "is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages". Chad ports the Edit In Place tutorial by Jack Born to ASP.NET MVC thereby showing how easily jQuery can be integrated into the new framework. According to Chad it is almost as easy as "keep thinking "ASP.NET MVC" whenever the [jQuery] examples say "PHP" or "Ruby" on the server side if you plan on using ASP.NET MVC".
Mobile and the New Two-Tiered Web Architecture
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Fair Trade Software Licensing - A Guide to Neo4j Licensing Options
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
No comments
Watch Thread Reply