Friday, November 8, 2013

Video of My ØreDev Talk is Up

I'm still at the ØreDev 2013 conference were I did a talk called "Layers Considered Harmful" 2 days ago, and already the video is up. So without further ado; enjoy :-)


Thursday, October 31, 2013

Instant Nancy Web Development Giveaway


I have 5 ebook copies of my Nancy book to give away in a raffle.
To enter the draw simply share this link - http://www.packtpub.com/nancy-web-development/book - on Twitter or G+ along with the hashtag #InstantNancyFxBook before Thursday the 7th of November when I will draw 5 random winners. I will contact the winners through Twitter or G+ to get the email they want to receive the book at.

In case you're wondering what the book is about here is the appetizer from the publisher's site:

Nancy is a C# web framework which aims to provide you ,the application developer, with an easy path to follow, where things will naturally fall into place and work. Nancy is a powerful, flexible, and lightweight web framework that allows you to get on with your job.

Instant Nancy Web Development will give Readers practical introduction to building, testing, and deploying web applications with Nancy. You will learn how to take full advantage of Nancy to build clean application code, and will see how this code lends itself nicely to test driven development. You will also learn how to hook into Nancy to easily extend the framework.

Instant Nancy Web Development offers you an in-depth exploration of all the major features of the Nancy web framework, from basic routing to deployment in the Cloud, and from model binding to automated tests.

You will learn how to build web applications with Nancy and explore how to build web sites using Razor views. Next, you will learn how to build web based APIs suitable for JavaScript clients, mobile clients, and even desktop applications. In fact, you will learn how to easily combine the two into one.

Finally, you will learn how to leverage Nancy to write clean and maintainable web applications quickly.

Saturday, October 26, 2013

Supporting Single Sign On In Your Nancy Applications

In enterprise application the requirement for single sign on is common: Users are already authenticated against the domain controller - they don't want to jump through another authentication hoop to get access to your particular application. Setting this up in ASP.NET using WIF is some pretty easy web.config gymnastics and described elsewhere. The result of this setup is that the current principal on authenticated requests is a ClaimsPrincipal identifying the user in terms of the claims setup for him/her in the identity provided (e.g. your organizations Active Directory).
Below I show how to integrate the WIF authentication setup with your Nancy application - It doesn't take much, but lets run through it anyway. In fact only 2 small classes are needed. First we define a user type that implements the IUserIndentity interface expected by Nancy, by pulling the necessary information out of the current claims principal:

The second thing we need is set the current user on the NancyContext for each incoming request. We do this by hooking into Nancys request pipeline with a Before hook. We can do this directly in our Nancy applications bootstrapper or in a separate type implementing IApplicationStartup (Nancy automatically finds and executes these at application startup). This is how it's done with the IApplicationStartup approach:

That's it. Now your modules can start using the Context.CurrentUser and take advantage of Nancys authorization helpers.

Update: As kindly pointed out by Damian Hickey this will not work if you host your Nancy application on OWIN. So to be clear: I have only tested this when hosting on ASP.NET. The fact that it will not work on OWIN, means that the approach has the drawback that it leaks knowledge of the host to the application level. Specifically to the SetUser class.

Thursday, October 10, 2013

Why Not Use Custom Visual Studio Project Templates?

I got this question about the Nancy book the other day on twitter:

The answer I gave was just a bit of hand waving in the general direction of the question:

While it is true that, that is my preference, there is not much by way of explanation in that answer, so I'll try to explain a little more here.

