Latest Tweet:
  • Loading...

Last year I gave a presentation on the MVVM design pattern at the Norwegian Developer Conference. Most of the presentations from NDC2009 was recorded and made available online, including mine. However, the user experience of the video content on the NDC site isn’t the best. Playing a video requires multiple clicks, and the videos are only available in WMV format.

The feedback I’ve gotten on the presentation is so good that I decided to make it a bit more discoverable by uploading it to Vimeo. In addition to the MVVM presentation I have also uploaded my lightning talk from Smidig 2009 (in Norwegian) as well as my Silverlight talk from TechEd New Zealand 2008.

If you want to watch all the content from NDC2009 you can download it nicely packaged as one big torrent file. Oh, and I haven’t made an announcement on the blog yet, but I will be speaking at this year’s NDC.

MVVM Design Pattern NDC2009 from Jonas Follesø on Vimeo.

On Wednesday 21 October I will be visiting the Kristiansand chapter of NNUG to give two Silverlight presentations. The first will be about the MVVM design pattern, and the second on building business focused applications using .NET RIA Services. After the NNUG meeting there will be a geekbeer get-together at Patrick’s. Details and registration for the meeting is up on the NNUG site.

On Thursday and Friday (22-23 October) I will be attending the Smidig 2009 (Agile 2009) conference in Oslo. This will be my first time attending the Smidig conference, and I’m really looking forward to it. The format of the conference is 4 lightning talks pr hour before lunch, and open spaces after lunch. Judging by the number of submitted talks I think it is going to be a really interesting conference, and I hope to learn allot about how to run successful agile software projects. I’m also a big fan of open spaces and the interaction between conference attendees it enables.

Since I was planning to attend the conference I made a last minute decision to submit a talk on UX prototyping in agile projects using Balsamiq and SketchFlow. The talk got accepted, which means I will not only be attending – I will also be speaking at the conference!

I’m looking forward to doing some presentations again, and I hope to see you in Kristiansand or Oslo next week!

(Time-lapse video taken by @petesamuel from a presentation I gave earlier this year) 

The videos from NDC2009 are now published on the conference agenda site. The site isn’t the easiest to navigate, so Mark Nijhof went through the effort of creating a simple list of all the videos grouped by speaker. There is tons of great content available and the videos should be a great way to do some (relaxed) learning in the summer heat.

There is a problem with some of the links, and the link to the video of my second talk on .NET RIA Services is broken. I’ll make a new post when that video becomes available.

JoansGivingMVVMTalk 

Click to view my Model-View-ViewModel presentation from NDC2009.

Earlier this month I was lucky enough to both attend and speak at the Norwegian Developer Conference 2009. What a blast! The NDC09 featured a perfect mix of content – everything from the latest in technology, to the core principles of software craftsmanship and agile development. The speaker lineup this year was AMAZING, and I feel humble to be invited among such a group of incredibly talented people. Hopefully I was able to keep up with the level of the rest the speakers.

JonasAndHaack

I gave two presentations at NDC09; one on the MVVM design pattern (more easily referred to as View Model) and one on .NET RIA Services. I think both talks went well – with the View Model talk being the strongest one, as this is something I’ve been presenting on many times before.

I’ve uploaded both the slides and the demos from my talks. The MVVM demo is basically a the Dive Log example application taken further, with multiple View Models communicating through an Event Aggregator and a touch of navigation using the Silverlight 3 navigation framework. The .NET RIA Services demo is a “plain” data centric application, as well as a second demo app which uses nHibernate and the XML Metadata Provider (something I have to revisit in a later blog post).

In addition to the technical content delivered at NDC09 it was great fun to hang out with old and new friends. Here are some of the highlights: Had some great conversations with Glenn Block about different aspects and approaches to the View Model pattern. Got to catch up with Andrew Browne, a good friend from the Melbourne developer community. Had dinner with Carl and Richard from .NET Rocks, Udi Dahan and Capgemini colleagues. Had tons of good conversations with fellow Norwegian developers. Went fishing with Tim Huckaby.

