Initial Days of the JavaPosse Round-Up 2013

February 26th, 2013 Comments off

On Saturday, 23rd February 2013, South London, early in the morning, having packed my snowboard and a small Samsonite grey suite case overnight, I got up, trying my best not to disturb my partner. I was on my way to London Heathrow. The morning Sun sternly pushed its sunlight through seeming impenetrable clouds in to average Londoner grey day. A couple of snow flakes magically decided to reveal themselves every cubic metre on the fresh wintry quest for vanity. The United Airlines plane took off time to Newark at 10:15. I could sit and back and relax, so they say.

I have to immediately say that Argo, the movie that Ben Affleck won the Oscar Director for, is great, even though you know the result. I was rooted for the government workers to get out. It told the story from both sides, especially the Iranians were frustrated with their lot, their Shah of Iran, who escaped with billions of gold. In my opinion, Ben Affleck is the next Clint Eastween, if this is the standard of his first directed movie. That was the highpoint of transatlantic voyeur; and a large hint of the frustration to come to me.

I attempted to code and write content a little. I had bean researching how GlassFish Embedded application server v4.0 and WebSockets 356 played together, and following the expert group mailing list. Danny Coward now wanted to renamed the current annotations in the specification JSR 356. WebSockets endpoint were not been injected by the CDI Container present GlassFish, and this was a frustration on the plane. Luckily before I took flight I changed the gradle settings to include providedCompile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b77'. This brilliant idea that I had was fantastic, running “gradle idea” sort of worked, but I realised that I missed one other dependency providedCompile 'javax:javaee-api:7.0-b77'". There was no available Internet on the transatlantic plane. It was time to put the machine away.

Untitled

View into Montrose

Eventually, I landed at Denver International Airport after 18 hours, where they do have free-WIFI, only to be shocked at the news: The 19:30 flight from DEN to GUC (Gunnison) was canceled. I got on the internet with phone, something about Dianne Marsh and the Weather and delayed and cancelled flights. United Airlines service customer desk at gate B33 did confirm cancelation of the flight, I was stuck in Denver for the overnight. The clerk handed me a pink slip for the airport hotel. My annoyance really almost saw the milk almost boiling over on the stove: no, I just caught it in time, flicked the switch, the British Gas was extinguished and gladly no lactose was burned: this time. The smell, anyway, would have been so awful. The sense of decorum, in myself, returned, sort of. United had given be a confirmation of Monday 25th February at lunchtime as my next guaranteed flight out to Crested Butte. Two nights in a Denver hotel: you got to be bloody joking! Decorum was gone by the time, my neurons interpreted, filtered and assessed this aural data.

Matt Zimmer, the organiser of the house in Crested Butte that I am staying in, and a friend had also suffered the cancelation of the last United flight to Gunnison many hours earlier. Without Internet access, I was none the wiser. Matt decided to get his luggage and travel by road the next day with D.J Hagberg. I elected to re-route my flight to Montrose, 60km further out from Crested Butte and thanks to advice from Dianne Marsh, I was flying out the next morning on Sunday at 08:10AM. I overnighted at the DoubleTree hotel, about 25 minutes by free shuttle from Denver airport. I was exhausted and my head was minced like Baked Beans.

Untitled

 

I am standing outside the vacation rental house, 329 Maroon. This photo was taken by Matt Zimmer who organised the rental this year. I thought that let somebody else be responsible for a chance, having being the “housemeister” for 2009, 2010 and 2011.

 

Eventually, I arrived at Montrose, the next day, having survived the ordeal of wearing the same clothes for a second day. Bum hole! United had not sent my snowboard and trolley case onwards with me. I reported my missing luggage and got on the Alpine Express, so much for the best laid plan. The original intention of arriving on Saturday night, was that I would have a full Sunday to go up to the mountains and enjoy some powder and board to my heart’s content before the Round-Up on Monday. Chagrin, I love the French. They had a wonderful footballer, didn’t they, Zinedine Zidane.

I desperately wanted to be Zidane, World Cup winner 1998, on the Sunday, so skilful on the football, able to hide his true emotions and then engineer a flash of instant magic that regularly produced the killer pass to the Brazilian legendary striker, World Cup Winner 2002, Ronaldo, when they both played regularly and so sumptuously together at Real Madrid. Alas, my modus operandi were not that good, when speaking to customer representatives on Skype. I was first to arrive at the vacation rental house on Sunday, managed to get an Internet connection, got on the blower to United to see about my snowboard. The web site, United Baggage Resolution Centre, yes it is all true, Dear Lord, is a load of bollocks. Sorry! Excuse my French. The status was always Tracing Your Baggage, Please Check Back Later; and I did every four hours. I went around Crested Butte, got a bite, a Hawaiian style Teriyaki Chicken, to eat at the Last Steep, which is quite decent. I supposedly reasoned that it was good to have finally made it back here again in Crested Butte for my fourth Round-Up event. I, then, withdrew a bundle of US Dollars for spending money. It could have been a blast. It wasn’t to be. I was safe. Instead, I did some coding more on Java Web Sockets, I found out about the techniques for responsive CSS web design and yes that Gradle Dependency was the cause of the CDI injection failure. I solved it. Tyrus 1.0-build11 is the version of the reference implementation inside GlassFish 4.0 server build 77. Great though that was, a change of fresh warm clothes would have been the clincher.

Matt Zimmer arrived in the evening at the vacation rental house in Maroon. Immediately, we went off to Bruce Eckel’s house later in the evening, as D.J. Hagberg also made it to Crested Butte from Denver through the mountain passes. Being a local Coloradian, D.J said that the four hour trip on a regular day took them seven hours, the weather was turbulent high up on 11,000 feet or so. Experience obviously counts: he is a very safe driver. You’d trust him with your life.

Untitled

Crested Butte, Main street, on Sunday afternoon

The mini-progressive dinner at Bruce’s place where everyone contributed a little bit of this, a little bit that, steak; pork chops; a six pack beer, which I did along with my brother-in-spirt-man, Chris Phleps ; a couple of bottle of wine went along way to taking my mind off the baggage ordeal. It was good to meet and greet and see the Round-Up folks from 2011, when I was last here in Crested Butte. Fred Simon, Diane Marsh, Chris Marks and several other regulars were here ahead of time. Also Hans Dockter of Gradleware and Gradle was present at Bruce.

Monday morning started in a despondent fashion with a fifth call over Skype to the UBRC , the status of the website was the same Still Tracing. I learnt by now to try a different tact on this; my partner often suggested this alternative manoeuvre when communicating with customer representatives anywhere in the world, she says: Tell them, only, what you want. I asked for my snowboard and my case to be put on the next available plane to Montrose and I also asked them for the exact location of where the luggage currently was located as the website was useless at revealing this data. I should say, that all calls, go out to India. I am not surprised by outsourcing suffice to say you can figure out yourself the rest of my reaction to this situation. The fifth customer rep said they do all they could, they will send a message to emergency expedite the bags.

Untitled

Matt Zimmer (L) and James Ward (R) discussing Scala Play Framework during the Free Day on Monday. The workshop took place at the “Posse’s old” rental house.

So my Monday, started at Posse house with Matt Zimmer learning a Scala Play framework with James Ward leading us through an introduction and blocking and non-blocking actions. I thought James did a good job. Monday is a free day for the Round-Up; we could learn Big Data if we wanted to, instead we study a topic that interests us collectively. For me and a few others, an introduction to Play Framework was a good topic. We learnt about a tool call Apache Bench and found that on Mac Book Pro at least, Mac OS X, Play does scale nicely to 1000′s of web request on the same machine. James attempted to reconfigure the Execution Context, of the Play’s underlying fork join framework, which is derived from Professor Doug Lea’s incantations or close enough, as all road lead to his Rome, his knowledge of Java Threads and Concurrency is primus uno. We concluded there must be an issue with the number of collected input and output resources at an operating system level. Matt was a little unimpressed with this as he decidedly had commercial Scala and Play project on the line. Marek Radonsky thought the issue could be a configuration failure with the Netty server library, which Play Framework relies on for asynchronous input and output. Still, Play, for me represents a little bit of dichotomy in comparison with the Java EE world.

