SRP Doesn’t Stand For “Several Responsibility Principle”

0

I know it should no longer come as any surprise to me, but I just found this method (and several others like it) lurking in a Data Access Object. Grrr…

/// <summary>
/// Send an email to notify that accrual data has been successfully uploaded
/// </summary>
/// <param name="accrualUpload"></param>
/// <param name="recipientAddresses"></param>
public void SendSuccessfulUploadEmail(AccrualUpload accrualUpload, Collection&lt;MailAddress&gt; recipientAddresses)

Much of software design / architecture isn’t technically difficult, it just requires a little thought – "where does this functionality belong?&quot; – rather than forcing code into the first class you come across.

Square Peg in a Round Hole

Did I mention how useful NDepend is in exposing idiocy like this? I think I did. And I really should get round to blogging about how handy CodeRush and Refactor Pro are for cleaning up such smells.

Leave a Reply