Thanks to all the speakers, organizers and attendees for making NDC2009 such an awesome event. Hope to see you all back there next year!

MVVM Design Pattern for Silverlight Applications

DiveLogMVVMScreenshot

Download slides:

Download demo

For a collection of more resources check out my MVVM tagged links on Delicious.

.NET RIA Services

Download slides

Download Fishbook Demo

Download Fishbook nHibernate Demo


For more resources check out my .NET RIA Services tagged links on Delicious, as well as the talk “.NET RIA Services - Building Data-Driven Applications with Microsoft Silverlight and Microsoft ASP.NET” and “Building Amazing Business Centric Applications with Microsoft Silverlight 3” from MIX09.

SDDN Logo

Earlier this week Australian Silverlight enthusiast Jordan Knight announced the Silverlight Designer and Developer Network initiative. This is a new user group starting up in Melbourne, focusing on the design and development aspects of Silverlight. First meeting is scheduled Thursday November 27 at 5:30 PM for a 6PM start. The venue is Microsoft Theatre, Level 5, Freshwater Place, Southbank. Microsoft User Experience Evangelist Shane Morris will be delivering a key note to kick off the group. I will be giving a presentation covering the current state of the Silverlight union. I will talk about any major Silverlight announcement from the PDC, what have been announced around the future, and some of the interesting community projects around Silverlight 2.

The SDDN is a great initiative for many reasons. Most importantly it creates a meeting forum to bring developers and designers together. Getting designers engaged is a key success factor for Silverlight. I really hope this initiative can help that happen. Secondly the Network-part of the name suggests this is more than user group meetings. The SDDN has ambition to build a strong online presence, with high quality recordings of all meetings. This is a great way to reach out to a wider audience, as well as developers and designers working in smaller/remote areas who might not have access to a user group like this. Big kudos to Jordan for making this effort!

Check out Jordan’s announcement post and the new (but still under construction) site for more details. Hope to see you at the first SDDN meeting!

Meet Me In Los Angeles With the SDDN announcement out of the way the next point on my agenda for this “what’s up” blog post is the PDC. I’m writing this while sitting at the gate waiting for my flight to Los Angeles. I will be attending PDC 2008! I had the pleasure of attending PDC back in 2005, and that was an amazing experience. This year I have high expectations to the PDC as it has been three years since last time. I tried to set up my agenda, and ended up with at least two conflicting sessions for each time slot! There is just so much great content. Thankfully Microsoft is putting a big effort into recording all sessions, so at least that’s a chance to catch up on the sessions I miss out on. I don’t know if the recordings will be made available publicly, but I sure hope so.

I’m looking forward to networking with fellow peers in the Microsoft and Silverlight development community. If you’re attending and want to catch up, drop me an e-mail at jonas@follesoe.no, or ping me on Twitter (@follesoe). See you in LA!

When building line-of-business (Smart Clients or Rich Internet Applications) you normally talk to some back-end web service responsible for enforcing business rules, authentication, and storing your data in some database. When implementing your client application you often end up re-implementing some of these business rules to give the user a better experience. Instead of having to pass an Order-object to the web service just to get an exception saying that the order date field is a required, you should try to enforce these validation rules directly in your user interface. How do you best implement these rules across your tiers?

Sharing is caring!

In his January 2004 MSDN article title "A Guide to Developing and Running Connected Systems with Indigo" Don Box presented four rules for connected systems, later often referred to as “the four tenets of SOA”. The rules are as following:

  • Boundaries are explicit
  • Services are autonomous
  • Services share schema and contract, not class
  • Service compatibility is determined based on policy

Especially rule number three is relevant when talking about implementing business rules on both server and client. In traditional object oriented design you would implement your domain- or business objects and let them encapsulate your rules and logic. One of the advantages of web services is that they work across boundaries and platforms. They also help you make your systems loosely coupled, only depending on the service contract and not a specific binary component. Web services use open standards such as HTTP, SOAP and XML to achieve interoperability and louse coupling.

