FatGeekUK

TextMate icon

Father, Husband, Coder, Cook

Stop buzzing, what does it DO?!

Posted by Peter Morris Mon, 30 Jun 2008 11:19:00 GMT

Or possibly, I am too dumb.

Owe posted the first real article in our ping-pong series here

And my initial impression was. Wha? who? huh?

‘Service Contract’, ‘Data Contract’, ‘Message Contract’?

It sounds like something you could sell to a manager, but what does it DO?

Now, this is not a criticism of Owe, or the project he is working on, it is more of an admission on my part that I have not encountered the problem space that he has been tasked with solving and so have not built up the abstract model in my head of the particular ‘gotchas’ of his current area of work.

It does however remind me of the early days of Ruby on Rails, when it was our proud assertion that you only needed 2 books to be a rails developer. (The pickaxe and the Agile Rails book) Pickaxe is the definative RUBY book, and the agile development book was the only (at that time) rails book available.

Many articles of the time tried to draw comparisons between those two books and the mountain of paperwork needed if you where for instance a Java JSP developer.

After Owe submitted his post, we got talking, specifically about the asynchronous situation. And it all sounded nice, but as I thought about it afterwards, several special cases came to mind that would complicate the situation for me.

Please, understand I am talking from an orifice other than my mouth in the following discussion as I have never used tools to do this and have no experience in this particular area to back up my suppositions and assertions. If I am wrong, please, let me know, but don’t shout, I scare easily.

The principle is that when the user tickles the user interface to cause something to be done, (deleting a line from an invoice for instance), the event triggeres a message from the front to the back end that requests that the record in the database be deleted. At this point, the frontend will disable the invoice line within the open invoice window so that no other actions can take place.

The actual removal of the line from the list, must wait on the success message coming back, and this is where things get interesting. In order to not hold the user up, the user interface does not wait for this success (or failure) message, but continues to process user requests.

The user can do ANYTHING else, other than do something with the line which has been disabled.

The system must know the context (which window, which list etc) to alter when the success message comes back. This as far as I can see significantly complicates the handling of the returning events.

For instance, what if the user closes that invoice window and opens another one for a different invoice?

Once that happens, the system has to be smart enough to realise it should do nothing, as the original window is no longer onscreen to alter, but another wondow (of the same class, flavour, type?) IS.

Further… What if the user closes and re opens the same invoice? How is the user interface to know it should disable the previously deleted line?

One way would be to post into a list of ‘expected messages’ an object containing enough context to allow the handler to cope with the return. But as you can imagine it surely starts to complicate things.

Surely, things get more complex. For instance, if there is an outstanding event to delete an invoice line, not only must that line be disabled on all subsequent edits of the invoice prior to the success (or failure) message lands, but in addition, other business logic needs to be asserted. For instance, the invoice must be marked as ‘dirty’ in some way, to ensure that the user interface will not allow it to be printed before the known pending update to its details has been completed successfully.

Please, don’t attempt to tell me that all of these situations and borderline cases are just ‘handled’. There is enough diversity and complexity in this situation to ensure that no automatic process could work without having first identified every sticky situation.

Ok, I have made a fool of myself enough, exposed enough of my ignorance to make any certified MCE chuckle and turn away. So lets examine something else.

The attempt at Microsoft Office lockin, its failure and subequent birth of OOXML.

A while ago (3, 4 years?) Microsoft offered future office users (especially corporate users) a poison challice in the shape of their secure document framework (can’t remember what they called it, but it did the following).

It offered corporates the opportunity to lock up their documents so that if a sensitive memo escaped, it would be unreadable. If they wished, they could say that a documents contents could not be printed, but only viewed on screen. It allowed for documents to be ‘revoked’ or ‘expired’ so they would be unusable after a certain date or as a consequence of a particular event.

All of this sounds wonderful. But, it had the benefit (for microsoft) of ensuring that those documents would only ever be available on microsoft operating systems using microsoft applications forever and ever amen. No more choosing to move to a competing package, because all your old documents would be locked within the microsoft structure. Once you have that, purchasing departments loose all leverage on microsofts pricing policy. All previous data would be held hostage.

Microsoft offering these options sent a ripple through the IT world as the true consequence of accepting these shiney new options was understood.

I believe this was the impetus for large corporate and governmental customers to demand more open file formats from the beast of Redmond. So, what did they come up with?

OOXML. (wikipedia, defective by design)

There are more criticisms of this ‘standard’ than I can really review in any single lunchtime. And that is just at a technical level.

Microsoft then spent considerable effort and money to ensure that OOXML would be ratified as an ECMA standard

OOXML is ratified as an international standard against the express wishes of members of the actual committees formed to decide the matter. See here for details. Brazil, UK, South Africa, Denmark, India, all lodge complaints about this brazen manipulation of the international standards process.

Ok, so, after the rant, we need open standards unencumbered by patent or copyright requirements that can be used without fear of legal reprisal. Anything else is soo skewing the playing field as to completely destroy any pretense of having a free market for information infrastructure.

