After a day of rest and another day of catch-up, it’s good to be back to the normal working life. Britt and I spent the second half of last week in New-York City, combining four events in a single and very compact trip.

Visiting StackOverflow

On Thursday noon, we paid a visit to the team behind the legendary StackOverflow and StackExchange websites. That’s amazing how this company has grown – from 3 just 5 years ago to more than one hundred today. It was so inspiring to chat about their extreme performance concerns and their team/hiring strategies. And frankly, their new office is just glorious with its individual hexagonal private places.

That just let a few hours to check everything was okay for my next talk – just to discover that SkyDrive Pro has deleted my whole slide deck. Not sure how this can happen, but’s it’s better to realize it a bit in advance! Fortunately, VPN connection and the “restore previous version” feature or Windows Server shares saved the day. After all, I’m not so sure we’re ready to move our shared folders to SharePoint…

Speaking at ALT.NET UG

The next stop on Thursday evening was ALT.NET New-York User Group, where I delivered the premiere of a brand new talk – innovative if not provocative – Design Pattern Automation. Challenging misconceptions about design patterns, I demonstrated that it is fully legitimate to automate their implementation using development tools ranging from simple pattern-oriented architecture unit tests to extensible compilers such as Nemerle, and of course to PostSharp. I also defied the usual belief that design patterns are primarily found in books, arguing for an integration of pattern thinking in iterative/agile methodologies. I’d have loved to publish the recording of this talk but unfortunately I failed to push the Record button...

PostSharp Advanced Training Day

On Friday, we delivered the free PostSharp Advanced Training Day, where attendees learned about the vision behind PostSharp and the tools we provide to help customers implement this vision: ready-made design patterns and their implementation details, the aspect framework to build your own aspects and automate your own design patterns, and the architecture framework. The facility, located at the 31st floor on the very bottom of Manhattan – offered a superb sight on the bay.

Speaking at and sponsoring the Code Camp

On Saturday, Britt and me participated to the New-York Code Camp with two talks and a sponsoring table. I opened the day with the talk You Thought You Understood Multithreading, where I attracted a fifth of the audience despite the twelve (!) concurrent tracks. Inspired by the AMD 64 Programming Manual, the Windows Kernel documentation and the CLR Rotor implementation, the talk gave a deep understanding of what actually happens when you’re using the lock keyword and how this maps to the Windows Kernel or to the CPU microarchitecture. Call it pure geekness, but it’s better to understand these things quite deeply if you want to write high-performance multicore applications.

My second talk, Multithreading Design Patterns, started with the observation that multithreading is just too hard to be addressed in a low-level programming language such as C#. These language provide a fair level of abstraction for memory management and procedural organization, but when it comes to multithreading, they not more advanced than assembly language. We have to do the same evolution we did from assembly language to C#, but with multithreading. That is, we need to be able to code against a model – not a memory model, but a threading model. Since a model is made of patterns, I introduced a few threading patterns such as the already-well-known immutable and freezable patterns, but also actor and reader-writer-synchronized.

So, we had these three premieres, and this first delivery of the training day 3.0. And there was this other first time:

Our first sponsor table! Britt and I got help from Matt Groves in what was our first sponsoring. This was a great experience to talk to so many people and see so much enthusiasm. In marketing, it’s hard to figure out if anything pays off so ask us in a few months, but there’s one thing we already know: this was a lot of fun.

What’s Next

New-York was just the first stop in speaking season. We already have the following events confirmed in Europe:

Two or three more dates to be confirmed.

I’ll be looking for more speaking opportunities next year, so if you want me to deliver one of these topics to your favorite UG, please contact me.

Download the slides

My slide decks are available for preview and download on SlideShare. They are not so useful without the narration and code demoes, so we will publish the recordings in a few days. Please contact me if you want to reuse the slides.

Happy PostSharping!


Last week, Donald Belcham joined Gael Fraiteur on the PostSharp Live Webinar to talk about one of the largest challenges faced on Brownfield projects: adding project-wide functionality to a codebase.

Attendees learned:

  • Options for adding non-functional requirements
  • Areas of risk when adding non-functional requirements
  • Use of IL Weaving to add non-functional requirements
  • IL Weaving granularity

Watch the recording and learn the techniques and tools you can use to add functionality to brownfield codebases.


Q: In a greenfield development scenario that is already using IoC, are there any advantages to using the existing container to implement AOP features vs. using IL weaving?

A: The primary benefit of IL weaving is the types of aspects you can create. With Interception you can only wrap public virtual methods. IL weaving allows you to add aspects to events, field variables, property getters/setters, methods, etc.

Q: I have a brownfield project that's 20 years old and was developed using ASP, VB6.0, Windows Services and JavaScript. How do I migrate it to green field?

A: A good place to start is the case study we wrote with the team at Mitchell International, who faced a similar scenario. It demonstrates how they used PostSharp to build several aspects to facilitate integration between their new and old applications. The project was daunting but by adding Activity Logging, Exception Handling, Performance Counters, Thread Dispatching and Data Sync functionality project-wide the team saved from having to write thousands of lines of code.

Q: I used PostSharp OnMethodBoundaryAspect and TransactionScope to replace transaction management in a very large brownfield data access project (SQL transactions). There was a lot of duplicate code removed and all done successfully now - it's much cleaner. The only issue was around code where a rollback transaction was forced (not rolled back implicitly as the result of an exception). Is there a more comprehensive example (beyond the basic TransactionScope enter, exit, dispose, complete) of how other people have gone about this?

A: You could have a static method InvalidateTransaction that would set a thread-static boolean field. In the OnEntry advice, check that field to decide whether the transaction should be committed or rolled back.

