Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Oct 23, 2009

Architecture in the Small Presentation

Last night I was privileged to be the first speaker at the newly formed Sydney Architecture User Group put together by Paul Glavich (@glav) and Omar Besiso (@omarbesiso) and sponsored by Datacom.

There was a strong turnout and plenty of people in the audience willing to ask questions.  I’ve uploaded my slide deck from last night to Slideshare in case you weren’t able to make it there in person or you just wanted to go back over it for yourself.

Sep 1, 2009

Are You a Victim of Analysis Paralysis

Maybe it’s just the teams I’m helping but there seems to be a spate of analysis paralysis occurring in the IT world.  Of course if I was a media outlet I be calling it an breakout, nay an epidemic! No! A pandemic!! Run for the hills people we might all be infected!!!

If you are experiencing any of the following symptoms then see the guidelines below:

  • Analysis has taken more than a month already and shows no sign of ending anytime soon
  • The documentation you’ve written has fine grained details in a few areas and is completely lacking any information at all in others (especially the tricky bits)
  • Your analysis efforts are going around in circles
  • No one can decide what the “right” approach is to some of the problems

Steps for curing this disease:

  1. Stop analysing!! Right now!
  2. Write some code based on what you have done.
  3. When that code is working, go and analyse/design a little bit more.
  4. Go back to point 2

Good luck with the cure and I hope your health improves!

Feb 10, 2009

Should I Decouple My Code?

If you look around the internet you’ll find lots of information on refactoring your code, making it more testable, improving its maintainability, and using DI/IoC techniques to increase the ease in which you can make changes to it.  A very large element in all these subjects is having code that is loosely coupled and learning how to take existing tightly coupled code and improve it.

That’s great…. and making these changes is a laudable goal, but what do you do when you look at the code you work on each and every day and you see how tightly coupled it is and then look at just how many more changes and features your customers are asking you to add and make to your application.  You know you want to clean things up to make it easier to get through that backlog of requests but when is it right to decouple and when is it OK to leave code as is?  It’s a valid concern and was asked as a follow up to my screen cast on Decoupling Your Code by Example.

So first, let’s be clear; tightly coupled code is a form of technical debt that will decrease your ability to quickly and cleanly make changes to an existing code base and thus slows the rate at which you can get through that backlog of customer requests.  And since those customers making the requests are in all likelihood the same ones that end up paying your wages then it’s probably a good idea to go as quickly as you can.

OK, fine; but now let’s consider the agile principles of not wasting effort and delivering business value to the customer as quickly as possible. If we have an existing code base that is full of tight couplings then we can’t very well ask our customer for x-weeks of time to let us refactor the internals of the application to reduce coupling.  It’ll would add zero business value to the customer because in x-weeks we would have delivered zero new functionality.  We would also very likely be changing parts of the application that are not going to see any changes in the future – thus it would include wasted effort.

It’s therefor pretty logical that we really only want to decouple code when we’re actively changing it.  We should apply the boy scout rule and “leave the campsite better than we found it”, or in our case, the code base.  Also, we don’t want to go fixing stuff up that we aren’t currently changing, no matter how ugly it is or how tempting it is to improve it – if we do we are only slowing down our development efforts on the items we need to be delivering now, items which our customer is expecting.  In doing so we also run an increased risk of introducing new bugs.  Why? Well, if we only have a certain amount of time to finish something then we really don’t have enough time to do a proper clean up of things outside of the area we are currently working on. So we’ll probably do what most of us do when time is short; make a change that we think is OK (but isn’t) and we won’t worry too much about the tests.

The agile principle of wasted effort can also come into play when looking at coupled code in an area of the application we are actively changing.  Some tight coupling just isn’t worth the time and effort to change.  Let’s say we have a tight coupling to ADO.NET which makes our code a bit clunky in places. It’s awkward at times to use and we could be faster if we changed it, but is it really worth x-weeks to rework our code to use an improved data access mechanism just so we can have a more loosely coupled design? Is there enough payback in making that change that it benefits the customer directly, or even indirectly by saving us more than x-weeks worth of effort further down the track? Maybe; maybe not.  In most cases probably not.  And if the payback isn’t there, then don’t make the change.

