The Monster API

I'm currently on a project that requires interfacing to a system (can't say what it is, sorry) that has a C API, so this will require p/invokes. That's not the problem (although that's a little bit more work than necessary), but here's the fun thing. The function takes two strings (more or less), an in string and and out string. The two parameters are basically containers for literally hundreds of input and output values. In other words, the string will (probably) look like this:

"000100220300P000010100..."

where each position (or a group of positions) represents a input value.

And, of course, there are no examples or unit tests that demonstrate how this is called.

Wow. I think I'm back in the 90s again...

And hell yes. There will be a nice .NET API I'm going to make around this with unit tests so the rest of my code doesn't have to deal with monstrosity.

* Posted at 04.24.2008 02:30:52 PM (Last Update: 04.24.2008 05:47:09 PM) | 2 comments | Link | RSS *

Comments

# Lead Developer, from AndyP at 04.24.2008 04:12:05 PM

Haha, Brian just showed me this post. This is Exactly the kind of thing we're dealing with on our project. In our case we're pulling data from a legacy mainframe (Natural/Adabas from SoftwareAG) via a COM wrapper (Broker) into our ASP.Net app. And the data comes back just like you're showing, straight inline, without even the curtesy of a comma delimiter. Parsing that bad boy and getting it into objects will make your head spin. And I'm betting you're getting 8 char date strings, better hope they don't have any 20080332 dates in there ;)
welcome to our world lol.

Legacy ^H^H^H^H^H^H - I mean Unit Tests FTW!

# Sounds the same, from Jason Bock at 04.24.2008 05:46:01 PM

I'm definitely writing a nice .NET API wrapper around this. It would be crazy to try and just call this p/invoke without some structure around it.

Add a Comment

(*) = Required field
Name (*):

E-Mail (*):

Web Site:

Title (*):

Comments (*):

Enter the code you see (*)



Quote
"God must have been a civil engineer, because only a civil engineer would run waste disposal pipes through a recreational area." Anonymous
Twitter History
follow me on Twitter
Blog History