Wearing the same clothes for the third day did its best to sally my enthusiasm for the Round-Up. I was beginning to lose the will to live by the afternoon, I refused an offer to go snow shoeing around the town of Crested Butte. I hope I didn’t come off with being like a damp squib to the other Round-Up people. The prospect of extensive physical sweat in the only clothes I had on my back knocked the desire out of me, clearly. By this time, Andrew Harmel-Law arrived and I followed him on tour of the vacation rentals, the Posse House, then Bruce Eckel’s house.

I decided by late afternoon to get back into writing that WebSocket Java EE 7 example for my forthcoming book, incidentally called Chapter 7 WebSockets, at the time of writing. Chris Phelps was there at Bruce Eckel’s house and he showed off his cool JavaScript example: AngularJS and Backbone. He said, “It’s was step up from JQuery”. I was impressed so much by AngularJS and Twitter Backbone, I need to add a client example of this into my up and coming book only to show the state-of-the-art. Barry Hawkins, the long time Agile consultant who transferred to California and a gaming company, Riot Games, was also at Bruce’s house, he was learning Kernighan and Ritchie’s C Programming Language. We had a light smirk on this topic. The irony of all. For many of us C was a one of the first professional computing programming language when we read at University or began our careers. No offence to Barry was intended. Learning is a lifetime of progress, so respect is due, to all those who continue with improvement. A few others, Andrew and somebody else, decided to delve into the Groovy programming language. I think shared knowledge learning with somebody else to trade idea is great way to jump into a new technical area, especially when you know that the people that you conserving with, have quality, it was like the meeting of the England Football team international training at Bisham Abbey. Andrew will probably be amused or get slightly annoyed with that national football team comparison, because he, just like my partner, is Scottish, but you know what I mean about quality developer, designer and experienced people, many of them great Americans. The point you know when you are standing with peers of high quality; you have met these sort of professionals, then you know what the quality and the standard is for evermore.

A bunch of us headed to Secret Stash, my mood was somber, I did my best to put on a Lady Gaga appearance emotionally, but my version of Poker Face didn’t hold up so well and my tell came to life and revealed itself when the restaurant and the cooks were 15-20 minute late with my pizza whilst everyone else at the table was tucking into pork infested pizzas. I was hungry, frustrated with United Airlines, and everything else. Eventually the BBQ Chicken arrived; it was just okay. I cracked a few jokes, and war stories here and there. I fist pumped with Chris Phleps about respectively terribles ordeals in the IT industry. We both needed to get the funk out of our collective systems. We both moved on to something better, it was good to give each other that support.

Untitled

Monday night dinner at the Last Steep restaurant. From left to right: Guy, Dimitry, Chris Marks, Chris Phelp, Andrew Harmel-Law, Todd Costella, and Me.

My fight with United continued for seven time after 8pm on Monday. Finally, a breakthrough, my baggage had been located in Denver and they were sending it through to Gunnison, unfortunately the Indian UBRC representative could not tell me either when exactly and how it get to Crested Butte. I went for a short nap, read a few emails and tweets from London UK. Not much going on, Ben Affleck was now a super star actor and director and so was the actors Anne Hathaway with Daniel Day-Lewis making Oscar history. Some cheer at the achievements of others. I ruminated a little about the remaining schedule for my book. Life could be worse. I was fortunate to make it Crested Butte at all.

I dragged my flesh and bones over to the Ted talks taking at the local Matinée theathre in Crested Butte. I was half interested in the Ted talks by 10pm; too much was going in the grey cells. I was, indeed, not looking forward to a fourth day of wearing the same clothes, then, a Dame in shining armour reared her head. I got a message via Matt Zimmer after the Ted talks: Tracy Quinn the wife of Java Posse member, Carl Quinn, Netflix, said she had got my snowboard at Gunnison Airport. The Java Posse team was also a day late getting to Crested Butte, they finally flew in on the evening flight.

Thanks to them, now I have my snowboard and trolley bag for this next morning. I am eternally grateful for their support and bringing my stuff over as well as other people who also had delay baggage to Crested Butte. We can go as we mean to. I have to rush off now to the Tuesday round-up the first proper morning of the Round-Up, wish me luck.

+PP+

Speaking at UK Conferences in 2013: Devoxx UK and ACCU Bristol

February 18th, 2013 Comments off

In the early months of 2013, I have two conference that I, definitely, will be speaking at:

  • Devoxx UK 2013, London. My talk is called Test Driven Development with Java EE 7, Arquillian and Enterprise Containers. This is the first edition of the Devoxx franchise in the United Kingdom. The conference is taking place at the Business Design Centre from March 26th and 27th. The schedule for Devoxx UK is still being determined at the time of writing. It looks like my talk is on the Tuesday at 14:30 in the schedule.
  • ACCU Conference 2013, Bristol. My talk is called Taking Scala into the Enterprise. This is the first edition of the ACCU conference in Bristol; it usually runs from the Barcelo Hotel in Oxford. This year the organiser have decided move the whole conference to the Marriott Hotel in Bristol, which is quite exciting as I have never visited this city. I certainly driven pass it in a car many times. My Scala talk is on the Wednesday 10th April, which is actually on the first day of the regular conference. The conference itself runs from Wednesday 10th April to Saturday 13th. The schedule for the ACCU 2013  has already been published.

Tickets are still available for both of these conferences; so I hope to see you there at one or both of these excellent events.

+PP+

 

Categories: community, Conference, Java, javaee7, Scala, testing Tags:

KeyRemap4MacBook for a Microsoft Natural Keyboard 4000

February 18th, 2013 Comments off

Do you use a Apple Mac Book Pro at work? If you do, then, and if you like to use Microsoft Natural Keyboard for your day job then you might have found that Microsoft and Apple devices do not quite play well together. Some of the most important programming keys are mapped to strange characters.

Luckily enough, the on the keyboard’s Windows Logo key  is mapped to the Apple Alt key; and the keyboard’s Alt key is mapped to the Apple Command key. So it is not so bad on first use. You can also download the IntelliSense drivers from Microsoft for Apple OS X 10.7 and 10.8 and those help in remapping the Apple Command and Alt keys; fortunately the defaults just worked for me. The Number Lock key does not work at all and there is currently no way to fix this.

The biggest concern was the mapping of the double quotes, ampersand, tilde, back quotes and back slash characters. Because I develop software for a living, this reduced my productivity because they keys were mapped to different keys. I, then, found out about a popular tool called KeyRemap4MacBook. Using this program and help from Takayama Fumihiko, the developer/maintainer of KeyRemap4MacBook, eventually gave me exactly what needed.

Remapping Microsoft Natural Keyboard for Mac OS 10.8 here is the file:


<?xml version="1.0"?>
<!--
 ======================================================================
 Mac OS 10.8
 KeyRemap4MacBook for a Microsoft Natural Keyboard 4000
 United Kingdom Layout
 By Peter Pilgrim 12th February 2013
 peter dot pilgrim at gmail dot com

http://xenonique.co.uk

 ======================================================================
-->
<root>
 <!--

http://stackoverflow.com/questions/3202629/where-can-i-find-a-list-of-mac-virtual-key-codes

 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h

https://github.com/tekezo/KeyRemap4MacBook/blob/version_8.0.0/src/bridge/generator/keycode/data/KeyCode.data

 -->
 <symbol_map type="KeyCode" name="AMPERSAND" value="0x13" />
 <symbol_map type="KeyCode" name="DOUBLE_QUOTE" value="0x27" />
 <symbol_map type="KeyCode" name="BACK_SLASH_and_PIPE" value="0x2a" />
 <symbol_map type="KeyCode" name="SECTION_SIGN_and_PLUS_MINUS" value="0x0a" />
 <symbol_map type="KeyCode" name="BACK_TICK_and_TILDE" value="0x32" />

