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.
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.
New-York was just the first stop in speaking season. We already have the following events confirmed in Europe:
- September 23rd, .NET User Group Niederrhein, Wuppertal, Germany
- September 24th, .NET User Group Bonn, Germany
- October 15th, .NET User Group Munich, Germany
- October 17th, .NET User Group Dresden, Germany
- November 5th, .NET User Group London, England
- November 7th, PostSharp Advanced Training Day, London, England
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.
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.
- 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.
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.