garyshort.org


I am a Technical Evangelist for Developer Express, my work blog is here but this one is more fun. :-)

January 2008 Entries

How Good is your DR Plan?

This story over at the BBC tells of problems at our local hospital. A server had failed and it took 12 hours to restore. Though not mentioned on the BBC site, local news says the delay was not due to lack of a plan nor due to lack of staff to implement it but was, in fact, due to staff not being able to find the key to the storage area where replacement servers where kept! Oh dear.

Web Client Software Factory Bundles

The Patterns and Practices guys have been busy of late and have released the following bundles for the Web Client Software Factory.

Get them whilst they're hot folks!

Feedback from Glasgow Talk

Last night I did the "My Favourite Patterns" talk for the Glasgow branch of Scottish Developers. The talk went very well (feedback results below). I'd like to thank Colin for hosting the evening and a special thank you has to go to Frank who helped me with my introduction where I give a practical demonstration of what a pattern is using some martial arts techniques. :-)

Feedback (marks out of 5)

Presentation as Expected Overall Demos Information
4.67 4.78 4.56 4.67

Below are some of the comments

"Seeing the patterns implemented and related to real world scenarios"

"A lot of code :-)"

"Well Explained"

"Very good introduction to patterns!!! Very informative; enthusiastic speaker"

"Speaker made it interesting. Good voice, information and use of the platform."

You can download the presentation slidedeck and code examples from my Skydrive account. Note the examples are written in VS 2008.

Here's something we Already Knew :-)

Dundee is one of the smartest cities in the world, according to a group of computer technology experts.

More on the BBC site.

Design Patterns Talk Tonight

Last reminder about tonight's talk in Glasgow, where I'll be speaking about design patterns. More details on the Scottish Developer's web site and it even got a mention in this month's UK MSDN Flash. If you are coming along and you read this blog, then don't forget to say hi. :-)

Its not the Product that's Useless it's You

This morning Dave Evans has a post stating that 99.99% of whaterver product you choose to examine is useless. Hmm, well I dont' agree. He uses the example of going to a book store and not finding a book that he wanted amongst the thousands in stock, to illustrate his point. Unfortunatly this does not illustrate his point. What it does illustrate is that, at the time, he had very specific requirements (or none at all) which, the small percentage of the thousands of books in stock, that he sampled, did not meet. However, had he wanted to know about .Net internationalisation, for example, then Guy Smith-Ferrier's book would be usefull, 100% of the time.

The same thing applies to Twitter, and the like, which he goes on to say are only useful 0.01% of the time. Again, this is not the case. Twitter just does one thing and that thing is useful 100% of the time if you need that thing, if you don't, its no use to you at all. So, its the ability of a piece of software to fulfill our requirements that makes it useful or not. Unfortunatly, our requirements change with time, that's why web 2.0 software - like everything else - goes through cycles of fashion, and to survive it has to adapt to our changing requirements. It will be interesting to see if Twitter (and the other web 2.0 glitterati) can do that and survive the year.

The Feedback From DDD6 is in

Thanks to Craig and the gang for getting this out to us speakers; feedback is important so we can make your presentations the best they can be. Anyway my marks, for my design patterns talk, were as follows (out of 5)...

Overall Knowledge Presentation Content
4.64 4.86 4.79 4.43

Below are the comments left by the audience:-

"As someone who had heard of Design Patterns but wanted to understand what they were and how they worked, this was an excellent introduction to it."

"Loved this session, 100% worth for weekend time."

"Very well presented content. Everything was easy to follow and questions were answered well. It was good to see some of these patterns in action."

"Ran out of time."

"A good subject for a talk with good content. The time splipped though which was a shame because we did not get through all the patterns. Hopefully we shall see more talks on this subject."

"This session was, for me, the highlight of the day. Gary made what could have been a very dry and academic subject very practical and interesting and brought the subject to life with real-world examples."

"Great session and will be working to ask Gary to visit my user group. Hampered a little by Starting late but a great session."

Technorati tags: ,

Design Pattern Talk Reminder

Just a reminder that I will be giving a talk on the subject of design patterns to the Glasgow branch of the Scottish Developers user group at 7pm next Wednesday (January 16) in the CPD centre, Glasgow Caledonian University. More information can be found here.

RESTful API Patterns #1