<symbol_map type="KeyCode" name="HASH" value="0x14" />

<item>
 <name>Micro Natural Keyboard - Swap Ampersand and Double Quote</name>
 <identifier>private.ampersand_and_doublequote</identifier>
 <autogen>
 --KeyToKey--
 KeyCode::AMPERSAND, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
 KeyCode::DOUBLE_QUOTE, ModifierFlag::SHIFT_L,
 </autogen>
 <autogen>
 --KeyToKey--
 KeyCode::DOUBLE_QUOTE, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
 KeyCode::AMPERSAND, ModifierFlag::SHIFT_L,
 </autogen>
 </item>
 <item>
 <name>Micro Natural Keyboard - Reconfigure Hash and Tilde key</name>
 <identifier>private.hash_and_tidle</identifier>
 <autogen>
 --KeyToKey--
 KeyCode::BACK_SLASH_and_PIPE, ModifierFlag::NONE,
 KeyCode::HASH, ModifierFlag::OPTION_L,
 </autogen>
 <autogen>
 --KeyToKey--
 KeyCode::BACK_SLASH_and_PIPE, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
 KeyCode::BACK_TICK_and_TILDE, ModifierFlag::SHIFT_L,
 </autogen>
 </item>
 <item>
 <name>Micro Natural Keyboard - Reconfigure Backtick and Pipe key</name>
 <identifier>private.backslash_and_pipe</identifier>
 <autogen>
 --KeyToKey--
 KeyCode::SECTION_SIGN_and_PLUS_MINUS, ModifierFlag::NONE,
 KeyCode::BACK_SLASH_and_PIPE, ModifierFlag::NONE,
 </autogen>
 <autogen>
 --KeyToKey--
 KeyCode::SECTION_SIGN_and_PLUS_MINUS, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
 KeyCode::BACK_SLASH_and_PIPE, ModifierFlag::SHIFT_L,
 </autogen>
 </item>
 <item>
 <name>Micro Natural Keyboard - Reconfigure Just Grave Key to Section Sign Key</name>
 <identifier>private.backtick_and_just_grave_key</identifier>
 <autogen>
 --KeyToKey--
 KeyCode::BACK_TICK_and_TILDE, ModifierFlag::NONE | ModifierFlag::SHIFT_L,
 KeyCode::SECTION_SIGN_and_PLUS_MINUS, ModifierFlag::NONE ,
 </autogen>
 </item>
</root>

Basic syntax for customising KeyRemap4MacBook. Now Natural Keyboard developers on Apple Mac Book Pro can be productive again.

Have fun!

+PP+

Categories: Administration, Apple, Software Tags:

“Why You No Train?”

February 1st, 2013 Comments off

It is a simple question. So why don’t you get more training? Do you feel that you operate already effectively? Is there no more stuff to learn? Do you think that you are already “good”? Sometimes,  just when we are walking about and we feel everything is going smoothly, then the bottom drops out of the bucket, our world suddenly of positivity, in the situation, our lives, family and friends, takes a nose dive to the other side. When our world changes to tragedy, conflict and controversy those times,we all experienced, can be really depressing and shockingly awful. These are the times when we start to kick ourselves, probably. We reproach ourselves with, “I should’ve done this. I could’ve done that.” Well the question at the beginning still stand, why do you not care about any changing the train, saving for a rainy day, and could of all of this tragedy be avoided. They say, prevention is better than the cure. We could all have done with some forewarning, some training. If you are expecting a company to train you in all things; then that is great, especially if you are a star performer on the ye olde balance scorecard, getting 100% in the 360 review, and if your boss is terrific, he and she will send to you training. If the company has the money to invest in you, when you are brilliant and company thinks so as well then they will continue to invest in you. For the rest of us mortal souls, though, we are not perfect creatures and probably never going to be fortunate for the big golden handshake of continuous personal development and abundant budgets. Some companies do care about their employers and give them a fair crack of training budget. Sadly, the training budgets for the common worker, developer and designer team are reducing month by month, and it is one of the first thing that are cut in a downturn. So if you are waiting for a company to send you on splendid trip to conference to JavaOne 2013, with all expenses, flights, hotels and tickets, paid; good luck with that. In the next section, I thought about some insights in to the gaining personal training, divided in two sections. The company does not want give you the training you really want, what can you do as alternative.

  1. Spent your own personal money and funds; if you believe in it and then you will do it
  2. Negotiate with the training company, they might be able  to cut you a special deal on a early bird that far enough in the future.
  3. Find a user group who are doing a coding group or the practising the skills you desire
  4. Find another organisation to work for, watch the job adverts for up and coming talent and especially firms with attractive starting gifts like those willing to throw in a Retina edition mac book pro; trade that in for the training instead as a condition of joining
  5. Find another job that pays more money and then personally fund the training you need
  6. Trade skills with a pal. Suppose you have reasonable advanced knowledge in No SQL databases, like Mongo DB, and want to learn better JavaScript then try good old-horse trading with a colleague might just be way to get training on your side as well as theirs
  7. Don’t accept the classic answer from the boss, “How does X help the business?”. If the training is relevant to you achieving a goal of being a much better software engineer and designer, then, of course it is relevant. These types of answers are just excuses to keep you, bedded down; to just give in and accept the status quo, which, of course, is utter nonsense. Perhaps, the time has finally come to find better job.
  8. As a last option and certainly one that I personally can testify for is, you could become a contractor instead of an employee. As contractor you find, organise and pay for your own training, because it is up to the contractor to stay up to data and learn new skills. Training counts as unpaid leave or can taken between subsequent contracts. Contractors may have certain tax advantages for training and materials, and of course, more money means you can attend more training and conferences.

Ok let suppose you are the boss, you are the line manager and you have a good team.

  1. Fight for your team and their training; fight for your team’s budget and don’t let the senior management take it away
  2. Give up your personal training for the entire year and suggest that they allocate the extra budget to training for your team members
  3. Perhaps, it is time to evaluate the relationship with the preferred supplier of training, if your company operates like this. Have your firm been getting decent value from the PSL (preferred supplier list)? No, then try an independent trainer, a famous speaker or find a lone runner, who is much smaller than the big training business, but can deliver bespoke training to you company. Procrastinating on a bad PSL is a waste of everyone’s and your business’s time.
  4. Find alternatives to training like brown bag lunches, collaborate with other businesses
  5. Get on the old blower (the telephone) to the training company and use your managerial skills to negotiate rate especially for early birds far into the future
  6. Take the sword for the team when your boss says the training budget has to be cut. Say that you will resign if the team’s training budget is cut. They will probably think hard and fast, the cost of recruiting another person just like you, training somebody else up in your role equates to training for about 4 or 6 developers.
  7. Don’t be idiot and attempt to coach or mentor in the training yourself, especially if you have no idea what you are talking about. Don’t go cheap, go for the quality training for team member.
  8. Use so-called creative accounting and budget, stick too fingers to human resources dictum, find an independent trainer not for you, but your team. Use the magic entry in the budget cover the training. Insist to HR afterwards that you wanted your team to be best, be productive and get the job done with higher quality. If HR still don’t like it, then perhaps it is time to be a manager in another firm, because your firm would have shown their idea of value of people in the organisation. (If you are going to leave, think about taking your best pal with you.)

Without commitment to training and learning new skills there can be no continuous improvement, which is one of the prime directives for Agile and Lean engineering. I hope that I have given you some great ideas. Everybody needs training and self-improvement; don’t let the government or business tell you otherwise. +PP+

Categories: Agile, Communication, discourse, Economy, exchange Tags:

GlassFish 4 Promoted Build, Gradle and Embedded Application Server

