Archive

The 'Week of PostSharp' is a joint promotion with Manning Publications where we highlight a new book each day that is special to us and hand-picked by the PostSharp team – with a small introduction about how it connects to what we are doing. We also collaborated with Manning to select a second book for each day of the week, and will be offering our choices at a 50% discount on their site! You can even read excerpts from some of the books online for free by clicking on the links below.

We hope you enjoy the deals! We’ll be adding new posts with the daily discount code throughout the week, so stay tuned.

My favorite feature of XAML is data binding: just bind a XAML property to a property of your model of view-model objects, and they will keep synchronized. That works wonderfully. No code involved – at least if your classes implement INotifyPropertyChanged. And this is where the fairy tale turns into a horror story.

If your object model has anything more than a dozen of classes with trivial dependencies, implementing INotifyPropertyChanged is daunting task that will only result in a large amount of boilerplate code. As any boilerplate code, it will be full of bugs and omissions, and will rarely be subject to systematic unit testing. You may think that this code is a necessary evil, but it is not: it can be reduced to zero – or almost.

PostSharp Model Pattern Library includes a ready-made implementation of the NotifyPropertyChanged pattern. Just add the [NotifyPropertyChanged] custom attribute to your class and you can forget the rest. Designed to cover 90% of all cases, the feature covers properties backed by any number of fields/properties of the current object or of another object, without any boilerplate. The default implementation can be customized by custom code to cover the remaining 10%.

You can use our NotifyPropertyChanged aspect with or without XAML and on any platform as long as you’re using C# or Visual Basic. We’re proposing two books today: Windows App Store Development: C# and XAML and Windows 8 Apps with HTML5 and JavaScript. If you’re going the first way, you can count PostSharp in. But with the second, you’ll be on your own to implement change notification.

Today, we're recommending the following books that you can purchase with a 50% discount - but hurry, the offering is valid only until August 25th, 12 midnight EST:

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: pswkd6

 

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: pswkd6

 

 

 

Next week’s guest on the PostSharp Live Webinar is Donald Belcham, a senior software developer, independent contractor, trainer, speaker and PostSharp MVP.

On Thursday, August 29th (09:00 PT, 12:00 ET, 16:00 GMT) Donald will speak about one of the largest challenges faced on Brownfield projects: adding project-wide functionality to a codebase.

The difficulty comes from the tangled nature of Brownfield codebases. Finding all the locations where the functionality is needed is one thing. The bigger issue is, how do you add the new functionality without altering existing APIs or, worse, introducing defects?

This webinar will look at the techniques and tools that you can use to add functionality to less than inviting codebases.

Attendees will learn:

  • 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

If you’ve ever wanted to learn how to better tame brownfield codebases using AOP be sure to sign-up for the next PostSharp live webinar.

Seats are limited so reserve your spot today

See you there!

-Britt

p.s. – Donald and Kyle Baley’s excellent Brownfield Application Development in .NET book can be purchased with a 50% discount until August 24th, 12 midnight EST, using the code: pswkd5

 

The 'Week of PostSharp' is a joint promotion with Manning Publications where we highlight a new book each day that is special to us and hand-picked by the PostSharp team – with a small introduction about how it connects to what we are doing. We also collaborated with Manning to select a second book for each day of the week, and will be offering our choices at a 50% discount on their site! You can even read excerpts from some of the books online for free by clicking on the links below.

We hope you enjoy the deals! We’ll be adding new posts with the daily discount code throughout the week, so stay tuned.

In a previous engagement before working on PostSharp full time, I inherited a legacy app and was asked to clean it. Apparently, developers that worked on the app before me were afraid of the delete key: at least half of the source code was commented. The code was extraordinarily flat, as if subroutines were a rare commodity. While cleaning the code, I found a method named AppendToList, but the method actually prepended elements at the beginning of the list. I changed the implementation so that it fitted the name, and after a few days of hard cleaning work, the application was compiling again (C for Solaris 7) and all manual tests seemed to work again. It was not before the service got released to production that we figured out that inversing the order of inspection broke the notorious “Brian’s trigger”, several hundred lines of Oracle SQL implementing “workarounds” on the top of the longtime-obsolete order provisioning system, which was not even deployed in our development environment. As a result, we failed to activate services to dozen of customers. This was my most brutal experience with legacy applications.

Aspect-oriented programming excels at dealing with legacy apps. The proof: there is an AOP extension to COBOL. Trust me, it was not the work of some geeks, but of a large company who solves big problems with big money, Hitachi. The reason is easy: AOP allows developers to add features and behaviors to an application without actually modifying this application.

At PostSharp, we’ve always been reluctant to position our product as a “patching” technology. You can fix some bugs in someone else’s product with PostSharp, but we didn’t optimize the product for this use case. However, PostSharp does make it easy to add new features to old apps: for instance caching, logging, or performance monitoring.

For those who got the challenging but unrewarding job of maintaining an old app, we recommend Brownfield Application Development in .NET from Donald Belcham, a PostSharp MVP. The second book promoted today, Continuous Integration, will help you define your development processes so that applications are easier to maintain… and don’t fall so quickly into legacy.

You can now purchase both books with a 50% discount - but hurry, the offering is valid until August 24th, 12 midnight EST:

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: pswkd5

 

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: pswkd5