Using AWS’s Simple Workflow Service (SWF) with C#

Amazon's Simple Workflow Service (SWF) in AWS provides a model of workflow that is simple to understand but is it simple to get a robust and durable workflow in place? Tom Fischer guides you through the bewildering early stages of your first SWF application, and concludes that workflows inherently take time and effort to get right, but SWF provides a formidable cloud-based solution … Read more

When a Single ASP.NET Client makes Concurrent Requests for Writeable Session Variables

The design of ASP.NET includes the valuable session variables that enable the application to keep track of individual sessions. Unfortunately the ASP.NET pipeline will not process requests belonging to the same session concurrently but queues them, and executes them serially. MVC locks session variables to ensure thread safety and concurrency control, but takes a conservative approach to polling for these locks. Do you always need this level of thread safety? If not, what can you do to improve performance when you need to use writeable session variables?… Read more

Printing from ASP.NET MVC

Even though we're less inclined to print web-pages nowadays, it often makes sense to save useful content from a website as a PDF file to read offline. Modern browsers give us everything we need to do that, and there is much that the website designer can do to improve the results. However, there are times that something more demanding is required, such as a properly-formatted invoice or chart, and then the web application needs a way of creating PDFs directly. … Read more

Code Smells: Raw Strings and the Subtle Syntax Catastrophe

All sorts of complex data can be represented as a string but that doesn't mean you can treat them merely as strings. There are so many things that can go wrong if you assume that generic string operations such as concatenation can serve to create complex markup, expressions, codes and serialised objects. It pays instead to create dedicated builders for any such complex data that you may need to create. Michael Sorens explains some defensive coding to make for a more robust application.… Read more

Securing Web Applications

If you are developing a web application, almost every design decision you make can introduce a security flaw if you get it wrong. Although attacks are becoming more common, and more widely reported, the same common errors continue to provide the most opportunities for hackers. OWASP provides a 'top ten' security problems. Vishwas here describes them and explains how to avoid them… Read more

Pragmatic Web Error Handling in ASP.NET MVC

There is a pragmatic approach to error handling in ASP.NET MVC. This is the idea of recovering gracefully from those unhandled exception errors where remedial action cannot be taken under the current context, by passing control to a specified URL that is designed to deal with a particular category of application-specific error. Dino Esposito elaborates on a pattern that prevents unhandled exceptions from bubbling up well beyond the intended sco… Read more

LINQ Debugging and Visualization

LINQ is certainly extraordinarily useful. It brings the power of query expressions to C#, allowing an easy way of getting the data you need from a variety of data sources. Up to now, there hasn't been a VS debugger for LINQ that gives you the means to visualise the data at every point in the chain. Michael Sorens, a keen LINQ user, describes a third-party tool that now promises to make using LINQ something we can all participate in.… Read more

Development Delusions: That it is Enough to Build a Better Mousetrap

You've written a superb, clever, application that you are trying to encourage your colleagues to use. They're not interested. Why? You've neglected the documentation. Surely, the saying goes 'Build a better mousetrap and the world will beat a path to your door'? Nope, not without comprehensive and complete documentation and marketing, it won't. Documentation is the secret of ensuring that good software will succeed. … Read more

Managing Packages Using Windows PowerShell

Windows hasn't had a package manager in the style of the Advanced Packaging Tool (APT) of Linux distributions. Apt-get is a great way of installing packages and other software. We have Chocolatey, of course which has a growing library of software and even allows you to automatically update software. Now PowerShell has an 'official' way of using any system, such as NuGet, Chocolatey, GitHub or PSget. It is definitely useful and likely to mature into an indispensable tool for Windows users. Nicolas explains why… Read more

4 Keys to a Clean Angular Implementation

Can there be true separation of concerns with MVC? Not entirely, especially when Angular's templates allow you so much flexibility; but there is a great deal to be gained from following guidelines to ensure that all business logic is performed in the code-behind as directed by the controller or its delegate, and that all operations on the model are done in the controller: Michael Sorens explains the four essential guidelines for an easily-maintained system.… Read more

Multi-Step Input Forms in ASP.NET MVC

It is a common problem with a web page that a form is too complex to fit easily on the page. You can, of course, rely on the scrollbar, but it soon becomes a daunting and erratic process for the poor user. Wizards, that allow you to guide the user through a process, are great but take time to set up. Is there a simple solution for those occasions where there is too much data-entry for a form but a full wizard seems like overkill?… Read more

Is JavaScript Single-Threaded?

Developing JavaScript for web pages can be perplexing. You will get errors that seem to make no sense, You will be given nuggets of advice about how and when you can use JavaScript to manipulate the DOM or make Ajax requests. It is far better to understand the reason for these rules; the single-threaded nature of JavaScript, and how it loads the page and manages the event loop. How can you achieve parallel processing and what is the best way? Igor makes it all clear and obvious.… Read more

Going Interactive with C#

For some time now, C# programmers have gazed enviously at the interactive capabilities of F#, Python and PowerShell. For rapid prototyping work and interactive debugging, dynamic languages are hard to beat. C# Interactive slipped into view quietly, without razzmatazz, in Visual Studio 2015 Update 1. It's good, it's worth knowing about; and Tom Fischer is intent on convincing you of that.… Read more

Taking Pictures from HTML

Sometimes a request from a user who doesn't appreciate the limitations of the technology can jolt you into discovering that an application feature that was, until recently, difficult to achieve is suddenly relatively easy. Dino was asked to allow the user to take photographs and associate them with an item of work. After he'd recovered from the shock, he decided that it was achievable, and now describes how he went on and did it.… Read more

Performance-Oriented Software Development

Applications must perform well. The problem is that performance can't easily be added later as an afterthought but must be part of the culture and values of the development team. This isn't easy, particularly if measurement is difficult to achieve and it is tricky to determine exactly what is running too slowly. As well as making performance a clear objective, you need an efficient integrated approach and the right tools. If you get this right, it can save a lot of expense, and time spent refactoring code. … Read more

Accepting Dates in Web Pages

Surely, not much could be simpler than using the HTML INPUT element? Actually, it was always a trouble for dates, what with having to check dates for validity and coping with all the languages and conventions. Now with HTML5, the 'date' type, and so many date-pickers that are either built-in or part of frameworks, it can become a complex decision about how you best deal with date input. Dino explains the issues of inputting dates into web applications.… Read more

Join Simple Talk

Join over 200,000 Microsoft professionals, and get full, free access to technical articles, our twice-monthly Simple Talk newsletter, and free SQL tools.

Sign up