January 31st, 2013 Comments off

Very recently, perhaps towards end of last year, the GlassFish open source team released GlassFish 4.0 beta 72 as a promoted build. Arun Gupta posted an article on the Maven coordinates for the GlassFish 4 .0 beta 72 on his blog. This release was significant because the team published the artifacts into a maven repository.

This year, 2013, I am the author of a up and coming Java EE 7 User Guide and so it is important that I investigate the latest GlassFish, especially since it is the reference implementation of the specification. I want to actually research and investigate how far the latest Java Servlets 3.1, Web Sockets and JAX-RS specifications behave in the server.

Here is a Gradle build script that I wrote last night to execute an GlassFish Embedded application:

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

group = 'com.javaeehandbook.book1'
archivesBaseName = 'ch06-servlets-basic'
version = '1.0'

repositories {
 mavenCentral()
 maven {
   url 'https://maven.java.net/content/groups/promoted'
 }
 maven {
   url 'http://repository.jboss.org/nexus/content/groups/public'
 }
}

dependencies {
 compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b72'
 compile 'javax:javaee-api:7.0-b72'
 testCompile 'junit:junit:4.10'
}

// Override Gradle defaults - a force an exploded JAR view
sourceSets {
 main {
   output.resourcesDir = 'build/classes/main'
   output.classesDir = 'build/classes/main'
 }
 test {
   output.resourcesDir = 'build/classes/test'
   output.classesDir = 'build/classes/test'
 }
}

task(run, dependsOn: 'classes', type: JavaExec) {
 description = 'Runs the main application'
 main = 'je7hb.common.webcontainer.embedded.glassfish.EmbeddedRunner'
 classpath = sourceSets.main.runtimeClasspath
}

The key to the build script is the order of the dependencies. I found that the glassfish-embedded-all had to be first dependency on the list, otherwise there would be ValidationException from the Hibernate Validator (bean validator) jar not being found. The exception message was "javax.validation.ValidationException: Unable to load Bean Validation provider".

The Gradle build also references the GlassFish Java repositories, which is the second key point.

Here is the EmbeddedRunner, the Java application code:

package je7hb.common.webcontainer.embedded.glassfish;

import org.glassfish.embeddable.*;
import java.io.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

public class EmbeddedRunner {

 private int port;
 private AtomicBoolean initialized = new AtomicBoolean();
 private GlassFish glassfish;

 public EmbeddedRunner(int port) {
   this.port = port;
 }

 public EmbeddedRunner init() throws Exception{
   if ( initialized.get() ) {
     throw new RuntimeException("runner was already initialized");
   }
   BootstrapProperties bootstrapProperties = new BootstrapProperties();
   GlassFishRuntime glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties);

   GlassFishProperties glassfishProperties = new GlassFishProperties();
   glassfishProperties.setPort("http-listener", port);
   String [] paths = System.getProperty("java.class.path").split(File.pathSeparator);
   for (int j=0; j<paths.length; ++j) {
     System.out.printf("classpath[%d] = %s\n", j, paths[j]);
   }
   glassfish = glassfishRuntime.newGlassFish(glassfishProperties);
   initialized.set(true);
   return this;
 }

  private void check() {
    if ( !initialized.get() ) {
      throw new RuntimeException("runner was not initialised");
    }
  }

  public EmbeddedRunner start() throws Exception{
    check();
    glassfish.start();
    return this;
  }

  public EmbeddedRunner stop() throws Exception{
    check();
    glassfish.stop();
    return this;
  }

  public static void main(String args[]) throws Exception {
    EmbeddedRunner runner = new EmbeddedRunner(8080).init().start();
    Thread.sleep(1000);
    runner.stop();
  }
}

The class executes the embedded GlassFish as the beginnings of a containerless build, which is a term that James Ward and others have coined. This class starts GlassFish, waits one second, and then shuts it down again. The code works with Gradle, by invoking at the command line gradle run or through an IDE. I used the command gradle idea to generate IDEA project files.

Here is sample output from IntelliJ IDEA 12:

/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/bin/java -Didea.launcher.port=7537 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 -classpath "/Users/Developer/Documents/IdeaProjects/javaee7-handbook/ch06/servlets-basic/out/production/servlets-basic:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/org.glassfish.main.extras/glassfish-embedded-all/4.0-b72/jar/942b982d5c005806a08843d2a1f411f278c04077/glassfish-embedded-all-4.0-b72.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/javax/javaee-api/7.0-b72/jar/56d50eaa8d21c2f70394f607efc1aa27c360141d/javaee-api-7.0-b72.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/javax.activation/activation/1.1/jar/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/com.sun.mail/javax.mail/1.4.6-rc1/jar/5c5de8592e570afb595a8be727b484d438b49d69/javax.mail-1.4.6-rc1.jar:/Applications/IntelliJ IDEA 11.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain je7hb.common.webcontainer.embedded.glassfish.EmbeddedRunner
classpath[0] = /Users/Developer/Documents/IdeaProjects/javaee7-handbook/ch06/servlets-basic/out/production/servlets-basic
classpath[1] = /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar
classpath[26] = /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/zipfs.jar
classpath[27] = /Users/Developer/.gradle/caches/artifacts-15/filestore/org.glassfish.main.extras/glassfish-embedded-all/4.0-b72/jar/942b982d5c005806a08843d2a1f411f278c04077/glassfish-embedded-all-4.0-b72.jar
classpath[28] = /Users/Developer/.gradle/caches/artifacts-15/filestore/javax/javaee-api/7.0-b72/jar/56d50eaa8d21c2f70394f607efc1aa27c360141d/javaee-api-7.0-b72.jar
classpath[29] = /Users/Developer/.gradle/caches/artifacts-15/filestore/javax.activation/activation/1.1/jar/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar
classpath[30] = /Users/Developer/.gradle/caches/artifacts-15/filestore/com.sun.mail/javax.mail/1.4.6-rc1/jar/5c5de8592e570afb595a8be727b484d438b49d69/javax.mail-1.4.6-rc1.jar
classpath[31] = /Applications/IntelliJ IDEA 11.app/lib/idea_rt.jar
Found populator: org.glassfish.kernel.embedded.EmbeddedDomainXml
Jan 31, 2013 10:05:12 AM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize
INFO: Authorization Service has successfully initialized.
Jan 31, 2013 10:05:12 AM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.0.0.Alpha1
Jan 31, 2013 10:05:13 AM com.sun.enterprise.config.modularity.StartupConfigBeanOverrider postConstruct
INFO: Starting the config overriding procedure
Jan 31, 2013 10:05:13 AM com.sun.enterprise.config.modularity.StartupConfigBeanOverrider postConstruct
INFO: Finished the config overriding procedure
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3 started in: 18ms - bound to [/0.0.0.0:8,080]
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3 started in: 3ms - bound to [/0.0.0.0:8,081]
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.server.AppServerStartup$StartupActivator awaitCompletion
INFO: Undefined Product Name - define product and version info in config/branding 0.0.0 (0) startup time : Embedded (1,204ms), startup services(856ms), total(2,060ms)
Jan 31, 2013 10:05:13 AM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService has disabled JMXConnector system
Jan 31, 2013 10:05:13 AM com.sun.enterprise.connectors.jms.util.JmsRaUtil getInstalledMqVersion
WARNING: RAR7000 : Check for a new version of MQ installation failed : /var/folders/kr/vj5fd5s91g76_t348ndnbtxr0000gn/T/gfembed883899172293116872tmp/lib/install/applications/jmsra/../imqjmsra.rar (No such file or directory):/var/folders/kr/vj5fd5s91g76_t348ndnbtxr0000gn/T/gfembed883899172293116872tmp/lib/install/applications/jmsra/imqjmsra.rar
Jan 31, 2013 10:05:14 AM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
JdbcRuntimeExtension, getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]
Jan 31, 2013 10:05:15 AM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished

