Why BizTalk developers get SO and contract-first

Service Station, by Aaron Skonnard

Syndication

To a BizTalk developer, you design applications based on message flow. A message goes in one port, and comes out another. What happens in between is completely black box. Simple.
 
BTS 2004 is the most service-oriented product that MS ships, at least according to the four tenets.
 
The beauty of BTS is that the architecture is based on SO, but grounded in reality. It acknowledges that SAP, Peoplesoft, etc., exist and cannot be ignored through it's flexible adapter architecture. So BTS offers an SO future while connecting you with past investments.
 
BTS has no illusions about the whole message vs. object debate, which drives some of us to the edge of madness. ;-)  With BizTalk, it's about messages. Period.
 
In fact, the only place object-based APIs come into play is when you export an orchestration as an ASMX Web service. Then you get an object-graph injected in the middle when you really don't need it. I've recently exchanged some emails with James Saull, who is doing a lot of work with BTS 2004 lately. He noticed that all ASMX does in this case is add an extra layer of wierdness that doesn't add any value whatsoever, before things get handed off to the orchestration. So he's been building an .ashx-based WS integration layer that removes the need for objects altogether. In this post, he explains why contract-first is such a good fit in the BizTalk integration world. Here's an interesting excerpt:
 
A large scale integration project often means you will encounter an environment where vast and multitudinous schema have been published (government, insurance, petrochemicals, pharma etc.). The BizTalk solution takes the form of a system sending and receiving messages composed of "types" from these schema. For example the insurance industry has two standards Origo and Accord. Both contain vast schemas detailing all the industry types and even message flows. Therefore the design of an SOA system will include message design and then the WSDL. The WSDL will define services based on these pre-defined types from these schema (such as a "policy" or a "customer" etc.). Once the WSDL has been built all the different parties involved can begin developing simultaneously against the contract in .Net or Java or KSH scripts and PERL if you like.
 
If you tried to do this the other way around you'd be in a world of pain. Trying to build your services in C# or Java and then auto-exporting your WSDL in the hope that the C# types will magically map to the industry defined schema types and service definitions. This would just be tilting against the windmill!
 
One of his collegues, Duncan, experienced the same pain and came to the same conclusions about contract-first in his message-based world.
 
In the BizTalk world, we already have a Service Oriented mindset. We communicate in terms of schema-defined documents; we offer up services not APIs. We want to be interoperable with as many people as possible. I don't care whether you're using Java, .NET or ARM assembler - if you can send me a soap message, I'll talk to you. The trouble is that the .NET world approaches web services from a very object-y view point.
 
It's so refreshing to communicate with developers working with BTS, because they seem to be coming at the problem from a completely different perspective, and the right one I might add. ;-)
 
I think I may need to spend more time with BTS... I may feel more at home there.
 

Posted Nov 11 2004, 06:54 PM by Aaron Skonnard

Comments

Brian wrote re: Why BizTalk developers get SO and contract-first
on 11-11-2004 5:00 PM
Maybe this is why I never really understood the big deal with people wanting to do 'contract first' development...my grounding in BTS.

I have seen several comments that you have made about how difficult it is to approach contract first with todays toolset. I dont understand this. Generally how our development works is we develop or are given a schema and then either build a web svc. around that schema or exchange messages over our message based middleware (TIBCO). When we create a web svc, I hand craft a class file that mimics the schema and let the ASP.Net serialization infrastructure do its thing.

Sure, if the schema was very complex writing those classes might be a bit of a chore but not the end of the world.

I guess I thought of conract first development as more of a mindset: When you want to interop, use the simplest XML types that everyones platform should understand. Then, write your classes around your schemas and let your SOAP stack handle the rest.

Where have I gone wrong here?
Duncan Millard wrote re: Why BizTalk developers get SO and contract-first
on 11-12-2004 2:03 AM
Brian - You're there with your mindset: schema first. But the way you're implementing it is pretty much code-first. Let me explain...

In a fully tool driven world you should be able to take those schema, graphically design a comprehensive WSDL file, and have your .NET classes, ASP.NET Web Service, BizTalk Ports & Orchestration, whatever, all generated for you based on the WSDL. The tool should support versioning, security, etc etc etc.

You've already found you can't do that in one easy step. Instead, you are dropping down and creating a .NET object that looks like the schema. When ASP.NET generates WSDL it's not re-using your original schema, it's create a new schema that describes your .NET object. You then relying on the fact that it's "close enough" to the schema that you are using for it all to work. This is the 'code first' approach.

However, if you look at the WSDL generated by ASP.NET you'll see that the types it defines don't bear much similarity to the document schema that you started with - e.g. minOccurs and maxOccurs just can't be represented using the code first approach. There's a huge impedance mismatch between .NET and Xml Schema.

Ideally the WSDL wouldn't contain another schema definition, it would simply import/include the real schema. You would define your services yourself in the WSDL rather than relying on ASP.NET to generate something for you based on your [WebMethod] annotated methods. Once the WSDL was complete, you would use a tool such as wsdl.exe to create code stubs and service definitions. This would be the wsdl-first or schema-first approach.

The advantage of this latter approach is that the consumers of your web service are using a service based on the real document that you want to see flowing, rather than a .NET approximation of it.