Pre-baked project templates are there to help developers out. They are a way to get quickly up and running with a fully setup project. With some of the heftier templates everything is there from dependent assemblies, configuration files, and folder structures to skeleton code. Basically some template provide a full wlaking skeleton. Just like that. Click, click, click, and you're done.
I don't like that as a starting point for a code base. It's too much and the odds of such complete templates fitting just right to the project at hand are in my experience minuscule. So you end up changing the setup that came with the template. This is a battle I don't want to be fighting. Firstly because it will quickly off set any initial gain won by getting quickly up and running using the template, but secondly and more importantly because it is battle against accidental complexity that should never have been there in the first place. This is the wrong way around. We want to start out small and then only build up more stuff as it becomes needed. Not before, and definitely not from the get go. I saw a nice talk on the benefits of this at GOTO last week, the gist of which was how keeping it simple enabled evolving from a very simple - almost simplistic - initial system to a full blown system without loosing speed or ending up with a mess. In fact although not about agile that was the best talk on agile I've seen in a while.

How about smaller templates then? I like them a little better, but only a little. At the end of the day they suffer from the same problems.

How about really small focused templates? Those I can live with because there is so little left that there is a chance that it actually fits my situation, and if not the battle to overcome the template is small.

How do I prefer it then? In fact I'd prefer it if Visual Studio did not require project and solution files, but was able to just run off the build files I wrote - be it rake, psake, nant or even MSBuild. Since this is not the case the next best thing is starting off with an empty project template. That is the minimal amount of initial complexity. Then after that I can add the packages I need. With each of them I add some complexity too, but it is the complexity I've deemed worth while.

Of course there is a lot of gray scale here: When is a template close enough to empty? When does a NuGet package become a complete project template? These are case-by-case judgements that you will have to make for yourself.

Tuesday, October 1, 2013

GOTO Day 2

Yesterday I was somewhat disappointed. Today the GOTO I know and enjoy is back!

The day is not finished, but I can already say I learned stuff today. I went to the two web security talks. For a while now I've gone to the security talks at the conferences I go to and it seems to me that the signal to noise ratio is generally low at these talks. I think that this is to some extend because both speakers and conferences assume that the audience sees security as boring, so they try to make security digestable by disguising it, wrapping it in gags etc. All of which risks to detract from the actual content.
Both the web security talks at GOTO today were well worth going to, though. The first talk by Aaron Bedra was about spotting attacks by looking at the behavior of clients and the second by Niall Merrigan was about defensive programming. Both were good, but I will focus on the first.

Aarons talked about how you can have your web server keep an eye out for suspicious behavior. Suspicious behavior could be a number of things, like a client doing only HTTP POST requests, clients originating from countries that your site is not aimed at or clients making requests that do not look like the requests created by the browser indicated by the user agent. Each of these behaviors are only indicators though, but if a combination of them are present you are likely seeing an attack. Such a combination is a signature.
Taking this a step further Aaron talked about how you can profile clients based on these signatures and identify clients that are likely rogue. Once identified another part of the system can take the appropriate action, which can range from simply rejecting the client with e.g. 403s over just introducing extra hoops to jump through (think CAPTCHA or security questions), to just flagging the the client and store thee information for later analysis.
Lastly Aaron talked a bit about the framework he created for dealing with these sorts of things; RepSheet, which I do hope to find the time to look into some more.

That's it for today except for this: If you're at GOTO tomorrow you must go to Bodil Stokkes talk, otherwise you're doing it wrong :)

Monday, September 30, 2013

GOTO Day 1

Day 1 of this years GOTO Aarhus is drawing to an end. It's time to recap. As always at a large conference there are a lot of things going on at once. So I may just have missed the action. But, well, to be honest I didn't get enough bang for the bug today. I had a hunch this was going to be the case today because too much of today's program seemed to be either too much talk and too little code for my taste or to be really introductory.
On the other hand there were highlights:
  • Phil Calcados Javascript talk. Phil has been involved in recruiting at Soundcloud for a few years. As part of the interview process Soundcloud has candidates submit code in whatever language the candidate wants to. Interestingly Phil observed that a very high percentage of the submission done in Javascript were rejected, and the candidates did not make it to the next round of interviews. Submission in other languages did better. It is also noteworthy that there were actually a large percentage of the submission that were in Javascript - so the high rejection rate does not seem to be an artifact of sampling size. Phil talked about some of the problems in the Javascript submissions, what could be done about them and ventured guessed at why Javascript stood out in this way. Interesting stuff. 
  • Mogens Heller Grabe's Rebus talk was by far the best talk of the day for me. It was concrete, had lots of code and it put some conplicated architectural ideas into fairly simple terms. Mogens talked about distributed system, anchoring the discussion firmly in reality by doing live demos of the patterns and by exmplifying based on his personal experience working with real clients. Great!


