Friday, 29 August 2014

Building Real Software: Don’t waste time on Code Reviews

Article on Code Reviews that explains how to get the most out of code reviews, without waisting time.

Building Real Software: Don’t waste time on Code Reviews: Less than half of development teams do code reviews and the other half are probably not getting as much out of code reviews as they should...

Friday, 15 August 2014

Java Enum values() method

I remember there being a values() method that provides all possible values of an Enumerated Type in Java. I checked the javadoc1 and couldn't find it...

But it exists.

Which is weird.

Luckily, someone else had the same problem and asked it in [2].

I was intriged so I looked up the Language Spec3. Yes, the method is available in each and every Enum class, but it is 'especially' inserted by the compiler and not inherited from the superclass4.

Luckily in the javadoc1, values() and valueOf(String) methods are both mentioned in the description of the valueOf(Class<T> , String) method (nowadays).

References

[1] Javadoc - Enum
http://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html
[2] CodeRanch - Values method documented Enum
http://www.coderanch.com/t/559674/java/java/values-method-documented-Enum
[3] Oracle - The Java Language Specification (Java 8)
http://docs.oracle.com/javase/specs/jls/se8/jls8.pdf
[4] Oracle Java Tutorials - Enum Types
http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

Friday, 8 August 2014

Mysql JDBC Issue

Hammered myself into a wall here. Turns out when I create my Java Entities from a Database Table (using NetBeans Wizards), I get the following:

@Entity
@Table(name = "mm_log", catalog = "mmud", schema = "")
@NamedQueries(
{
    @NamedQuery(name = "Log.findAll", query = "SELECT l FROM Log l"),
    @NamedQuery(name = "Log.findByName", query = "SELECT l FROM Log l WHERE l.name = :name"),
    @NamedQuery(name = "Log.findByMessage", query = "SELECT l FROM Log l WHERE l.message = :message")
})
public class Log implements Serializable

Notice the catalog and the schema in the annotation for Table?

Now, it turns out1 that "schema" is unsupported in MySQL, and "catalog", apparently, is just a fancy way in MySQL of saying "database".

So, if I create a brand new database (call it "newmmud"), create a nice JDBC Connection Pool to it in my Glassfish server, yet this blasted Entity (Log, in the example) will still refer to the database "mmud"!

That's what I call confusing!

Here's the message, for posterity's sake:
“You're correct. For legacy reasons (including compatibility with ODBC, and SQL Server), JDBC's concept of "catalog" maps to MySQL's concept of "databases".

Starting in MySQL-4.1, "schema" is an alias for "database", but it doesn't act like a SQL-standard schema, so we don't support the concept in the JDBC driver.”
- Mark Matthews

References

[1] Forum - Re: catalog versus schema
http://forums.mysql.com/read.php?39,137564,137629#msg-137629

Saturday, 2 August 2014

Scrum

I managed to take a Scrum Foundation course (a one-day course to introduce me to Scrum) on Thursday, July 31st 2014 at Xebia1.
The trainer in question was Martien van Steenbergen2.

Introduction

So basically Scrum is one of many implementations of the Agile Software Development Process.

I'm going to write some things that I picked up on and I found to be important:

If you look at a graph of the adoption of different technological innovations in the US over the last 100 years (television, radio, internet, etc), there are a couple of things worth noting:
  • every innovation follows the well-known S-curve, a few early adopters, followed by the herd of followers, followed by saturation of the market. This is remarkably the same for both old innovations of long ago, and new innovations of today
  • the S-curves are becoming more steep, network effect increases quickly, the market becomes saturated much more quickly, i.e. new things get adopted much more quickly and easily
  • there are more S-curves in a given period now then there were in a similar period in the past, i.e. the rate of new innovations is increasing
Hence one of the reasons why everyone is looking for new ways to manage, and much better yet, facilitate, change. Scrum seems to be one of the possible answers.
The portmanteau chaordic refers to a system of organization that blends characteristics of chaos and order.

Some characteristics of Scrum

  • 10% is bureaucracy, so in a two week sprint, your meetings/standups/etc add up to about a workday.
  • we complete what we start
  • a stable team is very important
  • manage work and processes, but lead people.
  • a scrum team consists of 6 people on average, give or take one.
  • trying to estimate things correctly right at the beginning, is impossible
  • keep the process (scrum) lightweight
  • keep it flexible, which means, don't plan too much ahead, things will change
  • keep your focus, which means, if you do plan, plan for short periods of time, for example a sprint, and keep your focus during that period. Become flexible once more when the period comes to a close. In effect you are trying to be both flexible and efficient at the same time.
  • take responsibility for tasks, instead of getting tasks assigned to you
  • feedback is very important, without feedback you do not know if things are working correctly or if things need to be adjusted
  • we should talk about work during standups, and think less in terms of "what did I do, what am I going to do".
  • history is important, without history we cannot make predictions on the future
  • based on history you can make predictions if only one of the following are fixed: deadline or scope. See the Iron Triangle4

Glossary

sprint3
a time-box in which we commit to doing a list of things
velocity
what tasks can we complete during a sprint
delta
a change to a current situation, basically everything is a delta
product backlog
a list of all things that need doing
product owner
owner, responsible, employer, takes on risk, competence, available
scrum master
monitors the performance of the sprint(s), velocity
development team
performs work

Quotes

“If you chase two rabbits, you will catch neither.”
- Russion proverb, on context/task switching
“If the rate of change on the outside exceeds the rate of change on the inside, the end is near.”
- Jack Welch, former CEO of General Electric (on adaptability)
“Big Projects usually fail, regardless of process. The secret to project success is to strongly recommend and enforce limits on size and complexity. These two factors trump all other factors.”
- Henrik Kniberg (on limits)
“It doesn't matter who does it, as long as it gets done.”
- ? (on team effort)
“Where there is no standard, there can be no Kaizen.”
- ? (on continuous improvement)

References

[1] Xebia - Summer Special Scrum Foundation Training
http://training.xebia.com/summer-specials/summer-special-scrum-foundation
[2] Pearl Language
http://pearllanguage.org/Home
[3] Scrum.org - Scrum Guide
https://www.scrum.org/Scrum-Guide
[4] Wikipedia - The Iron Triangle
http://en.wikipedia.org/wiki/Project_management_triangle
Scrumalliance.org
http://www.scrumalliance.org/
Scrum.org
https://www.scrum.org
Wikipedia - Agile software development
http://en.wikipedia.org/wiki/Agile_software_development
Alan Klement - Replacing User Story with Job Story
http://alanklement.blogspot.nl/2013/09/replacing-user-story-with-job-story.html
eduScrum - Dutch website on using Scrum in the classroom
http://eduscrum.nl/
The getKanban Board Game
http://www.getkanban.com/
The New New Product Development Game
by Hirotaka Takeuchi and Ikujiro Nonaka