Archive for November, 2008

Some nicely done slides for a Grails presentation

I just noticed a slideshare that Sven Haiges put up on his linkedin profile. It’s a nice set of slides following very much the Presentation Zen concepts of clear concise messages and emphatically NOT reading the slides to your audience. As a result you won’t get much from the slides in terms of information, but you can imagine how great it would have been to have Sven telling you directly all about Grails.

NOTE: This slide set implies that I wrote the documentation for Grails. I did contribute some but trust me the vast majority is from Graeme Rocher, an insanely hardworking man! I don’t know why people assume it is me doing extra stuff; people also thought that as I did a Grails-mail screencast that I wrote the plugin – again I just contributed. I suppose it’s flattering, but credit where credit’s due!

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

26

11 2008

Unit tests – now they work, now they don’t

Writing unit tests is often quite tricky. However even simple ones can cause problems.

I’ve been merging in my GSP whitespace handling changes into Grails 1.1 and found that for me a bunch of unrelated tests were failing – but the Bamboo CI build and presumably the builds on other developers’ machines were not failing on these.

In a nutshell… beware assumptions of hash key ordering. This is pretty basic stuff but it is very easy to overlook, especially when they work when you run them.

Don’t write test code that asserts the toString() of any object that contains unordered Hash objects, or uses keySet()s from them. For example this test renders some objects to JSON, and the order of the properties of each object cannot be guaranteed:

void testConvertErrors() {
  def c = ga.getControllerClass("RestController").newInstance()
  c.testErrors()
  // @todo this test is fragile and depends
  // on runtime environment because
  // of hash key ordering variations
  assertEquals(
     ‘{"errors":[{"object":"Book","field":"title",'+
     '"rejected-value":null,"message":'+
     '"Property [title] cannot be null" },’+
     ‘{"object":"Book","field":"author","rejected-value":null,’+
     ‘"message":’+
     ‘"Property [author] cannot be null"}]}’,
     response.contentAsString)
}

In that case the solution is a bit more tricky. It is arguably better to test for substrings in the response, rather than parse out the whole JSON again and check the data – after all then you’re also unit testing the parsing code too.

Also don’t assume that an iterator/enumerator you get contains just the element you want:

assertEquals "foo", pageContext.getAttributeNamesInScope(
   PageContext.PAGE_SCOPE).nextElement()

If you need to test for the presence of an object in something that is a list or collection, unless part of your test contract is to ensure it is the -only- entry.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

19

11 2008

We already knew those Spring guys were smart…

Well it came out of the blue, but it really was a nice surprise to hear that SpringSource (formerly Interface21) have bought the Groovy and Grails company (G2One).

It seems only fitting that the people behind the best web/EE solutions for Java end up backing the best rapid web development platform for the Java VM, namely Grails.

Congratulations to the team at G2One for brokering this deal. I am very excited about the opportunities this gives Grails to make important inroads into all those “serious” Java development shops who, to date, have felt that Grails/Groovy are “too out there” for them. They couldn’t be more wrong.

You know this to be true when you’ve had a meeting with a manager about some sorely needed features, and within an hour or so of the end of the meeting you’ve got the code working, and as a result some very happy people. Nothing even comes close to Grails in the Java realm.

In these financially difficult times there’s never been a better reason to choose a massively productive framework like Grails – get twice as much (or more) out of your staff, for no extra cost!

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark
Tags: ,

18

11 2008

Where good will and the law butt heads

I’ve been heavily involved in a campaign to stop the new EYFS legislation in the UK causing a lot of problems for Steiner Waldorf (and other non-mainstream educational philosophies) early years education.

I won’t bore you with the details of that campaign here. However the process has revealed a lot to me about politics, government, legislation and the implementation of such “on the ground”.

In a nutshell, approximately half of the Steiner Waldorf kindergartens in the UK accept state-funding for a short period in the 3-4yr age range. A condition of this funding was to submit a “profile” for each child assessing them against certain goals, but this was not a statutory requirement and was not rigidly enforced. It also required information about how children were being guided towards literacy and numeracy at this early age – something that Steiner Waldorf education does not and cannot do in any explicit way at this age, formal and teacher-directed learning being held off until Class 1 (age 6/7).

However Steiner Waldorf kindergartens are generally held in high regard and are well supported by local authorities, being backed up increasingly by new research on learning in the early years. Even within government there are some that appreciate the educational approach and its value, and OFSTED are supportive.

As such this allowed these kindergartens to “play along” with the state systems to enable any parent (not just those with the money for fees) to secure a Steiner education for their child at this sensitive 3-4 year old range where school is not even compulsory yet in the UK. OFSTED would inspect using a different set of criteria for Steiner settings, and the Local Authorities were not heavy handed in collecting the profile data.

Anyway the new EYFS legislation makes all the learning goals and assessment statutory requirements, and makes the inspection against EYFS statutory for OFSTED, and gives the local authority powers (and likely obligations) to ensure that profile data is being collected and submitted.

There are therefore parts of the legislation, including in particular the literacy and numeracy learning goals, that are in direct conflict with the Steiner approach.

Never fear though, after a long battle and changes of heart from Government (“There’s no problem” AKA the immortal DCSF phrase “The EYFS is a flexible framework”, “The exemptions process is not required” to “You all need to apply for exemptions”), there is now an exemptions process that schools can use to exempt them from some learning & development requirements.

BUT. Here’s the catch. To apply for an exemption a school must do a whole load of arduous stuff, which includes asking the local authority if they will agree to continue to provide state funding. They are not obliged to do so. You can see how a local council may remove funding if they will not be receiving meaningful assessment data (the government will be setting targets for the local authorities to meet), and may have constrained budgets that produce thinking such as “Tiddly Winks Nursery up the road from you teaches literacy, we’ll fund them thanks, our budget is tight this year”.

So now if a school applies for an exemption and the local authority says they will not continue to fund, these kindergartens are rather stuck.

If they want to continue taking funding they will have to submit profiles with incomplete data (as no Steiner Waldorf school can compromise on the literacy and numeracy – it breaks the whole educational philosophy), and when OFSTED come to inspect them against the full range of EYFS learning and development requirements, they will inevitably suffer negative consequences. This in the long term could well lead to lower uptake due to poor published results – and eventually cause financial detriment to the setting.

So you end up with a situation whereby educational experts and people within Government know the educational approach is good. The kindergartens are doing good work. But you may only get funding if you follow the conventional learning approaches, and as such settings that embarked on the process of taking state funding to open up the education to a wider audience may find themselves in an unsustainable position.

This is particularly perplexing in the case of the new Hereford Steiner Waldorf Academy, which is fully state-funded, including its kindergarten. No setting that calls itself Steiner Waldorf can compromise on the literacy and numeracy goals, so this implies that the Government’s own academy will receive a poor OFSTED report for its kindergarten. Literacy and numeracy are a major part of the the learning and development requirements set down in the seconday legislation.

Of course the solution for all of this is for the Government to plug their brains in and supply funding to all parents equally whatever educational philosophy they want to pursue. This is anathema to the economics driven approach to education they are taking that requires measurement at every stage, and has turned our children into statistics and outcomes, instead of people who have their own unique place in the world.

The thinking in Government has to change from “We give you this money and you give us this outcome at age 5″ to “We want parents to work and children to be happy – here’s some money to make that happen”.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark
Tags: , ,

14

11 2008

Cynic make a brilliant come back

Cynic were a progressive metal band that releases a seminal album in 1993 called “Focus”. It turns out, by happy accident that they have reformed 15 years later and are touring to promote a new album, in support of Opeth who I am going to see play in a couple of weeks.

The new album is excellent – a modern progression of their original sound and composition. As ever brave and somewhat disorientating it is wonderful to have Cynic back with their new album Traced In Air. It comes as little surprise that their jazz-fusion-metal approach sees them playing a cover of a Mahavishnu Orchestra track live.

Their sound and unusual jazzy chord progressions tend to leave me feeling rather mournful at the end of it all, rather than pumped up and ready to crack skulls, as when I listen to most metal. The album actually reminds me of a metal’d up Oceansize at times, and even strangely reminiscent of some Smashing Pumpkins.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

06

11 2008