Services do not deal in types or classes per se; rather, only with machine readable and verifiable descriptions of the legal "ins and outs" the service supports. The emphasis on machine verifiability and validation is important given the inherently distributed nature of how a service-oriented application is developed and deployed. Unlike a traditional class library, a service must be exceedingly careful about validating the input data that arrives in each message. Basing the architecture on machine-validatible schema and contract gives both developers and infrastructure the hints they need to protect the integrity of an individual service as well as the overall application as a whole. – Don Box

Blindly following the rule about not sharing class can lead to developers and architects forgetting what they know about object oriented design. This is something I have experienced on several projects. However, there is nothing in Don Box reasoning stopping you from building some really smart classes or libraries to help you consume and talk to these web services. Most development platforms have some sort of tool support to automatically generating proxies to create the SOAP messages needed to communicate with the service. However, since these classes are all generated based on WSDL and XSD definitions they don’t contain any "smarts", like validation rules, authorization, or computed properties.

There are different techniques to achieve sharing of some logic between server and client. An old trick is to move all your business entities into a separate assembly and use this on both server and client. After Visual Studio have generated a web service proxy you remove any generated types and include a using statement to the namespace containing your business entities. When the proxy de-serializes an Order-object from your web service it will create a "real" Order-object instead of an auto generated type. This object will have any validation rules or computed properties, which would be lost in the auto generated type. In Visual Studio 2003 and 2005 you had to do this by hand, which was bothersome, and something you had to redo every time you update your service reference. In Visual Studio 2008 this pattern is supported by the tool. When adding a new service reference you can choose to reuse any types in referenced assemblies, letting you use real objects instead of automatically generated proxy objects.

When working with Silverlight this is a little bit harder. The problem is that the client Silverlight .NET runtime is different from the server .NET runtime. You can’t directly reference a Silverlight class library in your web service application, or reference a traditional .NET class library in your Silverlight application. There are workarounds to help you share code between a .NET server application and a Silverlight client application. You can create two different class libraries, one for Silverlight and one for the server, and link the class files between them. You have one copy of the file, but it’s added to two different projects, letting you compile the same class into two different assemblies. Since Silverlight is a subset from .NET you may not be able to do all the same things in the client library as in the server library. You can separate out Silverlight and .NET specific code using compiler directives or partial classes.

#If Silverlight then 
	// Silverlight only code 
#Else 
	// .NET only code #End If 

This is the approach taken by Rockford Lhotka in CSLA Light, a trimmed down version for Silverlight of his CSLA.NET application framework. He recently started blogging about how CSLA Light helps you reuse business objects between tiers. This approach might be difficult if your server code have many external dependencies, for instance to ORM tools or other frameworks you don’t have a Silverlight version for.

Extending the automatically generated types

The web service proxies generated by Visual Studio have gotten better and better, and the classes generated by Visual Studio 2008 are quite useful. Sure, they won’t know about server specific rules, but the generated objects use properties, implements change notification and use observable collections for lists. This enables you to data bind against the proxy objects, which is really handy. However the solution isn’t perfect. One of the features added in Silverlight 2 Beta 2 is the support for binding validation. This enables you to detect if the data entered by the user in a data bound field breaks any validation rules. When the binding validation event fires you can highlight the field, for instance by changing background color. The way binding validation works in Silverlight 2 Beta 2 is by exceptions thrown in the setter of a property. If you bind against the automatically generated proxy objects you can’t change the setter to implement your validation rules.

Another example where you want to extend the proxy objects with additional functionality is for computed properties. Since I just got back from a dive trip I’m going to use that as an example. When logging a dive you enter date, time in water, bottom time and time out of water. If I were to implement a dive log application I would store the time the diver entered the water and the bottom time in the database. The time out of water would be a computed property, computed adding the bottom time (minutes) to the time the entered the water time. If I did this on my server, the data would get passed to the client, but the automatically generated proxy object would see this as any other "dumb" property. It wouldn’t understand the relationship between time-in water, bottom time and time-out of water. If I change the bottom time, the time out of water property wouldn’t change.