You can take this WSDL-first approach, but you have to do it by hand at the moment (or maybe spend a bomb on Xml Spy) - hence the complaints about tool support. Creating WSDL by hand, to achieve this schema reuse, can be painfully slow and error prone.

Finally, you may find "xsd.exe" handy, it ships with .NET and builds you a .NET class based on an XSD schema. It may save you some time :-)
Duncan Millard wrote re: Why BizTalk developers get SO and contract-first
on 11-12-2004 5:37 AM
Hey Brian I've just been told about XSDObjectGen too:
http://www.microsoft.com/downloads/details.aspx?FamilyID=89e6b1e5-f66c-4a4d-933b-46222bb01eb0&DisplayLang=en

This looks to be a good tool - check it out.
Mike Taulty's Weblog wrote Aaron on SO and BizTalk Server
on 11-12-2004 5:59 AM
Aaron Junod wrote Biztalk 2004 bits
on 11-12-2004 6:08 AM
Aaron Junod wrote Biztalk 2004 bits
on 11-12-2004 6:28 AM
ESOA Strategy wrote Contract-First Development
on 11-12-2004 7:38 AM
Sean Chase wrote re: Why BizTalk developers get SO and contract-first
on 11-12-2004 7:46 AM
Aaron, do you know of any quality training books or ILT classes in AZ for BizTalk 2004? I've played around with it a little bit, and did the SDK tutorials, but I'd like more exposure to it. Thoughts?
Dilip wrote re: Why BizTalk developers get SO and contract-first
on 11-12-2004 7:49 AM
You guys should take a look at http://dingo.sourceforge.net/
Seems to be more feature-complete than xsd.exe
Now I don't understand what's the difference between xsd.exe and XSDObjectGen.
Scott Woodgate's Business Process and Integration wrote Aaron Skonnard's interesting observation: BizTalk and SOA
on 11-12-2004 9:28 AM
mike woods wrote re: Why BizTalk developers get SO and contract-first
on 11-12-2004 11:32 AM
RE: BizTalk Training

Wouldn’t it be cool if Pluralsight offered a BizTalk Server class? (Aaron; hint, hint ;^)

In the meantime the BizTalk Server training and book market is heating up. Checkout the training resource page at:

http://www.microsoft.com/biztalk/techinfo/training/2004.asp

Also a new book has just been released:

Microsoft BizTalk Server 2004 Unleashed

and is currently on Amazon’s best seller list (No I am not one of the author’s :-)

I’m building a very deep developer training class for experienced BizTalk developers to be offered throughout the first half of 2005 on the Microsoft campus. Keep an eye on the BizTalk Training page for information on that.

Regards,
Mike Woods
mwoods@microsoft.com
BizTalk Server, Sr. Technical Product Manager
kzu@aspnet2.com (Daniel Cazzulino) wrote RE: Why BizTalk developers get SO and contract-first
on 11-14-2004 6:27 AM
You can also use the approach described in http://msdn.microsoft.com/library/en-us/dndotnet/html/custcodegen.asp?frame=true, which is based on all .NET SDK classes.
Commonality wrote BizTalk and SOA
on 11-15-2004 5:24 PM
Aaron Skonnard talks about BizTalk Server and SOA. I fully agree here; the way BizTalk starts up (from the schema...
Jes wrote BPEL4WS, Contract-First and BizTalk Server 2004
on 11-21-2004 10:10 AM
Service Station wrote Contract-first business process design
on 11-30-2004 12:15 PM
optionsScalper wrote Down the Rabbit Hole We Go
on 06-02-2005 10:01 PM
(warning:  long, essay post)
Today I feel centered.  Not balanced, not inverted, but centered. ...
J wrote re: Why BizTalk developers get SO and contract-first
on 11-28-2005 2:20 AM
While I agree that BizTalk can be put to good use as SOA glue, the problem is that it is not SOA "compliant" in itself.

Take this scenario:
1. You have three orchestrations in three different SOA applications that require use of the same schema/message.
2. You create a separate schema component for each orchestration project.
3. You build all three SOA applications.
4. You try and deploy all your schemas and orchestrations. The first application goes ok, but the next one gives a warning about schema duplication, and the third one will error.
5. So, you are left with no choice but to share a schema component, rather than having seperate ones for each app.
6. Sharing components is totally against SOA, as you have created a dependency. Also, if you now want to change that schema component, you now have to uninstall all of the applications - not very SOA at all!
Ali Pasha's WebLog... wrote Great quotes on Contract-driven (aka Contract-First) Development...
on 03-01-2006 5:40 PM
I was trying to get a pulse on Contract-driven Development and what the industry was saying, so I compiled...
Ali Pasha's WebLog... wrote Contract-first Design Quotes
on 03-14-2006 10:46 AM






Relevant Quote
Link

The trouble is this promotes a very code-first approach. This really...
DonXml's All Things Techie wrote Books That Help Teach Web Services Contract First
on 03-18-2006 3:05 PM
stefan demetz wrote re: Why BizTalk developers get SO and contract-first
on 01-07-2007 5:25 AM
BizTalk is perfect for the contract-first methodology
see http://dotnetjunkies.com/WebLog/stefandemetz/archive/2006/12/20/176504.aspx

Add a Comment

(required)  
(optional)
(required)  
Remember Me?