One of the tenants of a proper RESTful API is that every entity (for entity read resource) is addressable. Okay, good; so what does that actually mean? Well let's suppose we have an employee entity, then all the employees would be addressable at:-

http://myapp.com/employees/all

and the first name of a particular employee (say employee 42) would be addressable at

http://myapp.com/employees/42/first-name

Get it? Good. Now that's easy enough to understand but what's at http://myapp.com/employees/42/first-name/ and by that I mean if I navigated to that location from the root of the myapp.com site, what would I find? Answer: nothing, nada, not a thing. In fact, you couldn't navigate there as the address doesn't exist. Its a virtual address, just something to make us humans feel better. Our RESTful API tells us that the information we want is at this address and when we type it into the browser we get the information we need and our world goes on turning like we think it should.

However, when you stop to think about it, it is more sensible not to have anything there. I mean, you *could* have the scenario where, when a user created an employee, the system physically created the paths

http://myapp.com/employees/42/first-name
http://myapp.com/employees/42/last-name
http://myapp.com/employees/42/age
http://myapp.com/employees/42/DOB
etc

and actually wrote index.aspx files to handle the requests; then, when the employee was deleted, the system could remove them all again. However, let's face it, that kind of sucks doesn't it?

So how should we do it? Well the simple answer is to have a handler for each entity (in this case employee.aspx) that is responsible for all of the behaviour of the employee entity and then have the server rewrite the URL so that requests go to the handler. Like so:-

GET /employees/42/DOB/year-part would map to GET /handlers/employee.aspx

and employee.aspx would use the values in the form fields to search the database and return the information required. And that is how we do that in a RESTful world. Good isn't it?

What? Still here? Okay, Okay, that's how we'd do it if we were writing a RESTful API for an Apache web server, but we can't do that on IIS can we, as there's no proper URL rewriting facility? Bummer. Right now, I can almost hear Andrew Westgarth shouting "but you can do url rewriting on IIS!", which, to be fair, is true. However, you can't do extensionless url rewriting out of the box with IIS, you need a third party add on to do it.

A discussion on IIS url rewriting is beyond the scope of this post, but Scott Guthrie has a great post on the topic if you want to follow up on it.

Okay? Happy now? Good; then run along, I've got work to do, I'll see you next time. :-)

 

Gale Force Winds Trap me at Home

Map image

Gale force winds here in Tayside today have shut the Tay rail and road bridges putting the trains up the spout. So, I'm working from home today. As you can see from the picture the bridges are vulnerable to westerly winds, in fact that was a contributory factory to the Tay Rail Disaster of 1879. The wind gets funnelled in the estuary and accelerated towards the bridges, just what you need when you are trying to cross. :-)

I was surprised when I found out that the bridges don't "like" westerly winds, that being the prevailing wind direction in this part of the world; you'd have thought that the engineers could have taken that fact into consideration when designing the bridge. Ah well, never mind, the bridges are closed so here I sit. At least you know where to find me if you want me. LOL

 

 

Are Stored Procedures the Work of the Devil?

That was the topic of a discussion I had with some of my social network just after new year. Apparently, the discussion was prompted by this posting. There's a lot of good points in the posting, but personally I'm always going to use stored procedures. Why? Well 'cos its a great pattern for two reasons.

Firstly for security. If you create a database api then that gives you another layer boundary at which you can post a gatekeeper to keep out the bad guys. Secondly for testing. If you create you database api and test it then that's it, job done. If each client accessing your database has to write their own (predominatly similar) data access dynamic sql, then each client has to be tested seperately. That's an overhead that I just don't need.

So, for those two reasons above others, I'll be keeping my stored procedures thank you very much.

Welcome to 2008

As you can see it's been dark here for some time. I'll not go into the reasons for that, but I'm back now and that's all that matters. It is all that matters isn't it dear reader? Did you miss me then? Good, as I missed you too.

Now, as for 2008. Well, it's going to bring some big changes for me - more about that mid to late February. In the meantime, here's a short list of the things I want to achieve in 2008:-

  1. Improve my health and fitness.
  2. Make it on to the NxtGenUG list of top 10 speakers.
  3. Learn more about CSS

Tune in next year to see if I manage any of them

Twitter Updates


    Follow me! :-)
    www.flickr.com
    GaryShort's photos More of GaryShort's photos