The part keynote will in a few minutes. So I'm off :)

Sunday, September 29, 2013

The "Instant Nancy Web Development" Book

After a quick six month writing and editing process my Nancy book is published. It's available as e-pub, mobi, pfd and dead trees via the publishers site as well as Amazon, Amazon UK, and Safari.

What's it about?
Well, it about the Nancy web framework. Nancy is an awesome .NET based web framework that focuses on being both easy and fun to work with. Nancy lends itself to writing highly testable web application with simple, concise and readable code. Who doesn't want that?
The book starts from the very basics of getting Nancy up and running, but quickly moves into more interesting areas including dependency injection, hosting, content negotiation, authentication, async processing and more. Check out the full table of contents at the publishers site.

Who's it for?
The reader I've had in mind is a .NET oriented backend developer who values clean testable code and who is curious about what all the fuss around Nancy is about. It's a short book, so it is also a quick read and a quick way to get into a whole bunch of Nancy topics.

Why did I write it?
There are a number of reasons I wrote this book. I'll only talk about a few of them here. Starting from the egotistical side @thecodejunkie nailed it on jabbr: "It's about bragging rights" :-) I have to admit there is truth in that.

Another reason is that I really think Nancy deserves having a light shone on it, and I believe a book is one way to do that.
I believe a book can reach another segment of developers and architects than Github wiki, blogs and demo applications. The book hopefully wont be the end stage for those developers and architects, but rather the gateway to the Github wiki and even the Nancy source code, which is so readable that it actually is a fine source to learn Nancy from.
I also think a book can lend a sense of legitimacy to an OSS, which may help a little bit with getting through the gate into enterprises. @cranialstrain expressed this well on twitter the other day.

Saturday, September 21, 2013

Impressions from Software Architecture Open Space 2013

We ran the 2013 edition of the Software Architecture Open Space conference (SAOS) this past Thursday, and once again I am amazed how well the open space format works. Everybody there were both highly knowledgeable and keen to share. The combination is a goldmine of learning opportunity.


Topics
The topics covered this year were quite diverse. Ranging from the particulars of Docker.io to the most effective place in an organization for an enterprise architect to work.


Since there were up to 7 seven sessions running in parallel I did not participate in all discussions. Even so just looking at the topics I had the chance to discuss paints a broad picture: "Event Sourcing in practice", "Modeling in NoSQL DBs", "How to Build an Architecture that Enables Flow in Development", "Reactive Manifesto", "NoProcess Development", "Architects and Organizations" og "The Value of Contributing in Open Source".


Take Aways
What one takes away from an event like SAOS obviously vary a lot lot from person to person. Personally the main points I came away with were:
  • I am not the only one that thinks that lean thinking can be applied to software architectures, not just organizations and processes. Hallelujah I am not alone :-P
  • Confirmation that Continuous Delivery is slowly but steadily becoming mainstream
  • A better understanding of the role of Enterprise Architecture in large organizations (and confirmation that EA is not for me)
  • Lots of new good contacts
  • Insights into concrete experience with introducing event sourcing to a team and which type of common hiccups to expect

Saturday, September 14, 2013

Eyes Forward?