To solve these problems you have two options. You can choose to treat your web service objects as simple data transfer objects, and wrap them in your own custom client side objects. This can be done by creating a new DiveLogClient-object that takes the DiveLog proxy object in the constructor, and creates new properties for any field used by the UI. This approach gives you full flexibility but involves doing a lot of extra work. Another option is to create a partial class that extends the automatically generated proxy object. This class could add new properties, like TimeInClient, TimeOutClient and BottomTimeClient, which use the same private backing fields as the generated properties, but have additional logic needed to understand the relationship between time-in, bottom time and time-out. Your user interface would bind against the new properties instead of the generated properties, but since they use the same backing fields for their values you can still send the object back to the server to store any changes.

Is Microsoft doing anything to help?

Wanting to share some logic between the server and client is a common pattern. Surely Microsoft must be thinking about how they can help. By improving the service reference tool in Visual Studio Microsoft made it easier to share types across boundaries. But there is still allot that can be done. The Smart Client Software Factory contains functionality to map between service entities and business entities, which let you build richer business entities on the client, and get some framework support to map between the different types. But I’m sure they can do better…

Yesterday Microsoft announced 50 new session abstracts for PDC 2008 held in October. It’s really interesting to read the session abstract to get some ideas of unannounced products and project they are working. One of the sessions that caught my attention is "Microsoft Silverlight: Building Business Applications":

What if you could develop your solutions with the ease pioneered by Microsoft Office Access, deploy them like an Internet application, and take advantage of the power of Microsoft .NET? Learn about an exciting new technology that is all about making business applications for RIA (Rich Internet Applications) much easier to build. In this session, hear how we've made n-tier application development as simple as traditional 2-tier, provided application level solutions to developers, and how we're doing all of this with the same .NET platform and tools on both the client and server.

I guess it’s safe to assume that Microsoft have some really cool stuff in the works. Which approach they take to make n-tier development as simple as traditional 2-tier development I don’t know. But I wouldn’t be surprised to see some kind of smart sharing of linked code files, with partial classes or compiler directives to separate server and client code. It’s also interesting that SOA-expert Pat Helland has been working on a project in the area of RIAs, so hopefully he has been able to provide some valuable input on how to architect RIAs.

Which approach do I use?

Well, it depends… For larger Silverlight projects I tend to consider the automatically generated proxy objects as dumb data transfer objects that I wrap in business objects used by my Silverlight application. The advantage is that I get full control over the object, but the drawback is that I have to do more manual work… For smaller projects where I need minor changes I tend to use partial classes to extend the proxy objects with additional properties used by the client, but backed by the same fields as the properties that get serialized when sending the object back to the server. In the long run I’m a strong believer in tools or frameworks that help us reuse code between server and client in a clean way giving us something smarter than the proxies generated by Visual Studio. Frameworks like CSLA Light or the tools Microsoft will announce at PDC will probably help to deliver this. I expect the announcements at PDC to be to Silverlight what ASP.NET Dynamic Data is to web application. Dynamic Data lets you scaffold a complete data driven application, but without compromising customizability or generating tons of hard to maintain crappy code.

How do you share business logic between server and client?

I am speaking at REMIX08 REMIX / MIX Essentials is a series of Microsoft events happening all over the world focusing on some of the themes covered at MIX 2008 in Las Vegas in March, but with a local "spin" to it. Shane Morris, creative track owner, invited me to give a presentation at REMIX Australia, happening in Sydney May 20 and Melbourne May 22. The title and abstract for the session is as follow:

New possibilities with Microsoft Silverlight 2
The recent announcement of Microsoft Silverlight 2 opens up dramatic new opportunities for creating compelling and productive user experiences on the web. In this demo-heavy session we will give you a run-down of all that is possible with the new platform.

