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…

3

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…

2

Offline Data Cache in Windows Phone 7

I’ve been building a Windows Phone 7 application that basically lets a user create records offline, and then pushes those up to a cloud service when network connectivity is available. These offline records are not as offline as I would like though – it’s never that simple is it? The records contain data fields for…

1

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:…

1

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…

2

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…

6

View Models in ASP.NET MVC

Q: Should I have a view Model in my ASP.NET MVC architecture? A: Yes. Well, that was a short post! J Being more serious, this is an interesting topic that the advisors and p&p team discussed a few times while they were building the Reference Implementation for the soon-to-be-complete Web Client Guidance, and it is…

41

Check out the Web Client Guidance

If you’ve not come across the Web Client Guidance that patterns & practices have been working on, now is the time to head on over to their CodePlex site; http://webclientguidance.codeplex.com/ The team have been really busy pulling together resources, advice, and guidance on a lot of topics related to web client development, including ASP.NET MVC…

0

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…

9