Process finished with exit code 0

You should be seeing something the above output in the IDE if you are doing it right. It would appear we will have to be on our guard until JDK 9 in order to avoid class path loading issues. My book on the user guide to Java EE 7 is scheduled for the Summer of 2013.

Happy Testing.

+PP+

Categories: Author, Book, Glassfish, JavaEE, javaee7, programming Tags:

Can’t Change; Won’t Change

January 31st, 2013 1 comment

I have called this piece: Can’t Change, Won’t Change. It is about what I found in recent years working in the financial services industry, in particular inside investment banking. I witnessed Agile adoption inside these organisations. Sad to say, it did not happen. Instead, lip service was paid to say SCRUM, for example. A lot of banks talked the game of Agile with a big “A”, but in truth their efforts was in a very small “a”. Daily stand-up meetings were actually, in fact, sit-downs. They did not less than 15 minutes, typically, but were regularly overtaken by database integration and production issues, project management tasks, and ran for almost an hour, whilst the whole team was wasted by business as usual matters, which most of the team did require the whole team to be present. Agile adoption was a complete waste of time, because banks did not have time for user story boards, nor did their employees or contractor really want to stick paper and/or cardboard tickets onto any type of board. The heart was not in it to begin with. There was a lack of space for even for user story boards. It was impossible to stick papers to glass windows and the modern building architecture. Their game was just to rely heavily on JIRA or TRAC, there was a distinct lack of motivation, opportunity or innovation to extend the electronic task board beyond the machine. In the end, they  continued to fail in any way to get close to a self-organising team. Even if there was buy-in from the senior management, sometime leading by authority could have helped, but there was somebody in the lower management that torpedoed any attempts for better agile adoption. In the end, there was no chance to practise agile software development with a big “A”; and if you wanted to try your hand at pair-programming and pragmatic test driven-development then the answer was a resounding not a hope of a chance, ever. Therefore continual improvement was at stand-still.

I have found out now that if you really want to learn how Agile with a big “A” is done, then step away and outside of an investment banking environment as I have done this year. My advice is to find organisations that do practice what they preach and not dream, where there is true transparency and integrity. In the past few years, it has become more important that developers and designers have some experience of Agile techniques and not just lip service. It is sad, but true. I can change and definitely I want change.

Some Advice for New University Graduates; Dreams of Developing Software

December 26th, 2012 1 comment

I have taken a step back in an attempt to put the year 2012 in focus. As always, it started with great hopes and there were highs and it seemed for a moment, that working life was back on track, but lurking in the background was an impending disaster. The problems were not fixed, I can see them now, but that is for another blog post.

In this post, I went with another angle of working life, I pondered for a moment, what on earth would I tell myself as the twenty something university graduate? What advice would I give to another university graduate now?

Tools, Frameworks and Languages

The tools for writing applications are definitely here. At the end of 2012 there are an abundance compared to slow pre-Internet age of 1992. You have lots of opportunities in programming languages such as Java. It runs on a virtual machine and you can forget about dreams of C++ being a guru engineer and purely object oriented development. The landscape is changing. I would say learn something about functional programming languages. You have to learn version control systems such Subversion, Mercurial and Github. Take advantage of the new technologies for learning, videos and on line courses, broadband Internet, and ways to amplify your knowledge. Remember: technology is not the answer, a panacea on its own, it only exists to serve to every human being, to provide efficiency, improvement and greater achievements in progress. Out there is such a breadth of knowledge waiting and so little time to learn it all. Choose your technology and learning wisely.

I would warn myself about the dangers of social networking, and suggest you would do the very same. Privacy is dear. Code and ideas are dear. Keep some part of life in the off-line mode for your own security, if nothing else. Other people have been known to take ideas with out credit and attributions. That drunken binge or that slur against some person could in the future become a living nightmare. Only ever put on the Internet, the stuff you are truly happy to let be public knowledge; find the balance between share-nothing and share-almost-anything for yourself. Be wary of code that you do put out there in the Internet.  In my opinion in the future it could be held or used against. If you are showcasing ‘wares make sure it is the best work that you can do, don’t be shoddy or lazy about programming. Being part of open source framework as a committer is a good thing, it will open doors, and you get to meet electronically people on the other side of the planet. You might even be lucky enough to meet the other committers at conference or visit on holiday; maybe they may come to you. Life is better with the people you know; who know you and therefore have a bond with.

Because they are too many tools, frameworks and programming languages out there, I would advise myself to choose the special interest wisely with a view of what is going to benefit my career in the long term. Nobody can be master of all trades in IT. Now, our profession is too long in the tooth for that. If you want to be good developer, be that, a database girl be that, a security dude, then be that. Practise, rehearse and train in order to “get good”, only then will you become great at whatever it is you choose to do. Choose something you enjoy not the thing that your mother and father tells you that you must do. Listen to your beating heart first, before listening to the opinion of other people. Develop that gut, that the gut-feeling, the little voice in your head, the spirt that comes sometimes you feel exciting or when there is a sudden whisper of foreboding, an ill-wind, whatever, because it is true. It is the one statement of a fact that is not a YAGNI, you are going to need it, your inner voice.

You must live and work with other people. If the code is an experiment and is just for fun, then advertise as that with a definite label. Code is also nothing with people. Unfortunately code is the easy part, it is the dealing with the people, the communication, the handling of information between groups of folk, the social aspects, which are the hard parts.

Elitism

Surprise, surprise: be warned that Elitism is still in effect. Nothing has changed since the early 1990’s in what is legalised prejudice of university graduates. Employers are allowed to specify on job advertisements that they are only interested in certain set of candidates from so-called red brick universities [2] even though this smacks in the face of diversity and fair entrance. There are employers wanting the so-called best software developers out of university or higher education college, if you have less than second-class first level degree (2-1) your application might tossed directly straight in the bin [1]. In my day applications were sent by post, now it is quite easy to discard a very crafted Word or PDF document in to the digital waste receptacle in the sky. Yet, it is common knowledge, or it should be, in the IT profession that a certain Mr Bill Gates, of Microsoft, did not even graduate with a degree.

My advice is to the same now as it was then, Keeping On Moving [10], there are always alternatives to elitist organisations, which may well go out of business sooner rather than later. I learnt very quickly there is always one choice, colloquially, known as The Law of Two Feet [9]. All you have to do build on the network that you started whilst in university. The teacher or lecturer you did the best project for, the mate that you had the best times with at the pub, even the gym is a place to find and discuss opportunity. If you have impressed a friend or colleague and if they are really your friend, know you personally, then you are more likely to get opportunities of work that are more suited to your skills.

Job Shock

During the early 1990’s the world was recovering from previous financial crisis, albeit it was a smaller compared to the massive crunching meltdown that we have had running now for five years, since 2007. For the record, I am also grating my teeth too, in frustration with you too.  I feel. I am a human being too. The shocking stories of the job search of recent university graduate have left me cold.

There was a time before the monetary union of Europe and the Euro, when each country in the European union had it’s own currency like the Deutschemark, the Franc, the Peseta and Lira; and therefore their own national bank of control, of monetary policy, then there was the possibility and the economic reality of at least Germany still being the powerhouse of Europe and the World when Britain was in the doldrums. Indeed, Germany was able to survive the recession of the early 1990’s, I know because I was living there for a time.

Since the turn of the century, the sudden explosion of the Internet, the reliance on better communication links, the rise of common markets, radical improvements of technology, better efficiencies in trading have meant we have a global economy.  The door has closed forever on hoping over the English Channel to find lucrative work, even if the language barriers were not there at all. A recession in Germany most certainly means a downturn in Britain and Ireland.

For university graduates, this means that getting a job search is much harder than 15 and 20 years ago. The competition is fierce; the depression is deep. Some graduates wondered why they have invested their formative years in to getting a university paper only to find themselves flipping hamburgers at McDonald or desperately applying to become a retail shop assistant at the local Debenhams or Next fashion store [3][4].

