View Model versus Domain Entity Validation with MVC

I blogged way back in January about what I see as the three variants of View Model usage in ASP.NET MVC. If you’ve not read that post, check it out here and report back! The Problem What I’ve started to see is that many other developers like my approach of defaulting to Variant 2 (a…

1

Different Routes for Different Hosts Using Constraints

I had the pleasure of visiting some guys in Munich this week to talk about ASP.NET MVC. Well, the time with them was a pleasure, but I did have two awful airport experiences due to snow in 48 hours! Something we discussed that I’ve come across before is using different routes depending upon the domain…

0

Bubbling PropertyChanged Events in Silverlight

I’ve been working with Silverlight (specifically for Windows Phone 7) recently and something I’ve found useful is the ability to “bubble” PropertyChanged event up. So for example; 1: public class MainPageViewModel : INotifyPropertyChanged 2: { 3: public ObservableCollection<Person> People 4: { 5: get 6: { 7: return _repository.Items; 8: } 9: } 10:   11:…

0

ADM SoundBytes: The Free Lunch is Over – Patterns for Parallelisation

  Our next SoundByte, “The Free Lunch is Over – Patterns for Parallelisation”, will be run on Friday 15th October 2010 from 11:00 – 12:00 UK Time. The session is charged at the rate of 1 hour from your ADM contract for up to 2 Live Meeting connections (and unlimited attendees at each of these…

0

Controller Action Design in MVC

Validate, Act, Translate, and Respond. That’s about it. I’ve been trying to come up with a nice acronym for how to structure code in Actions for some time now, and this is the best I have managed. I wish it spelt a nice word – so if you’ve a better suggestion shout up. What I’m…

0

Client Script Patterns: Predictive Fetch

Why do you write JavaScript? It’s probably for one of two major reasons – Responsiveness or Richness. Richness we know about – it’s the flying, sliding, flashing, and sometimes annoying UI features we see J But Responsiveness is much less tangible – it’s about how an application feels to use. Does it feel like it’s…

0

jQuery + MVC = Progressive Enhancement

If you write a lot of JavaScript, you really should consider adopting Progressive Enhancement as the standard way that you work. This is basically whereby you write a web site without script, and then enhance it with script. The result is a site that does not rely on JavaScript (and hence works with accessibility tooling…

0

String.Unformat: I’ve created a monster

I don’t know if you’re the same, but when coding away I often find myself wishing for a String.Unformat function – call it the evil twin of String.Format. With String.Format I can build up strings like this;var result = String.Format( “http://{0}:{1}/{2}”, “localhost”, “12345”, “TestPage.aspx”); … which will return “http://localhost:12345/TestPage.aspx”. But what if I want to…

1

Closure Exposure: A JavaScript Scope Trick

You might have seen some JavaScript is wrapped up in funny looking functions, such as this screen shot, and wondered why – even parts of the Microsoft Ajax Framework previews use such an approach. At first it can seem very strange, but don’t worry – it’s actually very simple, and equally useful. Scope First of…

0

Enforcing Unobtrusive JavaScript

Unobtrusive JavaScript is a concept that’s been around for quite a while, but it’s now finally starting to make its way into the mainstream. The basic idea is that you should separate your JavaScript from your HTML – so instead of; <a href=”Default.aspx” onclick=”alert(‘Sorry, that is unavailable’); return false;” >Click Here</a> You should have something…

2