Geeks With Blogs

News View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn

Michael Stephenson keeping your feet on premise while your heads in the cloud

Name:

Don't over complicate your map

  

Description:

I was recently looking at a BizTalk map which had a bug in it and one of the things that I notices was that the developer had strung together a number of functoids to do some logic in the map. We were talking about 12 functoids being used to workout which value should be in the output field.

I think sometimes developers are a little frightened to drop into .net code feeling that it is perhaps not the BizTalk way. In this case the logic could have been executed in a .net assembly with about 4 lines of code and called via the scripting functoid.

 

I'm not saying that you should not use the out of the box functoids but I think there is a balance where making a very complicated stringing together of functoids should be a trigger to yourself to question if there could be a simpler way to achieve what your trying to do.

Symptoms:

  • You may see lots of functoids connected together to map one field
  • Your maps might be hard to understand

     

  

Pain:

  • In our case the map had a bug which hadn't been spotted because all cases of the map execution had not been tested. The logic in the different functoid branches was difficult to test
  • It is difficult to read the logic of the functoids
  • The logic can not be tested in isolation

      

Cure:

  • The first thing to do is ensure that you recognize that it is complicated. If this is the case I would recommend asking a colleague to review your map and to see if they find it easy to understand. If they don't then you have some work to do
  • By putting the logic in our case in a .net class we could easily test it with some unit tests to ensure the logic is rock solid before it gets anywhere near the map

 

Just as a point to note on this post, there is also the excellent and similar post about the Everything but the kitchen sink anti pattern used in maps.  The difference between my post and that post is that I am saying just use the scripting functiod if you need to so that your map doesnt become overly complicated.  The other post is saying dont put things in a map if they dont belong in a map.

That post is available on the following link:

http://blogs.msdn.com/b/ebattalio/archive/2006/11/16/anti-pattern-kitchen-sink-maps.aspx

Posted on Tuesday, April 24, 2012 10:27 AM BizTalk , Patterns and Anti Patterns | Back to top


Comments on this post: BizTalk Anti Pattern – Don’t over complicate your maps

# re: BizTalk Anti Pattern – Don’t over complicate your maps
Requesting Gravatar...
Good point.
Usually I try to use custom xslt instead of adding billions of functoids to do the magic...
Left by Cecilia Magnusson on Mar 23, 2013 5:30 AM

# re: BizTalk Anti Pattern – Don’t over complicate your maps
Requesting Gravatar...
wowowowow wikicool
Left by StephenAnderson on Jan 23, 2017 10:16 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Stephenson | Powered by: GeeksWithBlogs.net