Over next couple of weeks I'm attending two conferences. Two very, very different conferences. The first one is the Software Architecture Open Space 2013 (SAOS) and the second is GOTO Aarhus.
  • GOTO is a traditional conference where there is a divide between those who contribute content - the speakers - and those who consume - the attendees. SAOS is not traditional and completely erases that divide by demanding all attendees to contribute.
  • The GOTO format is well known: The speaker prepares a talk based on his/her experience and expertise. The attendees flock into a room, sit down and listen for an hour - all facing toward the speaker. The SAOS format is less well known: Nobody prepares content beforehand, but everybody contributes to it during the conference. Session topics are found through brainstorming and agreed upon progressively throughout the day. For sessions attendees flock into a room, sit down and discuss for an hour facing each other.
  • GOTO is big - lots of people, lot of tracks. SAOS is small - about 50 people, as many tracks as emerge.
  • GOTO is well publicized. SAOS is invite only.
  • GOTO focuses on teaching attendees about ideas or technologies that the speakers already know about. SAOS focuses on finding and developing ideas and techniques.
  • At GOTO the networking happens in the proverbial hallways and at the social events. At SAOS networking happens just as much during the sessions.
It will be interesting to get to go these events almost back-to-back. I expect the two to be very different, but I also expect to learn a lot at both.

It is also interesting that GOTO has a fish bowl session on Tuesday. A fish bowl is in the same vain as the open space format used at SAOS. Whether it really works in such a large setting will be interesting to see.

And, by the way, in case you are wondering, SAOS is the successor to the Agile Architecture Open Space Conferences I've run the last two years. This time around I've had the good fortune of getting invaluable help from some awesome partners in crime (Nikola Schou-Pedersen, Jeppe Cramon and Jakob Bendsen), and I think the conference will even better this year.

Sunday, September 8, 2013

Playtime: Riak, Azure, F#

Sifting through the programme for this years GOTO conference one of the talks I thought I'd go see was the one on Riak in the big data track. This is not a new topic at GOTO. In fact I've seen several really good Riaks talks there (like the Riak on mobiles one, that has also been at GOTO). Each time I've gone out of the talk thinking "I've gotta play around with Riak! It's cool." This time around I thought I'd start the playing around beforehand, with the added benefit that I have a bit more context coming into this years Riak talk.

What follows is a short account of my Hello World level experiences of getting Riak up and running on Azure and talking to it from a bit of F# sharp code.

Riak on Azure
As someone who works mostly on Windows the first thing I ran into with Riak is that there is no Windows option on the downloads page - it's different Unix flavors all the way through. Not worry though, in the cloud age spinning up a new Unix box is easy. As it turns out getting Riak on there is pretty easy too (just a few curl commands and that's it): I just followed the step-by-step guide to running Riak on Azure. The guide is little bit out of date with regards to the screenshots from Azure, but nothing that will trip you. The stumbling block was the very last curl command in the guide which is

curl -s http://rekon.basho.com | sh

but http://rekon.basho.com just gives you a redirect to a page on github. It's not a hard stumbling block though; you just follow the redirect and put in this command instead:

curl -s https://raw.github.com/basho/rekon/master/download.sh | sh

At this point I had a VM in Azure running Riak. I was able to put data into it and read it again through Riaks HTTP API simply using more curl commands.

Talking to Riak with F#
The basics of Riaks HTTP API are pretty easy - HTTP PUT to create a new key-value pair in a bucket, HTTP PUT to modify existing values, and HTTP GET to read them - but even doing that with curl gets a bit cumbersome pretty quickly. So here is how to talk to Riak with F# code using xUnit as an execution container.

First, checking the Riak cluster is even reachable can be done by pinging it like this:


Moving on to adding a key-value pair and implicitly creating a bucket too looks like this:


Finally reading data out again looks like this:


And that's it for getting data in and out of Riak from F# code.

Sunday, September 1, 2013

From Fact to Theory

I often find that the tests I write can be slowly generalized as the feature I happen to be working on is fleshed out. In xUnit.net terms I find that a fair number of the tests tend to move through these four stages:
  1. Start out as a single [Fact], working on hardcoded input data
  2. Pull out the hardcoded data, turning the tests into a [Theory, AutoData]
  3. Add edge cases, evolving the test into [Theory, AutoData, InlineData, InlineData]
  4. Add cases representative of equivalence classes, thus adding more InlineData attributes to the test