Q: How will Roslyn change the AOP landscape in .NET languages like C# and VB?

A: Good things would happen if the compilation pipeline could be made customizable. It could improve Intellisense and compiler support for aspects that introduce new interface implementations, methods, or even full types. Unfortunately, there's no indication this will happen any time soon. Except for these possibilities, Roslyn is not going to be a game changer.

The 'Week of PostSharp' is a joint promotion with Manning Publications where we highlight important books from their catalog each day and show how they connect to what our team is doing.

If you came late to our posts this week and missed your chance at a deep discount on one of the featured books, today is your lucky day!

To wrap up the week, we're offering a discount on every book title mentioned during the Week of Postsharp. Purchase any of the books highlighted in this post with a 50% discount - but hurry, the offering is valid only until August 26th, 12 midnight EST.

Enjoy the deals!

Windows Store App Development introduces the Windows 8.x app model to readers familiar with traditional desktop development. You'll explore dozens of carefully crafted examples as you master Windows features, the Windows Runtime, and the best practices of app design. Along the way, you'll pick up tips for deploying apps, including selling through the Windows Store.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following code: pswkd7


Windows 8 Apps with HTML5 and JavaScript provides a comprehensive tutorial for web developers who want to build Windows 8 apps using development tools familiar to them. It's also a great way for a C#/XAML developer to add a few new tools to his or her belt. This practical book provides expert guidance on application design, so you'll learn the emerging patterns and practices for making apps that will work equally well on phones, tablets, and standard screens. Along the way you'll pick up tips for monetizing your apps and deploying to the Windows Store.

Download Free Chapter (PDF)   |  Purchase with 50% discount using the following code: pswkd7


Brownfield Application Development in .NET starts by laying out the unique characteristics of brownfield apps—both negative and positive. It then systematically explores how you can employ well-established techniques like continuous integration, version control, and automated testing, even if they weren't part of the original dev process. You'll learn techniques to identify logical layers and tease apart dependencies to effectively separate concerns for improved flexibility. This practical book will help you improve not only your application's maintainability, but also the team's confidence in the project.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following code: pswkd7


Continuous Integration in .NET shows you how to reimagine your development strategies by creating a consistent continuous integration process. You'll use Visual Studio along with tools like Subversion, MSBuild, TFS, TeamCity, NUnit, and Selenium. And because CI is as much about the culture of your shop as the tooling, this book provides clear guidelines for starting and maintaining projects, along with metrics for measuring project success.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following code: pswkd7


DSLs in Boo shows you how to design, extend, and evolve DSLs for .NET by focusing on approaches and patterns. You learn to define an app in terms that match the domain, and to use Boo to build DSLs that generate efficient executables. And you won't deal with the awkward XML-laden syntax many DSLs require. The book concentrates on writing internal (textual) DSLs that allow easy extensibility of the application and framework. And if you don't know Boo, don't worry—you'll learn right here all the techniques you need.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the code pswkd7


ASP.NET MVC 4 in Action is a hands-on guide that shows you how to apply ASP.NET MVC effectively. After a high-speed ramp up, this thoroughly revised new edition explores each key topic with a self-contained example so you can jump right to the parts you need. Based on thousands of hours of real-world experience, the authors show you valuable high-end techniques you won't find anywhere else. Written for developers, the book arms you with the next-level skills and practical guidance to create compelling web applications. You need some knowledge of ASP.NET and C#, but no prior ASP.NET MVC experience is assumed.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following discount code: pswkd7


ASP.NET in Practice distills over 100 practical ASP.NET techniques from the experience of a team of MVPs, and puts them right at your fingertips. The techniques are tested and selected for their usefulness, and they are all presented in a simple problem-solution-discussion format. You'll discover methods for key new subjects like data integration with Entity Framework and ASP.NET MVC. Along the way, you'll also find ways to make your applications fast and secure.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following discount code: pswkd7


AOP in .NET introduces aspect-oriented programming and provides guidance on how to get the most practical benefit from this technique. The book's many examples concentrate on modularizing non-functional requirements that often sprawl throughout object-oriented projects. You'll appreciate its straightforward introduction using familiar C#-based examples.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the discount code pswkd7


AspectJ in Action, Second Edition is a fully updated, major revision of Ramnivas Laddad's best-selling first edition. It's a hands-on guide for Java developers. After introducing the core principles of AOP, it shows you how to create reusable solutions using AspectJ 6 and Spring 3. You'll master key features including annotation-based syntax, load-time weaver, annotation-based crosscutting, and Spring-AspectJ integration. Building on familiar technologies such as JDBC, Hibernate, JPA, Spring Security, Spring MVC, and Swing, you'll apply AOP to common problems encountered in enterprise applications.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the code pswkd7


C# in Depth, Third Edition updates the best selling second edition to cover the new features of C# 5, including the challenges of writing maintainable asynchronous code. It preserves the uniquely-insightful look into the tricky areas and dusty corners of C# that only expert Jon Skeet can provide. In this third edition, you'll see the subtleties of C# programming in action, learning how to work with high-value features that you'll be glad to have in your toolkit. The book helps readers avoid hidden pitfalls of C# programming by providing crystal-clear explanations of "behind the scenes" issues.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following code: pswkd7


The book Real-World Functional Programming teaches the ideas and techniques of functional programming applied to real-world problems. You'll see how the functional way of thinking changes the game for .NET developers. Then, you'll tackle common issues using a functional approach. The book will also teach you the basics of the F# language and extend your C# skills into the functional domain. No prior experience with functional programming or F# is required.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the following code: pswkd7