So, should you decouple your code?  The answer is, like all things in software development: it depends. These two questions can probably help you make that call.

  • Is the decoupling in an area of the system I’m currently working on?
  • Will the time spend changing the code more than pay for itself with time savings later?

If you can answer “Yes” to both of those, then it’s probably time to decouple your code.  If you can’t, then get on with giving your customer what they asked for – new features in their application.

Jul 24, 2008

Building Loosely Coupled Applications with Unity @ Tech.Ed Oz '08

I've been fortunate enough to be given a speaking slot at Microsoft Tech.Ed Australia this year and I'll be doing a session on using Unity - the new IoC container included with Enterprise Library v4.0.

Here's the session extract from the Tech.Ed Australia Session Catalogue:

"Loosely coupled applications. We all want them, yet the reality of what we build is usually so far removed from that goal.  Come and see how the Unity container and the inversion of control & dependency injection patterns can help you architect applications that are not only free of tight class couplings but have the added advantage of being easier to test.  Techniques for breaking dependencies in existing code will also be covered."

If you're coming to Tech.Ed I hope I'll see you there!

P.S. There's plenty of other reasons to go to Tech.Ed (other than me of course) with a host of speakers from Redmond, including Scott Hanselman, and a squad of current and former Redifarians: Mitch Denny, Corneliu Tusnea, Paul Glavich, Paul Stovell, Tatham Oddie, Greg Low & Bill Chesnut

Oct 23, 2007

IoC/Dependency Injection using the Castle Project

Many bloggers post top tools lists and I, for one, like to read them.  It's always good to see what other people find useful, compare that with what you yourself are using and see if there's something they've found that can help make you more productive or expand your thinking.

Chris Brandsma has written a tool list and included Inversion Of Control (IoC) containers as a "highly thought of" tool.  One of the best IoC Containers going around is the Castle Windsor container and Chris gave this one a mention.  Personally, I've always liked the Castle Project and the fact that they've been pushing good design patterns into the .NET world for some time.  [As a side note there's been a lot of hoo-ha over the Microsoft MVC implementation announced at ALT.NET recently. The Castle Project's MonoRail has been out for quite a while now and is a good MVC implementation for .NET available right now.  It's a shame more kudos hasn't gone their way for the work they've done.]

Anyway, one of the other interesting things on Chris' tools list was a reference to a tutorial showing how IoC containers work in .NET using the Castle IoC Container.  This is a really good 4-part tutorial and it's well worth a read.

It not only covers what IoC is and how it helps improve the design of your software (separation of concerns, anyone?) but it also shows you how to use the WIndsor container in multiple ways to improve you software's design.  When you consider that an IoC container can help you manage the complexity of your software automatically and make your code so much easier to maintain (and test) then it's something you should definitely consider looking into, if you haven't already.

Apr 9, 2007

A Unique Presentation

I ran across this on the 37Signals blog - it's a very creative and unusual way to get a message across. While it's a web site it also works as a presentation.

It's amazing what you can do with a whiteboard/fridge/stove top, a whiteboard marker, a camera and a willingness to take a risk.

The thing for me is that while it's a promotional presentation for a book it has a visual presence, sense of humour and conversational style that sets it far apart from the millions of faceless, insipid, cookie-cutter book marketing web sites that are out there today.

Check it out

Mar 22, 2007

UI Prototyping in PowerPoint

At work we do almost all of our UI design mockups in Visio but because they're static it's sometimes hard to get a feel for what will really happen when people click on things and how usable it is.  In other words it's easy enough to see if the "look" is right, but what about the "feel"?

Well it turns out that you can emulate some limited interactivity using PowerPoint.  I hadn't thought of doing that before until I ran across this blog entry from one of the guys responsible for the Office user interface.  It's pretty interesting and it might well be time to try it out :-)