Each of the stages generalizes the test a bit more making it more potent in several ways. As the test moves through each stage it gains greater coverage in terms of the possible inputs, making it a better regression guard. But there is more at play. Along with the generalization (and multiplication) of the inputs the test can often be refactored towards being more about the behavior of the SUT and less about its implementation. So alongside the four stages above I find tests tend to move through these stages as well:
  1. While being a [Fact] the test is named something very specific - a specific example of how the SUT should behave
  2. During stage 2 or 3 the test name becomes something that expresses a general trait of the SUT
  3. The assertions in the test becomes less dependent on implemntation details
I am not always able to make my tests follow either of these progressions, but when I am I find it very rewarding.

Thursday, June 27, 2013

My Nancy Talk from NDC

The video of the talk I did on Nancy at NDC is out.

The talk me writing some Nancy code, talking a lot about Nancy and at the end I have a simple todo application.

Enjoy!


Wednesday, June 26, 2013

A Belated NDC Roundup

NDC is well over. It was lots fun. Great chit-chatting with folks and some good talks as well. So what stuck? Which talks do I actually remember here couple of week later? For me it was mainly these 3:

  • Sebastian Lamblas talk on caching in HTTP. The guy knows his stuff and he can explain it too. On the surface of things caching in HTTP may sound like small topic, but it turns out there is more to it than meets the eye. Useful stuff for anybody building web apps (be it internal facing or public facing)  with any significant load.
  • Don Symes talk on F# type providers. Type providers are a cool concept. If you haven't checked them out you should, and this talk is a good place to start, although you probably need to know basic F# to get the most out of it.
  • Jonas Winje, Einar W. Høst and Bjørn Einar Bjartnes talk on drones and Rx. This was a really fun talk packed with breakneck demos stacking Node.js, Rx, Roslyn, Lisp, Nancy, a drone and probably a few other things I've forgotten on top of each other. Mixed in with all the fun and games where some good sound technical content especially around reactive programming.
There were other good talks, but these are the ones that mostly stuck in my mind. I'd recommend watching them when the videos come out.

Monday, June 3, 2013

NDC is just a week away

In just over a weeks time I'll be in Oslo for NDC. I'm doing an introductory Nancy talk on Friday. It will actually not be a whole lot of talk, but rather a fair bit of coding: I have just one slide, the rest will be me coding up a simple Nancy application in test first manner. Should be fun - I know it was at Warm Croc.

Apart from doing my own talk I'm looking forward to watching some of the other talks there too of course. Glancing through the program these particularly stick out to me, and are talks I'll make it to:

  • Don Symes two F# talks on Wednesday. This is perfect timing for me. I've gotten serious about learning F# over the last few month and am ready to get the inspiration to dig deeper.
  • To top off my functional programming geek out Wednesday I will end the day at the .NET Rocks Functional Programming panel.
  • Thursday I'll be focusing on the security talks in room 3.
  • My Thursday will start with more F# in Simon Skov Boisens Agents talk
  • Friday is when I'm doing my own talk which means I'll be getting ready before the talk and popping into random talks afterwards.
Hope to see you there!

Friday, May 3, 2013

PowerShell, Tests and CI/D

Maybe you have an ASP.NET web site, and maybe you have a collection of PowerShell modules used for various automation tasks, like moving files between environments, kicking off batch processes, moving assets to the your CDN or similar things. If so these bits of PowerShell contain important bits of logic; if they don't work your site doesn't work properly.

Naturally you want to apply the same discipline to the PowerShell code as to any other production code, which includes TDD and Continuous Integration/Delivery/Deployment (CI/D). Furthermore I'll assume that you already have tests around your C# code, and that your CI/D setup runs these tests and reports the result.