The Job-Shock of 2012 is clearly worse than 1992.

Eric, Newcastle

I have just passed my 1 year anniversary from my master’s degree. There’s nothing to celebrate because it’s also the same time I started looking for jobs and 1 year on, I have had no success. I have been to nearly a dozen interviews to progress on my career to be an engineer and have had no success.

Laura, London

I completely understand what you guys mean. It is so hard to keep motivated when you keep getting told, “Sorry, you haven’t got enough experience” and then you say “but that’s why I want a job!!”

With the two years from finishing my degree to starting my graduate job I gained experience and continued to apply. Getting experience isn’t easy though because quite often you need some experience to get experience. My advice is to plan what skills you want to show experience in then make a plan from their, starting with smaller experience and aiming for the bigger stuff when you have something in hand.

We are losing young and gifted people across a wide-cross section of disciplines [5]. Some are giving up on their dreams of having a career. Sadly, some people who thought about a career in information technology, software development, programming or designing applications, may already be saying to themselves: too long and hard to achieve the result I dreamed of; do not think to apply because it never happens to people just like me.

Continuous Reinvention

I am here to tell you that if you want to get a programming job in information technology then it is possible. Don’t give on IT just yet. The roles are there, if you keep looking for them. It is quite similar to dating. Two people will never meet each other, if they stop searching of the other lover. If either one of them gives up then the cause of true love is lost. But then, how do I find a job? A better question is, how do I find a job that I really will enjoy? The best and ideal way to do this is, I think, is to find that company and group of employers that is enthusiastic, altruistic and cultured. In other words, the company must have a distinct lack of dysfunction, but you as a graduate candidate have already found that to be true, yours suspicions, which you most likely experienced on the job hunt are quite correct, I am afraid.  You absolutely correct to note that every company that advertises, “We hire only the best candidates”, is logically not “the best”.  Learn to read those job specifications and as some would say read between the lines. Ask some searching questions: what happened to last year’s recruitment? As an addendum to the infamous and standard question: How did this job become vacant?

Start networking when your career is in infancy. Keep your ear to the ground and listening and learn the behaviours of others. It is sad, but true, in the IT career too, you have to watch your back as well. Resist the temptation to be closed and unapproachable, instead be that person, open to change, a mind like parachute. Remember who put the faith in you and got you to this great position that you are in now. You have a university degree or better, not many people in the world get that, and those who try to put you down, are jealous, because when they had their chance in life, they bloody blew it. Just because they took a mis-step then that does not mean you are going to. If you really want to be black and proud and be bad meaning good, then for heaven’s sake, buy the CD or download the MP3 of Public Enemy: Fight The Power, Rebel without a Pause and Bring The Noise [8]. Rock on out in your bedroom when you feel the world is against you. For all other people find some inspiration and music to gets you going, motivates and inspires positivity in yourself, whatever it is, whether music, theatre, classics, walking the dog, or a landscape that you remember as a child, then keep on at it and make it your central core, your sword and shield in the battle, the battle of survival.

When you leave university and get on the job market for the first time, it is a great time to learn and identify the different types of institutions. For instance, you may have thought that big company ACME was the best for you to a get a job in, perhaps you were tempted by the glossy brochure, or the suited and booted personel at the job fair, maybe they had the best gizmos in the handout bag at a conference; and then you later find out that the much smaller FROZFIZZ is better. You will be probably be surprised at youreself suddenly turning to the FROZFIZZ, and finding this smaller enterprise attractive. Maybe it was because they have a better training scheme, perhaps they send there employees to get  proper IT certifications, and perhaps they offer a real chance to use the next interesting new technology or framework there. More often or not, the FROZFIZZ employees seem really happy ,warm and generous. It is not fake, because you can confirm from a friend who recently got a job there. That is good-cultured. You know it when you find it. Some people spent their life trying to find the good culture. Okay, FROZFIZZ has a much lower starting salary than ACME and they cannot afford to pay an contributory pension plan or some other additional benefits compared to ACME. This is the time after university to learn how to measure up and down different employers when, most likely, you have not yet got the husband or the wife or long term spouse to bloody annoy you and you can concentrate on what is best for you and your career. Twenty years down the line, you will not regret choosing happiness in organisations like FROZFIZZ rather the gravy train of ACME. In fact, it is better to have worked at series of FROZFIZZ like companies than stick to the pressure and unloved atmosphere of ACME for ten years, even if you start climbing the promotional ladder in to senior management. The one thing that I want to hit you home with, that is almost universal truth, “The People are the Company”.

In software industry, which is a global economy, being comfortable where you work and when you work is the most important reason for having a career. Yes it can be learning Java or Scala or Groovy some other programming language, but if the company is dysfunctional then the world can feel like a horrid place. In this day and age, we are rapidly seeing the decline of a job-for-life. If you cannot change the organisation, then change the organisation.

Some people, do leave the country just to find that the one opportunity to start an IT career. If you want my advice, and you are seriously considering it, then do it. If nothing else, you will learn a new language, if English is not the native language of country that you will work in, and you will have a different culture and outlook of life to tune it in. It will demonstrate to the world, on your curriculum vitate that you are one of the few who is remarkable, courageous and brave. Although leaving the country is tough and deliberate decision for many people, you can always come back after a few years. Even fewer souls, permanently leave Great Britain for the USA or beyond and never return, their lives changed because they made the decision. It is all about finding alternatives.

Remember you always a choice. Just ask Carol Vorderman [7]. Stay the course, and achieve your dreams of becoming a professional software developer; I guarantee you will not regret it.

[1] http://www.standard.co.uk/news/work/sign-of-the-times-graduates-take-to-streets-in-search-of-job-8226282.html

[2] http://en.wikipedia.org/wiki/Red_brick_university

[3] http://www.independent.co.uk/news/education/education-news/redbrick-universities-are-more-elitist-than-oxbridge-634051.html

[4] http://www.guardian.co.uk/money/2012/jul/04/graduate-recruiters-look-for-21-degree?intcmp=239

[5] http://www.guardian.co.uk/education/2012/jul/31/lower-second-degree-employment-prospects

[6] http://en.wikipedia.org/wiki/Organizational_culture

[7] http://www.guardian.co.uk/theguardian/shortcuts/2012/jul/04/dont-judge-job-applicant-by-degree

[8] http://en.wikipedia.org/wiki/Fight_the_Power

[9] http://en.wikipedia.org/wiki/Open-space_technology

[10] http://en.wikipedia.org/wiki/Keep_On_Movin’_(Soul_II_Soul_song)

+PP+

Your Next PR Disaster is Inevitable When You Provide No Feedback

December 25th, 2012 Comments off

This is a warning to the reader; your might feel at the end of this entry that it is all Dickens’s Christmas Carol and “Bah! Humbug!”. You would be rightfully semi-accurate in your analysis, of course.

Quite simply, I hate when I go to an interview that is either face-to-face with a potential employer, or a client, and then I have to fight tooth and nail to get those statements of fact that many ordinary souls could consider to feedback from the interviewers or clients. I am amazed, more often than not, in today’s climate when I get unexpected feedback; most of the time I have specifically ask for it.

In my long career of some twenty years or so, I have attended many competency based styles of interviews, and I have learnt in all that time, you cannot effectively improve your skills without a third-party honest ethical reference telling you exactly what you were strong on and what specifically you were weak on.

When I use skills here, I am deliberately being very wide in the definition of term; it can be communication skills, behavourial skills, technical skills or even sitting-still-in-chair-with-your-hands-motionless whilst you talking skills. I will also include puzzle solving, listening to the interviewer, technical analysis and getting off my bum to do a bit of white-boarding, and rapport building, submitting a sample test programming project and panel interviews as part of this scheme.