Posted in  | Tags ,  | no comments

A beginning, or the end of the world as we know it.

Posted by Peter Morris Sat, 28 Jun 2008 19:59:00 GMT

Today, I was discussing software with a friend. It soon became clear that he and I share diametrically opposed opinions about just about everything.

Once we realised this, we had quite an extensive discussion over Ventrilo ranging over several subjects.

It occured to me that it might be better to capture this discussion thread, and after discussing it with him, agreed that we would each post items on our respective blogs discussing our positions, and why the other guy is a raving nutter. :-)

To this end, we are going to both post on our blogs. me here, and him on his blog (here) under the category ‘diametrical opinions’

I hope it is informative, instructive or at lease amusing to somebody out there.

Posted in  | no comments

Don't cross the BEAMS! or, RSPEC? where's my data?

Posted by Peter Morris Fri, 27 Jun 2008 14:23:00 GMT

I am working on a project at the moment, using RSPEC.

All was going swimmingly until I started using fixtures for some of the data.

Once I did, some of the specs (not always the ones mentioning fixtures) started falling out of bed.

Tracing why is a salutary lesson.

On recommendation from peepcode, the original developer of some of these classes had populated the database from ‘before’ clauses.

But, then he had got inventive, and moved the calls from the spec files into the spec helper, to be executed at global scope.

This was ok, until I started to add fixture data for some of the specs. When I did, I started receiving errors from the rspec code itself, not caught by rspec and reported nicely as a runtime error from the specs. This meant it was very difficult to find where the failures where.

Note, I have not looked at the appropriate source for the parts of rspec that are causing the problem, so this is based on observation of the actual results, not from analysis if code.

I added a fixture, and using fixtures seems to trigger the database tables to be handled in a different way. Specifically, it seems to alter when the tables get cleared down. This was causing the attempted writing of duplicated data into the tables to fall foul of validations. Because the errors where happening ‘behind the rspec curtain’ they where just bombing rspec, not telling rspec to report a problem intelligently.

Also, the test suite used to work such that if you did not mention a fixture for a specific test, it assumed you where not using that table, and did nothing to it, thus leaving all sorts of detritus there from other tests, it feels like rspec does something similar.

So, in summary, it is a REALLY bad idea to start loading data into tables from your spec_helper.rb file. And if you do, be aware that then using fixtures can cause you untold sessions of headbanging and ‘angry german kid’

Posted in  | no comments

Bending sql to your will. Crossing an sql table with immediate data.

Posted by Peter Morris Fri, 20 Jun 2008 13:46:00 GMT

Well, you are probably wondering what prompted my last post about ‘sql ghettos’. And well you might. The incident that spawned the term happened over a year ago.

But, I thought I should get my personal stand on the matter documented before I offer this little tid-bit of sql twistedness.

In a current application I am working on, I need to produce a list of items for which work has NOT been done.

Work being done is recorded against the item by attaching a tag with the name of the work task.

Gathering a list of items to be worked on next therefore means looking for items which do NOT have specific tag values associated with them.

Previously, it was good enough to find items for which not all the tags where defined and then spit out a list of the items. That was fine, and handled by a simple piece of code that just counted up how many tags of specific names each item had, and if it had less than the number I was looking for, include it in the list. Fine, jobs a good un, put your feet up, have a cuppa.

But NOW, I need to start keeping track of which tasks have been released to which systems running the jobs.

In order to do this, I need the end result to be a list of items, and where that item does not have a tag, I want a ROW returned with the id of the item and the tag THAT IS NOT THERE.

This is a vastly different argument, and requires you to start searching not just for a low count, but searching AND FINDING things that are not there.

This can be split up into two steps…

  1. generating a list of the items crossed by the tags you are looking for.
  2. decimating that list on finding the tag present.

The first step sounds simple, until you remember that the tag might be referencing a totally new piece of work that has never been done before, and so will not be resident anywhere in the tag table.

So, what you are asking to do is to be able to ‘cross’ an sql table with an array of string literals.

Now, stop, go away and try to do it.

I will discuss my solution after the break…

Read more...

Posted in  | Tags ,  | no comments

Web development frameworks and SQL ghettos.

Posted by Peter Morris Fri, 20 Jun 2008 13:34:00 GMT

My platform of choice is Ruby on Rails.

In an early project, I implemented some reports by coding special purpose sql statements embedded within model methods. This worked well, and allowed the reports to run reasonably speedily.

As I continued to maintain the application and requirements changed, I found that I was reluctant to change the way the model objects interacted as it would require not only changing the model code, but sifting through the mounds of complex and convoluted sql.

What had been an efficient way to handle a problem (generating the reports quickly but in coding time and in runtime) had resulted in ‘scar tissue’, or maybe a fossilisation of my object model structure within the body of the sql.

Over time, this caused me to change the way I was altering the design, by forcing me to add layers around classes instead of refactoring within them.

After I finished on that project, I reviewed what I had done and vowed never to create sql ghettos again.