In this situation you can TDD by writing test functions in the PowerShell modules themselves and call them from the command line. This, of course, becomes tiresome quickly as the number of tests rise, so you'll soon find yourself  writing ad hoc test runners for each PowerShell module. This works. Sort of. But it's still tiresome to run the tests selectively, and just as importantly, this doesn't fit into your CI/D setup which is geared towards your xUnit (or similar) test suites.

One quick and simple way to get around this issue is to write the tests in C# just as any other tests and simply call the PowerShell from there. Like so:



This isn't perfect:

  • It's somewhat slow. 
  • The call out to the PowerShell under test is tugged away inside a string.Format call
  • The tests and the code under test are written in different languages, which doesn't sit well with me. It introduces an odd asymmetry and it creates an artificial barrier between the tests and the code under test.
The big win on the other hand is that it fits right into your existing TDD and CI/D setup.

Monday, March 18, 2013

Hello Nancy World in F#

As you may noticed (if you follow this blog or go to the same conferences as me) I really like the Nancy web framework. So naturally, since I've decided to finally learn F# properly, I threw together a hello world Nancy app in F#. It's very simple; the complete code is listed below. All I did was create an F# console application, install the Nancy and Nancy.Hosting.Self NuGet packages and type in this code, which will return the string "Hello" if you point your browser to "http://localhost:8888/nancy/":



So what's going in that code? Fist thing to notice is the type HelloModule which inherits NancyModule. On start up Nancy will pick up all NancyModules and run their constructor. In it's constructor HelloModule sets up a single route, "/", and tells Nancy what to do on a HTTP GET to that route, namely to execute a lambda that always returns "Hello". Lastly, since this is self hosted, there is a bit of setup in the "main" function: A Nancy host is instantiated, told where to listen for requests and started. This will make the Nancy self host start up Nancy and start listening for requests. That's it. Short and sweet.

Wednesday, March 13, 2013

More OO Around That Island of Functional

In my last post I showed how C# seamlesly supports having little functional islands inside an otherwise OO code base. I did that using a simple object model, in which one of the objects was implemented in a functional manner. The other objects, though, were just data containers, really.In that post I made the off hand remark that these could be better encapsulated. In this post I'll address this, and also show that the "other" objects could easily have more behavior as well. All-in-all this brings the example closer to the original intention: To show how the overall design can be OO, but the insides of individual classes can be functional.

The classes involved were CourseTemplate, Course, Registrant and CoursePlan. The example is to create a course plan, where registrants are placed in in courses bsed on which course they wish to take.

Slightly Better Encapsulation

To get to a more object oriented design the first step is to move away from simple auto properties with public getters and public setters to a least have private setters. Using CourseTemplate as an example this simply means moving to this:


Adding Basic Domain Operations

Nest step is to start adding basic domain operations that make the objects have just a little bit of actual behavior and some more encapsulation. To illustrate lets add a method for wishing courses to the Registrant class, and lets also add an override of equals that makes more sense from a domain perspective:


Adding other Behaviors

We're getting the hang of this. Let's add the same type of basic domain methods along with a few other (made up) methods to the Course class:


By adding Register, IsFull and IsEmpty some responsibility is being moved from the CoursePlan version in the last post to the Course - which makes much more sense. By adding Start and AwardDiplomas I point toward the fact that these classes can have more behavior if we need it.

The Functional Island is Still Functional

Despite these changes the CoursePlan doesn't change all that much. The places the implementation has changed is where the new methods on Course are used. The implementation is still just as functional:



Conclusion

The functional islands I talked about in the last post can easily exist in a truly object oriented code base.


Thursday, March 7, 2013

On Functional Islands in Obejct Oriented Code

This post is a comment on some of how Brian Marick outlines how to embed functional code in a object oriented code base in his book "Functional Programming for the Object-Oriented Programmer". An excellent book for anybody moving into FP from OO, by the way. I definitely recommend it.

TL;DR

I feel that the best way to embed functional islands in an OO code base is to have certain classes be fully OO on the outside and as functional as you can get them on the inside. Doing so in a multi-paradigm language like C#, the bridging between the OO realm and the FP realm can become seamless.