Jan 29, 2007

Create a Web 2.0 Site

The current dot com boom is focused around Web 2.0 sites. The definition of what a Web 2.0 site is changes depending on who you're talking to, what phase the moon is in and how much interest Google and Yahoo! are paying to it.

The good news is that even if you don't know what one is, you can still create one, sell your hair-brained idea to a venture capitalist who just looks at the visuals and have a big bag of cash come your way! How? By simply following the instructions of course!

And if you just want a visual refresh to your web site so you can look like the rest of the cool kids then these might actually be useful instructions. Enjoy!

Oct 12, 2006

What is the Common Browser Resolution These Days

I'm sure you've heard that a web site should be designed for the lowest common denominator,. That way you maximise the potential audience that can view your site easily.

Of course 14 inch monitors died out years ago along with Windows95 so designing for 640x480 is silly. But 15 inch screens (800x600) are almost impossible to buy new these days and I've been wondering how many of these are still in use and why people still design sites for that resolution (or for IE 5.x and Netscape 4 for that matter).

I use sitemeter to check visitor patterns for the blog and one of the things they have is a way of checking resolution of screens. Here's what I saw when I checked recently...

Free Image Hosting at allyoucanupload.com

As you can see, almost everyone has a resolution of 1024x768 or higher. The 800x600 resolution is a paltry 3%.

Similarly, colour depth is at 32-bit for 94% of the visitors as well.

I guess the days of designing for limited colours and small resolutions are over. 1024x768 resolutions at full colour can now be treated as the lowest common denominator.

Oh, and in case you were wondering, IE 5.x made up a whopping 1% of the visitors. It's all IE 6+ and Firefox these days. No Safari, Camino or Konqeuror and very little Opera.

Sep 28, 2006

Guidance Explorer

The Microsoft patterns and practices team has just released a Guidance Explorer. This is an easy way to find and lookup all the various how to's, samples and other goodies that come out of p&p.

Best of all though, you can add our own stuff to it (though I'm not quite sure how yet).

There's an online beta (doesn't work in firefox, and it's a bit crappy in IE) and a downloadable copy.

The download is available from gotdotnet, and installation is just a matter of unzipping into a folder and then creating a shortcut to the .exe.

Aug 26, 2006

Tech.Ed 2006 Summary

Well, Tech.Ed 2006 has just concluded and it was really quite good. Better than expected actually.

There were a few things that really clicked with me. One was the Guidance Automation Toolkit and software factories in general. From what I'd read in the press and various web sites, I had the impression that a software factory was a bit of a silly name invented my marketers for code generation.

In reality it's a lot more than that. It's the processes, practices, standards and everything else that sits around the code, as well as automation of the actual code being generated (although that's probably a bit too simplistic an explanation). It's about assisting developers through the whole software development process in your organisation, and is especially useful for large developments, complex projects or places where there is developer churn. I'm actually quite excited about this - especially when I saw a demo of a guidance package in which NHibernate business classes were generated visually (class designer style), the column/property mappings done and then the hbm files built, all in about 5 minutes with no code and working perfectly. Given that this process can take hours by hand it's a real productivity enhancer.

The other thing that got me really excited was LINQ. This thing is awesome! It's very similar to NHibernate in both syntax and usage, but it offers much more than NHibernate, it's built into the compiler and works across not only databases, but object collections, disconnected datasets, XML data sources and can be extended to cover a whole bunch of other things as well. For example there's even an Amazon LINQ provider that works off the Amazon.com API's so that you could, for example, write LINQ queries for tech books less than $10.00 for example.

Unfortunately LINQ is still probably 12 months away from a 1.0 release, but I'll be grabbing the CTP and giving it a run through very soon.

I'll post some more detailed session summaries in the coming days.