Thinking in a document centric world with RavenDB @ ALT.NET

Last night (25th Feb 2014), I presented on RavenDB at ALT.NET Melbourne.

I got some great feedback from the audience and was happy to share my experience so far with RavenDB. If you were there / watch the recording and have some suggestions good or bad would love to hear them so I can improve.

Here’s the ALT.NET recording with slides, plus me up at the projector screen.

If you just want the slides and audio then here’s an alternate recording.

I’ve also put the slides up on slide share.

Exceptions in (my) LINQ (presentation)

Last night I presented to the Melbourne Patterns & Practices group, thanks to my audience for paying attention, having great input and asking interesting questions. I would like to clarify some things I glossed over in the powerpoint slides, and explain why some of the simple extension methods didn’t execute in the live code demos. I also have posted the pptx file here.

The first thing that I did not give a detailed enough explanation about was the Exception Handling slide where I was using the ‘let’ keyword in a LINQ statement. The question was along the lines of the benefit of the exception handling offered up by making use of let in a LINQ query. To clarify this, the let keyword is used to create a contextual keyword as part of the LINQ query (a Range Variable). This range variable can then be used to create an anonymous type using projection. I incorrectly tied the explanation of let to the point I was trying to make about handling exceptions. The key take-away is that because the query is a deferred execution any exception handling needs to be wrapped around the code that performs the execution. So have the Try {} Catch (E ex) {} surround the processing code not the query definition.

There’s a great post about using ‘Let’ in a LINQ Query by Greg Beech that goes into greater detail. This topic lead to a question about what would happen to processing when an exception did occur.

Another issue that came up during live code tweaking was making use of certain extensions, in particular .Reverse() didn’t seem to compile. I am unable to recreate the issue quite possible some weird state in Visual Studio 2010 Beta 1, if that was the case then the clean and rebuild was the solution.

But here is the final very simple code that reads a directory and outputs the file names in a reverse order:

var xmlFilesQuery = 
      from fileInfo in 
      where fileInfo.Contains(".xml")
      select fileInfo;

foreach (var fileName in xmlFilesQuery.Reverse())

The last clarification point was a scenario where the PLINQ execution of a task compared to it’s LINQ execution offered up a speed up of 2.18 times. Not sure what state the application was in to allow that. I’ll do some investigation and based on how complex the cause was either update here or create a new post.

Greater Than 2x Speed Up (On Dual Core Machine)

Greater Than 2x Speed Up (On Dual Core Machine)