Anti Corruption Layers: Striving for FizzBuzz level

time to read 2 min | 280 words

I think that I mentioned that I don't really like Microsoft CRM development options. Considering the typical quality of the code that I see online when I search for samples, I certainly see the CRM as corrupting influence.

That is why I pulled the big guns and built a whole new layer on top of it. I assume that you are already aware of my... reservations for leaky abstractions, and considering my relative lack of expertise on the CRM itself, I don't think that it would have been wise to diverge too far from the model that the CRM has, only to break the way we are handling it.

As a result of that, we have this piece of code, which is how I handles tasks that are usually handled by callouts. The major advantage is with the ability to develop on the local machine without being tied to the server, and a lot of smarts with regards to banishing XML parsing from the core business logic. The end result, as far as I am concerned, is that I should be able to write business logic using Fizz Buzz level of code, if that. It is a bit mind numbing, but that is what the client wants, not to struggle mightily with the underlying platform.

[Handles(CrmOperations.PreCreate)]
public class OnCreateFriend_SetFullName : NorthwindCommand<new_friend>
{
	public override void Execute()
	{
		if(string.IsNullOrEmpty(PreState.new_name)==false)
			return;
		PreState.new_name = PreState.new_firstname + " " + PreState.new_lastname;
	}
}

 And to foretell questions, the basis for that is not Open Source, although we may make a product out of it at some point. (Drop me a line if you are interested).