There is a nothing worse than when you have done all that you can do to perform by giving your valuable time and effort to a round of interviews, and then hearing the cacophony sound of silence; and seeing nothing wafting in the email inbox for a few days. If you have ever attended an interview and waited more 24-48 hours for an answer, and seen and heard nothing, then you probably know placing your on heart that this is an instant fail. If you have ever attended an  interview and got the answer of “no” and the client and the recruiter had no feedback in their response then that I too would classify the end as a similar fail. If you have ever received an “no” and then asked for feedback, and then also received a blank response, then, in fact, that is plainly rude. If you have never received any feedback from the interviews whatsoever then that series of flawed communication from a so-called officer of a reputable business, from beginning to end, actually, is very revealing about the target organisation; and says that perhaps enduring the entire process was a close miss, from your point of view.

Sometimes, after receiving a “no” from an interview, then I have, to be absolutely fair, received some great feedback and pointers on things that I missed and definitely things I could improve on. I have gone over those weaknesses, then revised, educated myself and rehearsed. I improved myself. Sometimes the mostly painful feedback is the stuff you don’t want listen to. I certainly had to train to listen and not just hear.  When I have won a contract and got the job I have learned what the interviewer and recruiter also thought about my appearance, skills, white-boarding and communications; basically the whole lot. So this gripe is not for those who are good at giving prompt, fair and concise feedback whether it is in a good or bad light. They do not have to worry.

In the earlier part of my career, long before the Facebook and Twitter, it was customary to receive the rejection letters through the post. Nowadays, it is the rejection email. For university graduate developers, in these Twenty Tens, it is now even worse, if they they do not receive a response then they may as well consider themselves rejected. Is this the state of business communication in the early twentieth first century? Really. And we thought that we were a classless society; elitism had been knocked cleanly on the head. Surprise. It never actually vanished into the thin air. When we have laden the front-door to new software engineers in our industry with a flaming glass ceiling of unemotional dependency injection. This action is a contempt for an industry and the people working inside it. This, very sadly, is a disgrace.

Dependency injection may work for building the infrastructure of application software and abstracting two components from explicit referring to each other, but does it work not at all for human beings, especially the newest talent? Feelings are hurt; belief and hope with ambitions are trampled; dreams are thrown asunder. No wonder it has hard to attract new people; whether they are youngest and brightest undergraduates, or they are mature folk and utterly serious about retraining in to computer science, if this final result of lack of feedback is a spit on the face, which they have, ultimately, to look forward to.

It is just not enough to say “no”. It does not help the recruitment consultant and the prospective candidate. How can the recruiter help to get better people for the organisation? How can the candidate ever know what went wrong? We are reaping bad karma and more misery on those people who are trying to keep fighting the good fight.

The stock answer from the client that is unforgivable and long-term patched in the synaptic memory is “Sorry. I am so busy that I really cannot afford to do it. You want me to give feedback on all of the candidates who interview here. I got more important things to do in the meantime. Unfortunately, I don’t have time for that.” If you read that and do happen to agree with that sentiment, then shame on you. Here it is the crux; effective candidates require feedback. Senior developers and technical leads always want to improve. The most talented inexperienced engineer who only has a couple of A-level’s wants to improve. If you do not care to give feedback, I guarantee you this fact; they will remember you and your company. Candidates who interview with or without a recruitment agent deserve feedback. You, as a technical leader, have a duty to provide it. It is your job description, so just do it.

It will be a terrible day when one of those candidates that you interviewed and failed to provide feedback for remembers you and your company when they do just give up; and instead grow to become to the next successful generation of rock star developers: a public relations disaster of your own making.

+PP+

PS: Managers and technical leaders need to be give regular feedback direct to their team members. If they do not then they are not being effective in any organisation. If they want all people to perform then they need to coach and mentor others too in order to become better.

Categories: Business, career, discourse, diversity, it, leadership Tags:

Agile Software Developer Terminology for New Programmers

December 21st, 2012 2 comments

This is a post for new developers, young, inexperienced or old and retraining into information technology.

Recently, I had a discussion with many engineers at one of those many London user group nights about how there is so much new stuff that we have to explain to people new to programming. One person had to coach a graduate developer on writing unit tests. Another person had to explain the reasons why dependency injection is better than dependency lookup.  I can recall similarly stuff, being able to gently and concise explain why we should have unit tests in the code, and why we need them.

Here is my current matrix of terms:

Term Description
YAGNI You Are Not Going To Need It – The issue hare is that far more code is written than necessary to solve or deliver application functionality. 

Classic symptom: Added unused finder methods to session beans in Java EE

DRY Don’t Repeat Yourself – writing code that has lot of duplication across methods, classes, packages and package object. 

Classic symptoms: Copy & Paste coding in unit tests and repeated metadata in entity and the front end

KISS Keep It Simple Silly [or Stupid] – a mantra to describe writing only code to solve the function problem instead of writing a less complicated codeAlso see Occam’s Razor.

 

Classic symptom: Too many abstract layers in a software application

WET Write Every Time – the antithesis to DRY, where code is deliberately written that repeats lots and lots of time in different classes, packages, and functions. 

Symptoms: Deciding to do things your way and instead of collaborating with the other developers and finding some common ground.Classic antidote: DRY, Unit Tests and Code Refactoring.

WETTT Write Everything Ten Thousand Times – the hyperbole colloquial version of WET
R3 Rules of Three – This is not the proprietary operating system of the same name, or the classic 1980′s arcade game, or either the description of a maxed out pimp-my-ride Volkswagen Golf; but the idea that when ever you have three duplicated parts of code in a method, function or classes then it is time to refactor the duplication in to single method. See Rule of Three computer programming. 

Related to DRY and WET

 

Class Symptom: Ignoring the code repeats because of time pressures, or the Scrum master says no, don’t do it in this sprint.

DBC Design By Contract – the idea of building a service from a contract first. In Java you write the interface as simply as possible and then secondly worry about the implementation class.

 

Interfaces are easier to refactor around and because you can plug different implementations into the interface you get higher cohesion and lower coupling.

 

Classic Example: JDBC specification since version 1.0. There are tons of implementations for different relational databases including MySQL, Postgres, H2, Derby etc.  Every Java programmer knows how to code against JDBC because that they don’t have to fight with an different implementation, which vary, because the DBC implied it will do the right thing most of the time.

 

Also related to standardisation of application programming interfaces.

BDUF or BUDF Big Up-Front Design – a problem with many large corporate institutions that sometimes require a 100 – 1000 page document full of business requirement before any software construction gets the green lightSome poor architect or business analyst will have spent weeks investigating and chatting to the business about the requirement, only for the development team to say the document is practically worthless.

 

Antidote: Get the technical lead and some key developers talking with the business and the analysts and the customer. Ideation sessions everybody!Symptom: Waterfall methodology and aspects of the investment banking IT culture

 

Antidote: Unknown, lots of people how tried to bring “Agile” with both a big A and small A to many of these institutions with some success and failure

Pink Book Describes the book with a Pink Cover called Extreme Programming Installed by Ron Jeffries, Ann Andersen, and Chet Hendrickson. I do not recommend this for new starters unless for reference, since the Pink Book is now rather old, 2000, there are other more recent Agile development books and courses that help new Java developers.
YOLO You Only Load It Once [If Ever] – this is related to fact that you want to have a single source of truth in an application system. This is problem of mis-architecture, where someone has not thought the functional requirement through enough.

 

Classic Example: Shopping Cart Service EJB – you only ever want one implementation of the pay-point in an application, albeit you will have many pay-point providers (credit and debit card third parties and PayPal)

 

The If-Ever part is YOLO and YAGNI added together. You are not sure of the another part of the system loads the data, so you decide to keep the component. (You probably want to put a logging client on the YOLOIF thing so that you can effectively decide to chuck the component if nobody has used the function in 12 or 18 months time.)

 

Digression: If you have find data that is constantly being uploaded to serve a web request then perhaps it really needs caching and not YOLO.