I'll be sharing the session with Jose Fajardo who will be demonstrating Deep Zoom. I will cover the key new features in Silverlight , such as controls, layout controls, styling, templates, data binding,  and user controls. Hopefully I'll be able to use the project I've been working on over the last month for my presentation. Currently working on getting a OK from the client.

There are several great sessions on REMIX Australia, covering topics such as ASP.NET MVC, WPF 3.5, Silverlight 2, Expression Studio, Windows Live, XAML for designers, Expression Web and CSS, IE8, and Silverlight for mobile. The price to attend is just 199 AUD, and all attendees get a copy of Expression Studio 2, valued at 1099AUD!

Also, since much of the audience for this blog is based in Norway I have to give a shout-out to the Norwegian Developer Conference 2008, which will incorporate the Norwegian version of MIX Essentials. See the conference site for more details.

Hope to see you at REMIX, and if you have any comments, suggestions, or things you want covered in my Silverlight 2 presentation drop me a comment!

Playing with Surface It's a strange feeling getting on a plane in Seattle Friday afternoon, travel for 24 hours, and wake up Sunday morning on the other side of the globe.  I just got back to Melbourne from the 2008 Global MVP Summit in Seattle/Redmond. It's been an amazing week, with some great technical content and some good parties with new and old friends. The MVP summit is an annual event where Microsoft invite their MVPs (Most Valuable Professionals) to talk about future technologies and collect feedback from the developer community. The last couple of years the Microsoft Regional Directors (which I am part of) have also been invited to the summit. This year I think there were around 1800 attendees to the summit. It was great to finally meet many of the faces behind the blogs and mailing lists I frequent on a daily basis. As for the technical sessions I spent most of my time in the client development (Silverlight/WPF) track. I can't go into details on the content, as most of it is NDA, but I must say I'm getting more and more exited about the Silverlight platform.

This week is going to be really busy, catching up with the Silverlight project I'm currently involved with. We're talking with Microsoft about featuring the project on REMIX in Sydney andMelbourne. I'll post more about it if that goes through. Next weekend I'm off to CodeCampOz in Wagga Wagga, and I'm looking forward to see many of the guys I met at the MVP Summit again. Hope to see you there!

Check out photos from the Australian MVP Summit delegation

Today I did a 10 minute demo JSON and how you can use it to bridge win and web applications. The content and code covered in the demo is available in a separate blog post. It was great fun to present again and it was a decent sized crowd, and I got some good feedback after the demo as well. Even turned out to be two fellow Norwegians among the attends which was fun and a bit surprising.

There are a bunch of pictures from the launch event available on the "Heroes Happens Here" Flickr site. I've included a couple of them here as well. I think my next speaking engagement will be at the CodeCampOz coming up in April. I've submitted an abstract which is hopefully going to get accepted. Also planning on getting more involved with the Victoria .NET user group. I attend their last meeting which was great! Hopefully I'll get a chance to present there this fall (or spring if you're on the northern hemisphere).

If you have any questions or comments related to the content covered today, feel free to post them on the blog . Hopefully I'll be able to help out.

I'm currently in Stockholm attending Developer Summit 2007. The first day of the event have been great. Developer Summit is hosted by Cornerstone and isn't your typical Microsoft show. The conference have four parallel tracks; Architecture, .NET, Java and ReMix (the most important topics from MIX07).

The presentation I found most interesting today was Tess Fernandez talk on "Common problems in ASP.NET production environment". The title might not sound too exiting (compared to stuff like "Designing stunning sites with Silverlight"), so this is typically a session I would missed out on a larger conference like TechEd. Debugging isn't my favorite field, but since I lack quote a lot of knowledge and experience in this field I decided to give it a go. And boy am I glad I did! The presentation was amazing. Tess was just hammering through common performance problems and doing some deep dives into the inner working of the CLR and the garbage collector. Really geeky stuff!

Tess didn't use any slides for her presentation, but instead walked us through an ASP.NET app containing some not so obvious (but still quite common) performance pitfalls. Some of the things she covered was managed memory leaks, why you really should use the string builder, why dynamic assemblies can be a problem, how to list all .NET objects in a process and how to find largest one and many other cool tricks. I'm not going to re-iterate her presentation, instead you should check out her excellent blog.

