SE Podcast #02 « Blog – Stack Exchange

Jeff, I was on the bus listening this morning, and I couldn’t wait to get off it just so that I could tell you (even though you probably already know) that for cross-cutting concerns and patterns you find yourself applying over and over again, like what you describe with your caching, you should really consider using aspects. Seriously, it will make your life easier, and your code more maintainable and pretty.

There are several frameworks for AOP in .Net. I have used (but am not affiliated with) an excellent one called PostSharp (http://www.sharpcrafters.com) that will let you factor your “check if this is in the cache – otherwise go fetch”-pattern out into one single aspect that you can then apply to all the places where you use this. In this way, if you ever need to change your caching strategy, you’ll only need to change the code in one place, rather than in a thousand of them. This also applies for your error handling, your transaction handling, and your performance tracing (guerrilla style). Aspects totally changed my way of coding, for the better.

Love that the podcast is back, can’t wait for next week’s instalment.

http://blog.stackoverflow.com/2011/04/se-podcast-02/

Also huffduffed as…

  1. SE Podcast #02 - Blog – Stack Exchange

    —Huffduffed by markpasc on

  2. SE Podcast #02 - Blog – Stack Exchange

    —Huffduffed by cashman on

  3. SE Podcast #02 - Blog – Stack Exchange

    —Huffduffed by plhw on

  4. SE Podcast #02 - Blog – Stack Exchange

    —Huffduffed by willoller on

  5. SE Podcast #02 « Blog – Stack Exchange

    —Huffduffed by erichaberkorn on

  6. SE Podcast #02 « Blog – Stack Exchange

    —Huffduffed by salle on