Profile cover photo
Profile photo
Paul Kimbrel
51 followers -
Follower of Christ. Husband, father, son, brother. Programmer, musician, IT specialist, hobbyist.
Follower of Christ. Husband, father, son, brother. Programmer, musician, IT specialist, hobbyist.

51 followers
About
Posts

Woah! Random blog post from the bitbucket... and it's very technical.

I can't reveal specifics of where I work or what I do - but I can say that I'm currently grappling with a massive change brought on by a decision somebody made a while ago that... well, I'm sure was a good idea at the time.

That decision? Put an ENUM in a web service interface. In my particular circumstance, the said ENUM is an identifier that tells the web service "who" is calling it. And in this case - I'm a new guy calling the service.

ENUM's are great when there's a specific set of allowed values you need to limit from your clients. It's almost like a built-in validation rule. Awesome! But when you put such a limitation on a service interface you wind up with all sorts of side effects. Like... what happens with the ENUM changes? Well - then everybody using the WSDL ends up changing.

Of course, I just tweeted "never use enums in a web service interface". I do hate making such blanket statements. NEVER and ALWAYS are very dangerous words.

But MAN OH MAN is it causing me grief right now!! I want to use a web service, but I'm a new client - and for reasons I'm sure were excellent and well thought out by the service-owners - one of the parameters I'm passing in is a client ID. And it's an ENUM. And I'm not in it. :(

SOOOOO - the ENUM needs to change. Ugh. Well that's a change to the interface. That triggers a build service. That triggers all sorts of changes to folks that ARE in the ENUM. And what value do they get in the WSDL change?

Nutt'n. Nothing. Zip. Zero. Zilch. It's money money money for reasons they don't care about. Why do they care that now I'M calling the service? They don't. But the corporate gears of change turn when the WSDL is changed.

Sure, existing clients don't have to update to the new service. But now the service owners have to maintain an old service version. Why? Because it's the one that DOESN'T have me. Value of doing that? Nutt'n. Nothing. Zip. Zero. Zilch. Money money money.

It's common theme in coding - especially when it comes to web services. There's this strange tug-of-war between flexibility and structure. I struggle with services that are so darn flexible I don't even know what they do. But then I hit the other side of things - like this problem here... Things that are so structured that a seemingly innocuous change turns into a massive hootenanny.

So don't use ENUM's in a web service interface. If you have a really GOOD REASON to do it - you're probably wrong. Even if you're not. You probably are. Don't do it. Make it a string. Deal with it in validation if you really really think it's important to restrict the values.

#coding   #programming   #webservies   #soap   #wsdl   #design   #software
Add a comment...

Post has attachment
Added a new #JavaScript tutorial on #expressjs (#nodejs #visjs)! Part 2 of 2.
Add a comment...

Post has attachment
Added a new #JavaScript tutorial on #expressjs (#nodejs #visjs)! Part 1 of 2.
Add a comment...

Post has attachment
Installing Cloudera on Digital Ocean
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Participating with "BASIC WEEK" on Reddit - http://www.reddit.com/r/retrobattlestations/
Add a comment...

Post has shared content
I want this - but I want to use my smartphone to take the picture so I can post it on Instagram.
Add a comment...

Post has attachment
Awesome sky tonight.
Photo
Photo
7/1/14
2 Photos - View album
Add a comment...

Post has attachment
The FDA is trying to fix something that isn't broken. Not a huge surprise there. However, this is going to put many small farmers out if business. "Protecting" consumers should never involve destroying small businesses.
Add a comment...

It's been a while since I've geeked out this much.  I've been trying to nail down an industry pattern for JavaScript and concluded that there's not much of one really established.

So I started playing around with a few technologies after talking with a few co-workers and friends.  I've successfully set up a test project now that follows one of the better patterns I've seen so far for a JavaScript application.  In the process of building the project I've been getting my self up to speed on:

- #GIT (version control tool)
- #Jasmine (JavaScript test framework)
- Karma (test runner framework)
- #RequireJS (framework for loading JS asynchronously-ish)
- #WebStorm (a great IDE for JavaScript amongst other languages)

I've never used GIT successfully before.  I decided it was time to get my brain out of Subversion-land and give it a try.  I think I'm finally getting my brain wrapped around the decentralized nature of GIT - though it still scares me a bit.  I'm sure that will pass in time.

Jasmine still has me slightly befuddled.  I get Jasmine - but unit testing in JavaScript is really still a struggle for me.  Specifically, how to deal with the interactive nature of JavaScript, jQuery, HTML forms, etc.  Now that I have everything up and running - this will be where I spend most of time, energy and focus.

Karma is cool.  It's tricky to get set up - but I'm sure that will get easier with time.  The main "woah, cool" factor with Karma is that it communicates with multiple browsers running on my machine.  As I code, my test cases are automatically run across all the browsers available to me.  I get real-time feedback if my test cases fail in any one browser.  Plus, Karma gives me a means of going into a specific browser and debugging.  That... that's just freak'n awesome.

RequireJS has me on the fence.  I'm still poking it with a stick.  Frameworks that load frameworks (even my own) make me nervous.  We shall see how this works out...

WebStorm... wow.  Sorry, Eclipse.  It's time to say goodbye.  It was good run, really.  But I've found a better way (even if it isn't free).
Add a comment...
Wait while more posts are being loaded