Aspect Oriented Programming

AOP — Enforce initialization with PostSharp

Oh, the Pain! Now and again we all come across an object which requires ini­tial­iza­tion before it can be used but with noth­ing there to stop us from try­ing to use it before it’s ini­tial­ized. In most cas­es you will get a seem­ing­ly unre­lat­ed excep­tion (e.g. null ref­er­ence when the object tries to use some …

AOP — Enforce ini­tial­iza­tion with Post­SharpRead More »

.Net Tips — Restricting attribute usage to specific type

Before you get your hopes up, sor­ry, there’s no built-in sup­port to allow you to restrict the usage of your attribute to a type eas­i­ly. That’s not to say that it’s impos­si­ble though! If you’re read­ing this, I assume that you’ve tried to write a cus­tom attribute your­self and realised that the options avail­able in …

.Net Tips — Restrict­ing attribute usage to spe­cif­ic typeRead More »

AOP — FIFO Memoizer with PostSharp

Back in my first post on AOP, I men­tioned the Mem­o­iz­er on D. Patrick Caldwell’s blog, well, today I came across a sit­u­a­tion where I was able to use it but first I need­ed to make a few mod­i­fi­ca­tions because the orig­i­nal imple­men­ta­tion didn’t sat­is­fy some of my require­ments: There is no cap on the …

AOP — FIFO Mem­o­iz­er with Post­SharpRead More »

AOP — Method execution time watcher with PostSharp

I found a nice usage of AOP the oth­er day, using AOP to keep track of how long your method takes to exe­cute and log a warn­ing mes­sage if it takes longer than a thresh­old you sup­ply. You can con­fig­ure it to log exe­cu­tion times or only flag warn­ing entries when threshold’s been exceed­ed.

Buzzword Buster — AOP

Def­i­n­i­tion: Aspect Orient­ed Program­ming (AOP) is a pro­gram­ming par­a­digm where each appli­ca­tion can focus on its pri­ma­ry func­tions and core con­cerns by encour­ag­ing greater mod­u­lar­i­ty and increas­ing sep­a­ra­tion of cross-cut­t­ing con­cerns (such as log­ging and authen­ti­ca­tion). Pur­pose: In any real-world appli­ca­tions, when you’re writ­ing code to address the prob­lem domain (say, book­ing an order) you …

Buzz­word Buster — AOPRead More »

Less is MORE

Just fin­ished watch­ing an inter­est­ing sem­i­nar video by the guys from Object Men­tor (a con­sul­tant com­pa­ny found­ed by Robert C Mar­tin, the father of agile devel­op­ment) at: The video is about an hour long and cov­ered a large num­ber of top­ics around using dif­fer­ent lan­guages (poly­glot) and dif­fer­ent pro­gram­ming par­a­digms (poly-par­a­digm) to sim­pli­fy and …

Less is MORERead More »

Buzzword Buster – Cross-Cutting Concern

Def­i­n­i­tion: A Cross-Cut­t­ing Con­cern is a con­cern your appli­ca­tion needs to address that is unre­lat­ed to your application’s prob­lem domain, and ‘cuts across’ oth­er con­cerns. Typ­i­cal exam­ples include: log­ging per­sis­tence secu­ri­ty error han­dling They are usu­al­ly dif­fi­cult to decom­pose from the rest of the sys­tem and result in tan­gled code. Address­ing these cross-cut­t­ing con­cerns will …

Buzz­word Buster – Cross-Cut­ting Con­cernRead More »

Aspect Oriented Programming in .Net using PostSharp

I saw this arti­cle on D. Patrick Caldwell’s blog a lit­tle while back: It was this arti­cle that got me inter­est­ed in Post­Sharp and the pos­si­bil­i­ties that it can bring. Post­Sharp, in short, is a light­weight frame­work which intro­duces some Aspect-Ori­en­t­ed Pro­gram­ming into .Net. Some of the com­mon usages I have seen include trac­ing …

Aspect Ori­ent­ed Pro­gram­ming in .Net using Post­SharpRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.