I think it is an apt term ‘sql ghetto’. An area in your application that you almost dare not go. that hinders future development, forcing it to work around it.

Resist the temptation to make ghettos, for they will surely come back to haunt you.

Posted in  | Tags , , ,  | 2 comments

NPOWER Gas Bill Shellgames

Posted by Peter Morris Thu, 29 May 2008 10:55:00 GMT

We have recently moved our gas supplier from NPOWER.

When with NPOWER we have been having meter readings, some estimated but many actual readings.

In addition, we have been paying by direct debit.

So, I was very surprised to receive a demand for almost 500 pounds.

While disputing this, we receive the ‘final demand’ for this amount.

I phone them, and it is explained that although they control the amount of the direct debit, the bills and direct debit are not calculated from the readings. Yes folks, the amount of gas you use has no bearing on the amount you are charged, OR it turns out, the actual cost of a unit of gas.

They weight each months gas usage differently so as to smooth out the bills across the year. This means that spring is exactly the wrong time to change gas supplier. And the mathematics of the situation make it impossible for mortal man to dispute their assertions.

It also conveniently makes it annoying to attempt to change the supplier as you can never know how much they are going to deem you owe.

Whatever happened to paying for what you owe? Or is that just too simple?

Posted in  | Tags , ,  | 1 comment

WoW WOW - The Guild

Posted by Peter Morris Tue, 27 May 2008 06:31:00 GMT

I had heard about this from a few sources before, but had not followed it up. This morning it was mentioned on The Instance and I followed it.

The Guild is an episodic show that follows the online and offline world of some gamers in a wow like game.

I would LIKE to be able to say that the characters in this show are all a-typical losers, but they aren’t. I personally know people in WoW who could be the inspiration for all of the players in this show (with the possible exception of the guild leader, does that mean that he is ME? shudder)

But, they are not the only people, there are many online who are not like these. Many high function, well adjusted people.

no comments

An Enigma? It's a bloody liberty, that's what it is!

Posted by Peter Morris Mon, 05 May 2008 18:11:00 GMT

I have just finished watching U-571. An American made film about capturing of enigma equipment during the second world war. Now, I went in, KNOWING that I would be annoyed, but willing to forgo historical veracity for the sake of a good story, and in that frame of mind I was able to enjoy the film.

But, it came to the end, and before the end credits, the following came up on screen.

This film is dedicated to the bravery of Allied sailors and officers who risked their lives capturing Enigma materials from U-boats during the Battle of the Atlantic.

May 9, 1941 Enigma machine and coding documents captured from U-110 by HMS Bulldog and HMS Aubretia of the 3rd Escort Group

October 30, 1942 Short weather cipher captured from U-559 by HMS Petard

June 4, 1944 Enigma machine and coding documents captured from U-505 by U.S. Navy Task Force 22.3

Now, I have nothing but admiration for the finesse with which the American producers of the film have spun the facts there.

First, what does H.M.S stand for? What part of the American Military? Which military? which Nation? well, I dunno, it does not SAY… but, when it is a U.S. operation, they say. In actual fact, HMS stood for HIS MAGESTIES SHIP. The designation given to ships from the ROYAL NAVY, thats BRITAIN folks, not an American in sight.

Also, the main source of intel regarding the Enigma system was not gained from these boats. It was gained early on, before the fall of Poland by the POLISH intelligence agencies, and smuggled out from Poland when it fell. Smuggled to England, where the staff of Bletchley Park worked to crack the ciphers with the help of Colossus and Alan Turing.

Yes, no doubt the people on all of those missions displayed great heroism, but the portrayal of the importance of this event and who actually made a difference, well… Frankly, if we where not already winning by 1944 when the American operation took place, well, we probably would not have won.

Ok, Mr Angry is stepping down, after having vented his puss filled spleen.

Posted in  | 1 comment

Rails to_xml, thar be dragons.

Posted by Peter Morris Wed, 30 Apr 2008 13:45:00 GMT

Ok, so I have been using to_xml to handle generating xml serialised lists for a restful xml interface.

I came across this interesting situation.

If you are serialising a collection which is implemented as a set of subclasses using STI, the to_xml will generate different xml depending on which class of items it sees first.

For instance, if you start the list with an instance of the base class, it will generate a list encapsulated with the plural name of the class name, and each element will be a singular of the class name for the base class, irrespective of which classes each of the objects are.

BUT, if the first item in the list is one of the subclasses, the to_xml call will see that it is a heterogenious list (presumably because the successive items don’t all return ‘true’ for .kind_of? of the class of the first item, and will generate a xml list encapsulated as <record> entities within a <records> list.

Oh, that makes me SOO happy.

Posted in  | Tags , ,  | no comments

Quote of the Day

Posted by Peter Morris Wed, 23 Apr 2008 13:01:00 GMT

“A software developer is in the unhappy state that by the time he knows everything he needs to start work, he has probably finished”

Who said that?

Peter Morris, 2008.

Posted in  | no comments

Older posts: 1 2 3 ... 12


Powered