Functional Islands


Brian uses a drawing like this one in his book to explain that functional code can live within an OO structure, and can be used by the OO code via a couple of bridges; one transforming an object graph to a data structure more suitable for the functional code, and one doing the opposite transformation. This bridging is done because functional code tends to work more on data than on objects - typically contained in general data structures like lists or sets. 

This makes sense; the OO world has one way of modeling and the FP world has another way. To move between them some bridging is needed. The book goes on to show an example of this, where some Java code calls into some Clojure code. But before and after the functional Clojure code runs, the bridging occurs. Each bridge is simply a Java method that does the required transformations; simple but tedious code.

I can sort of recognize this pattern from my own C# code, but only sort of. What I usually have when I embed functional code in otherwise OO C# code is that certain classes expose an OO interface to the rest of the code base, but are implemented in a functional style. To demonstrate this I've taken the example from Brians book and sketched in C#.  The rest of this post walks through that code.

Example

The example i: Given a number of courses that run either morning or afternoon, a fixed number of intructors that can teach any course, and a number of registrants that have wishes for which courses they want to attend find a solution.

First off here is the C# code for the OO strucutre Brian uses in his book:


just a few stupid classes - these should probably be better incapsulated, but that is not really the point here.

The solution I want to end up with should be an instance of this class:


To get there the CoursePlan class is used. This is the class that is implemented in a functional style - or to be honest a somwhat functional style: It represents its state as a couple of lists, and does it's work by applying functions to these lists. Moreover it uses functions that work lazily. That's functional. On the other hand is mutates the state of objects inside it lists. In other words it has side effects. Not so functional. All in all I thinks it's fair to say CoursePlan is implemented in a functional style.

To use CoursePlan I do this:


I just create a new CoursePlan and pass in a course list, registrant list and the number of instructors. Notice the CourseList and RegistrantList? -Those are domain specific collections. By which I mean domain objects like any other that happen to implement the domain notions of "a list of courses" and of "a list of registrants". Having such domain specific classes instead of List<Course> and List<Registrant> in my experience leads to cleaner OO code, and is something I usually advocate.

So where does the bridging from OO to FP go on? Well that's the point it's almost not there: The bridging is taken care of simply because the two domain specific collections - CourseList and RegistrantList - implement IEnumerable<Course> and IEnumerable<Registrant> respectively.

The code for CoursePlan is pretty trivial, but here you go anyway:


Conclusion

In conclusion I feel that the best way to embed functional islands in an OO code base is to have certain classes be fully OO on the outside and as functional as you can get them on the inside. Doing so  in a multi-paradigm language like C#, the bridging between the OO realm and the FP realm can become seamless.

Monday, January 7, 2013

I'm becoming an independent consultant

I'd like to announce that as of the 1st of February I'll be an independent consultant.

I've been with Mjølner Informatics for the past almost 6 years and thoroughly enjoyed the work as well as the colleagues there, but the dream becoming my own boss* has been taking over more and more of my spare brain cycles for a while, so now seems like the right time to try to make that happen.

I'm aiming to find gigs as a developer and/or architect focusing mainly web and enterprise solutions built on the Microsoft stack - that is, .NET, Azure, Windows 8, Windows Phone, SQL Server and on - but not limited to Microsofts offerings, I focus equally on great open source or 3rd party products - like Nancy, AppHarbor and RavenDB . So please don't hesitate to contact me if you have something along those lines to discuss :-)
I also offer developer training and mentoring in craftsmanship topics such as TDD, refactoring, continuous integration, object oriented design and functional programming, as well as more technology focused topics like Nancy, C# and Windows 8. Again: Please don't hesitate to contact me if you're interested in tailor made developer training or mentoring.

To get in touch send me an email, find me on twitter or find me on linkedin and I will get back to you as soon as possible.










*Or rather pretending to be my own boss, while my clients are the real bosses.