This is the third pattern in an architectural pattern set. The first (Information Models) can be found here, the second (Policy) can be found here .
Intent
Provide a mechanism to reconcile the capabilities of a service with the requirements of a client. This in turn means that there must a mechanism to describe the capabilities of a service and the requirements of a client.
Problem
In any given environment there will be a population of entities that provide a similar but not identical service. For example different routers in a network may have different limits on the number of VPs they can provide. Some may be running different versions of an O/S with subtly different characteristics. Not all routers are made by Cisco(!). Different versions of a service may expose additional interfaces or use slightly different information models.
In the worst case clients would be hard-coded to expect specific variants. A slightly better solution is to summarize the capabilities of a service using a version number – in this case the actual capabilities are implicit in the version number. However this has the following problems:
- A client has to be coded to understand the full set of version numbers that it may encounter in a service now or in the future.
- Some features of a service may change in incompatible ways whilst others don't.
- A client would not be able to communicate with a new service that happened to provide the capabilities that it required.
Posted in architecture | No Comments »
This is the second in an architectural pattern set. The first (Information Models) can be found here.
Intent
Provide a controlled environment in which decisions can be made and enforced.
Problem
Whilst it is obviously possible to make and enforce any arbitrary decision in any arbitrary programming language it is difficult to control, manage, deploy, modify, inspect and verify those policies.
The policy pattern provides a way of adding those characteristics to the basic requirement of decision and enforcement.
Read the rest of this entry »
Posted in architecture | No Comments »
Why haven't developers of web user interface frameworks got the unit testing bug yet? I was just given a demo of a work-in-progress written using JSF. The person giving the demo selected an item from a pull-down menu and we were treated to a nice little exception explaining that #{someObject.someProperty} did not, in fact, reference an actual property on an actual object. Well, I'm sorry, but that is precisely the kind of issue that should be caught by a unit test. Read the rest of this entry »
Posted in software development, unit testing | No Comments »
A while back I discovered JWChat - a browser-based IM client that uses only HTTP to communicate with a server - in other words very friendly to restricted environments where you are behind a firewall and you can't install software.
JWChat uses a standard binding of XMPP (aka Jabber) over HTTP - in other words it speaks HTTP to a Jabber server. Now the good thing about many Jabber servers is that they can talk to MSN, Yahoo and AIM as well as other Jabber servers. This standard is defined in XEP-0124 and is implemented directly by some Jabber servers. Unfortunately not by the Jabber server that my ISP (dreamhost ) allows me to run. But wait! I can run a rails server on dreamhost, so it was just a simple matter of writing a gateway in Ruby that implemented XEP-0124. Of course, nothing in software development is ever simple (don't believe anyone who tries to tell you otherwise). Read the rest of this entry »
Posted in ruby, jabber, xmpp | 12 Comments »
If you've read any of my other posts, you might have gathered that I've been writing a portal . One of the things I wanted for this portal was the ability to have pages with a different number of columns of various sizes. Initially I wrote it to have three columns. By the way there are many articles on the web devoted to how to implement a three column layout using CSS. Well actually it isn't that hard, but the solution presented here uses JavaScript for reasons that should become obvious.
To me, the most obvious way to achieve this was to allow the columns to be resized. If I provided three columns then the user could resize those columns however they liked - including resizing a column to zero (which would then make it a two column layout) or resizing all but one column to zero (which would make it a one column layout!). So anyway I implemented this in a JavaScript class. The class uses some facilities from prototype , so you need to include prototype.js in any page that uses this splitpane too. Read the rest of this entry »
Posted in javascript, prototype, script.aculo.us | No Comments »
Why should you care? If you'e a software architect, you might want to have some idea of what it is you're supposed to be delivering. If you're a manager, you might want to have some idea of what an architecture can do for your project. If you're a developer you might want to know what an architecture can do for your design and development. If you're none of these things then you must really have something better to do than read this blog right?
So despite my earlier post about the woes of an industry that relies on using analogies with other endeavours, I thought I would take a stab at defining what Architecture is - at least so far as it relates to Software Development. Why would I want to do this? Well, mainly because I've heard the cry 'what we need here is an architecture' or 'what we need here is an architect' pretty often but no one seems to be able to really say what Architecture is. What problems should it address? What are the deliverables? There seems to be no clear definition. Many definitions are self referential a bit like these two entries from dictionary.com:
hill /hɪl/ Pronunciation Key - Show Spelled Pronunciation[hil] –noun
| 1. |
a natural elevation of the earth's surface, smaller than a mountain. |
…
moun‧tain /ˈmaʊn
tn/ Pronunciation Key - Show Spelled Pronunciation[moun-tn] –noun
| 1. |
a natural elevation of the earth's surface rising more or less abruptly to a summit, and attaining an altitude greater than that of a hill |
Well. That's cleared that up then. Fortunately for us we all have a fairly clear concept in our head of what a hill is and what a mountain is. Unfortunately for us that concept varies greatly depending on where you live - A mountain in Scotland barely classes as a bump in the road in the Himalayas. The situation with software architecture is no better, and I would go so far as to say it is much worse. Fortunately for you, lucky reader, by the time you've finished reading this post you'll be in no doubt about what software architecture is (hooray for me) that is if you haven't died of boredom first,
Read the rest of this entry »
Posted in software development, architecture | No Comments »
I've been putting together a portal site - partly because I want a portal that does what I want, partly because its one way to learn ruby/rails. I'm very happy with my host (dreamhost ), but one thing I don't get with my plan is SSL. Well, as you might imagine, I store a significant number of passwords and I want to be able to edit them straight from my portal. Not to mention that I would like to be able to log in without sending my password in cleartext across the wire. So, what to do? Read the rest of this entry »
Posted in cryptography, ruby, javascript | No Comments »
I've been planning to write a series of articles about architectural patterns and was just running over an introduction to them in my head. You know, like: 'What are architectural patterns and why did I feel the need to write them?'. Well, the reason I felt the need was that there simply weren't any. But 'hang on' I hear you say - what about the "Pattern Oriented Software Architecture" books? What about 'Patterns of Enterprise Application Architecture'? Sure; they're useful books - they make you think about the design problems you face every day when you're putting together enterprise applications, but notice I said 'design' there not 'architecture'? So what is 'architecture' exactly? Or more precisely, what is 'software architecture'? Read the rest of this entry »
Posted in software development, architecture, methodology | No Comments »