During her presentation Tess did some post-mortem debug analysis using WinDBG (Debugging Tools for Windows), a tool I've never heard of nor used before. But, one thing's for sure, it goes straight into my utility belt! One of the cool things about the tool is that you can xcopy it onto a production environment and debug live ASP.NET applications. You can peek into the process and list stuff like all .NET objects, all .NET objects waiting to be garbage collected, search for large, uncollected objects and so fourth. When you find an object of interest, you can then view it's "raw" content, and find valuable information. You can also store debug information off to a data file for offline post mortem analysis.

Tess should really do a DnrTV episode covering the same things she did in her presentation so that more people could benefit from her debugging kung-fu.

So far the Developer Summit 2007 have been a great event. The atmosphere is relaxed, and people from different camps (Java/.NET) are chatting and sharing experience. It's really fun to attend a conference and talk to other developers about what the technology they're using and the solutions they're building.

Do two plumbers, carpenters, or some other craftsman, speak about the latest tools and technologies relevant to their field with the same passion as two developers meeting at a conference?

The shared passion for software and software development found at places like this are truly inspiring...

Microsoft have a strong platform for doing mobile and embedded development. The Mobile & Embedded DevCon 2007 is a Microsoft conference targeted at developers in the mobile and embedded space. The conference takes place June 25. to 26. in Berlin, Germany. If you're thinking about going you can save €200 by making up your mind before May 18.

The keynote session will be presented by John O'Rourke, the General Manager of Product Management Windows Mobile. There will also be lots of great general sessions covering everything from .NET Compact Framework to Windows Embedded.

If you have a mobile business idea brewing you'll also get a chance to "speed date" with mobile operators and OEM decision makers.

I also assume there will be some cool information on future versions on .NET Compact Framework and off source Silverlight on mobile devices. At MIX07 Scott Holden demoed a mobile version of the Major League Baseball demo running on a prototype version of Silverlight running on a mobile phone. The demo is really cool, and I've included a YouTube video of to get your juices flowing. J2ME feels kind off sad compared to this…

If you want get a sneak preview of what the Mobile & Embedded DevCon 2007 experience is going to be like I recommend checking out the "Backstage at MED" blog which covered the American version of the conference. Embedded Guru Mike Hall also got tons of info and video content from MED US.

I really wish I a chance to attend this conference, but I doubt it'll fit in with my summer holiday plans…

During the Microsoft Desingertopia event in London this winter I got a chance to meet Richard Richtoff, a really nice Swedish dude that at the time worked for Cornerstone arranging the Developer Summit 2007 event in Stockholm 23th to 25th of May. The Designertopia agenda was busy so we didn't get to much time to chat, but we hooked up on Messenger after the event and Richard invited me over to Sweden in May.

I'm really looking forward to the event, and the agenda looks really promising. What separates

Developer Summit from a regular Microsoft show like TechEd is that they're running multiple tracks on different technologies. There four simultaneous tracks on architecture, Java, .NET and ReMix 07. The ReMix 07 track is really interesting and will feature the best sessions from MIX 07 in Las Vegas which takes place the first week of May.

Their speaker lineup consists of quite a few industry heavy weights like Beat Schwegler, Niclas Nilsson and Dan North, and some of the more interesting sessions I'm planning on attending are:

  • "Patterns for code mortals" with Patrik Lövendahl
  • "Migrating Services from ASMX to WCF" with Beat Schwegler
  • "WCF communication patterns: more than request-reply" with Christian Weyer
  • "Dynamic Languages for statically typed minds" with Niclas Nilsson

On the third day of the conference you can attend various interesting workshops. The one that interests me the most is a three hour workshop on Microsoft Silverlight (aka WPF/E).

For my Norwegian readers there is a chance to win Developer Summit conference passes over at the Norwegian .NET User Group site.

If you're planning on going to Developer Summit 2007 drop me a comment!

<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910