Spike A quick exploration of coding in Sprint in SCRUM methodology, which is also time-boxed inside a single sprint, usually. In a Spike you are probably are looking an new API, like a cloud service or user interface API like JavaFX or similar and basically you explore if the function can implemented relatively well in the new API.In short, you are trying to build some confidence in a new area before committing yourself and other resources to it. Spikes are usually contained and protected from the flow of the critical path and restricted to a time length. See SMART goals. Once your team has gained confidence and knowledge in the new “thing” then reasonable estimates can be made.

 

Classic Examples: Adopting a build system – moving from Apache Ant to Maven; moving from Subversion to Git; Adopting a new open source library

TDD Test Driven Development – often conflicted as not being fully explained as a change of discipline and mind.”You are only ever doing one of these four things: writing unit tests, writing production code, refactoring unit tests, and refactoring production code; and never doing more than one at these previous at the same time.”
TFD Test First Development – builds on the ideas of TDD and then extends the discipline to writing unit test code before any production code.”Once you have a brand new unit test written completely, then you make sure that new unit test(s) actually fail in order to switch over to writing production code ensures the the new test passes.  After you have done that, you refactor the tests. Run all tests for all the green bars. Refactor the production code and runs the tests for all the green bar.Repeat: Go back to the start; write a new unit to that will check validate operation of the next function for the application. Repeat with the same formula as above.”

 

Velocity This is often misunderstood as a very basic measurement on the Return-on-Investment for SCRUM/XP software development and it has nothing at all to do with financial services, budgets and/or reporting. The creators of SCRUM/XP now disuade velocity as a ROI indicator at all.

 

Velocity is the number of story points completed per team per iteration. To the SCRUM/XP  experienced: Velocity is equal to the aggregated units of work completed over aggregated time intervals, which implies you measure each progress of tasks in two or more sprints.

Story Point For each user story in the sprint or task, predict  how hard it is to implement by using unit of reference. 

Story points are usually written in Fibonacci numbers: 0, 1, 1, 3, 5, 8, 13, 21, 34, 55, 89, 144Every agile team in the world has a definition of a user story unit point.Teams decide on the backlog items in order to come up with predictions and these joint predictions every member of team go to decide what should applied to the next sprint.

DTSTTCPW Do The Simplest Thing That Could Possibly Work – Related to Spike and KISS in many ways. If you are pressed for time and some trading systems developers in investment bank are then this is your working life. 

DTSTTCPW certainly invites team collaboration and effective sound-boarding from other developers and members of the team, otherwise you are asking for trouble.

VoC Voice of the Customer – This is a term from SCRUM methodology, but I am about 20% unsure about this one; I believe 80% of the time to mean a proxy, a placeholder, for the real customer, the person who understands the business requirement and will of the customer. Because the true user is unavailable for some reason due to authority, culture or organisation, or even geo-location. 

Some people have amusing called this abbreviation, the Voice of Reason, especially when they do not enjoy working with the customer directly.

Unit Test In Java programming, a Unit Test is a Java JUnit framework test class or TestNG framework test class that specifically verified and validates a single function of work in an application 

A unit test requires a target, which can be a Java Class, a Service Bean, Managed Bean or something implements the said functionality.

 

Unit test are often seen as low-level fast and efficient tests.

Functional Test A functional test is a larger test, which can also be a unit test, designed to test packages of classes or sub part of the overall application infrastructure. Functional test validates if the application meets one of the customer’s external requirements on performance, results and efficiency.

 

Symptom: a functional test is not necessarily a unit test, and not all functional tests are acceptance tests.

Acceptance Test An acceptance test is the same as a functional test in name only. Acceptance tests are those where the customer wants to see the validation pass in order they sign of the implementation. 

Symptom: If the customer is disastisfied with the application at demonstration time, then at least the one of the acceptance test is broken. Add one in the next sprint.

SOLID A set of five principles:Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation and Dependency Inversion.
Single Responsibility Principle An object class, a service bean, web service, a function or procedure should have only one single responsibilitySymptom: It is hard to write unit test for complex object, because it doing WETTT
Open Closed Principle Open for extension and closed for modificationIt means you can subclass the object, but the object is encapsulated by not allowing an outside object to gainfully change the internals. 

Symptom: leakage in object implementation, hard code dependency, and not working with Java interfaces (or interface like constructs i.e. Scala traits and mix-ins)

Liskov Substitution Principle Idea of swap-ability and is expressed as a Design By Contract (DBC).I can swap in another object X which is an implementation of T if that objects is a type of T and the overall application works.This is the basis of mocking objects, mocking implementation frameworks; testing in general; proxy remote objects, persistence capable objects; application server and lifecycle monitoring situations; plug-and-play and restartable applications. I could go on, but I won’t.
Interface Segregation Principle A service interface that does only single specific functional thing is better than a service interface that does several different things. 

Symptom: Failure to adhere to the KISS principle. In days gone, the non standard C++ String libraries where everybody threw in the kitchen sink of methods for any operation that one would want to write that manipulated a C/C++ String (char*)

Dependency Inversion Principle Idea of not hard-wiring a direct relationship to a dependent into object.In Java EE world, you would use a dependency injection container such as CDI to inject different managed beans into a service bean. 

Dependency inversion also should mean in my humble opinion given up on managing the life-cycle of service components and beans. The lifecycle is managed by the application container, the cloud provider or whatever it is you are using.

 

In another school of thought: every application is managed these days, whether it is the operating system, a virtual machine or web container or mobile platform (iOS and Android). This is the way forward.

Design Patterns A classic book on Design Patterns by Erich Gamma et Al. 

Ask your local technical leader to lend you his or her copy of the book; and if they don’t have a copy then that really sucks. Tell them to give you a personal training budget and buy the book yourself!

Glad to be of service to all my readers.

Merry Xmas and Happy New Year 2013!

+PP+

PS: I, once, had a notebook and file with a lot more of these terms with or without explanations. If I find anymore abbreviations and terms that I will add to this blog entry.

Where There is Still Hope

December 4th, 2012 Comments off

On Monday evening, 3rd December, 2012, I went along to the British Computer Society London in the Strand for a lecture from non other than Professor Sir Tony Hoare. It is not everyday you get meet a personality who has been so well deserved lauded in the computer science, in its history and its modernity and  brief time of existence. Tony Hoare was the inventor of the famous Quicksort computer algorithm in 1960 (at the age of 26). I remember a first encounter with the QuickSort algorithm in Herbert C. Schildt’s Programming in C book.

Professor Hoare was in town to give a Peter Landin lecture on Laws of Concurrent Design. The talk was essentially about mathematical calculus of computer programs; how they could be expressed in terms of mathematical functions, and set of basic axioms with rules, then could be composed together to proof notations about concurrency and sequential operations.

Professor Sir Tony Hoare at BCS London, December 2012

Oh gosh, it has been awful long time, since I personally looked at additional mathematics course book. Yet I understood this level of discourse in the talk. I found that I could understand the Exchange Axiom to my surprise. Although, I think Professor Hoare had simplified the actual formulas for the benefit of his talk and the level of the audience.

For the ordinary punter, dealing with this abstract mathematical terms is clearly out of the level of usefulness, however these are the theories that allows computer scientists to build programs such as compilers, static analysers and the tools that language writers use to build new programming languages in order to give us the world of devices and applications that we all use today. Without these pioneers in the computer programming arena, we would be, I think, far far behind. Indeed, we are standing, everyday, on the shoulders of giants and reaching for the stars.

I thoroughly enjoyed the Professor Hoare talk, and the fact that this guy is older than me and still working (at Microsoft Research in Cambridge, England) is inspiration enough to say to hell with silo management and bad attempts to be hip with the agile practices. Say hello to diversity in corporation, the future is for real. Here is a real star: a living legend.

+PP+

PS: I also got meet up with some fellow ACCU members who also turned up for the lecture.