Archive for February, 2011

Who the heck is Corey Haines?

Tags: ,

As you may have noticed (new blue square in the header) I started using Twitter recently. Just to try and see how it could improve the quality of information I receive and information I finally find useful and worth reading.  I checked who my friends are following and Paul Szulc told me to check his following list so I started watching some people he suggested. Some names were familiar, some were not but I decided not to judge too early, just read what they say and analyse.

Amongst those people were one man, Corey Haines, tweeting really often. I had no idea who he was and I haven’t even check what Google would return. I know, shame on me, but last week was the end of scrum sprint and we were on tight schedule so I didn’t have a lot of free time.

But why am I writing about him? Lately I was talking with Paul Szulc again and we were discussing about what IT books are worth reading, he told me about “Growing Object-Oriented Software, Guided by Tests” by Steve Freeman (by the way, Steve is going to speak at 33rdDegree in April here in Poland, so another smart person will try to to widen my horizons there). Paul sent me a link to presentation from QCon 2010 to watch before starting any new book. Presentation is titled “Software Craftsmanship – Beyond The Hype” and today I decided to watch it despite my wife asking me to watch next episode of CSI series with her :) So I spent an hour on this video and who did I see there? Corey Haines :) Apparently he is not only tweeting a lot but also he is a speaker at many conferences too. And what could I say about his presentation? Really, really good. As craftsmanship became a slogan he points some useful things to do to improve your skills, learn and reach higher level. And what I liked the most is a sentence which I understand as:

Software Craftsmanship is not (only) about developing quality software but about Developing Quality Software Developers

and I liked it so much that I decided to share it with you :) So if you have one free hour , please consider watching Corney Haines talk “Software Craftsmanship – Beyond The Hype”.


Be Sociable, Share!

Wicket tutorial, part 5 – generic unique entity validator

Tags: , , ,

As I promised in the previous post, today we will focus on transforming our unique name validator in Wicket to generic one. So now, let’s simply list what we are going to achieve;

  • validator should validate any entity object in our project
  • validator should check unique value of any property from validated object
  • error message should be generic too but customization should be easy

Continue reading this post …


Be Sociable, Share!

Wicket Tutorial, part 4 – custom validator for unique entity name

Tags: , , ,

Welcome back to our Wicket tutorial series! :) As I mentioned in previous post, today we will concentrate on building validator stopping user from adding item location with non-unique name. At first we will start with non-generic but working validator and then we will try to make is as flexible as possible. Ok, so let’s write some code!

Problem

As you might remember, currently we have Wicket form with basic validation checking existence of name field and whether its length is in proper range or not:

		Form<AddLocationPage> addLocationForm = new Form<AddLocationPage>("addLocationForm",
				new CompoundPropertyModel<AddLocationPage>(this));
		add(addLocationForm);

		Label nameLabel = new Label("nameLabel", "Location name");
		addLocationForm.add(nameLabel);

		RequiredTextField<String> nameField = new RequiredTextField<String>("name");
		nameField.add(LengthBetweenValidator.lengthBetween(MIN_LOCATION_NAME_LENGTH, MAX_LOCATION_NAME_LENGTH));
		addLocationForm.add(nameField);

		Button submitButton = new Button("submitButton") {
			@Override
			public void onSubmit() {
				Location location = new Location(name);
				locationService.save(location);

				getSession().info("Location added successfully");
				setResponsePage(LocationsPage.class);
			}
		};
		addLocationForm.add(submitButton);

Continue reading this post …


Be Sociable, Share!

Crowded conferences 2011 calendar in Poland and Wicket author talk at 33rdDegree

Tags: , , ,

This year seems to be really great for those Java Developers here in Poland who want to learn and listen about new technologies, methodologies, etc. at conference meetings. When I examined conferences calendar I found it very packed with many interesting events. And only one thing is troublesome where you are, like me, freelancing: you have to take a day or two off (so you don’t work and earn money) and moreover, you have to pay for conference with your own cash :) Such situation forces me to analyse and think carefully about which conference to attend and which I should skip.

In the first half of this year there are three big conferences to choose from: 4Developers 2011 in Warsaw,  33rdDegree and GeeCON 2011 both in Cracow. 4Developers isn’t aimed only too Java people so I decided to skip it this year. GeeCON looks very promising but when I recently got information that one of the Wicket authors: Martijn Dashorst will be speaking at 33rdDegree I know that this will be my choice! :)

So if you want to:

  • hear about Wicket, about what are the new features in hot new 1.5 version from person as close as is it possible to Wicket developers team
  • attend Android/Scala/Git workshops for free
  • meet one of the most well-known Polish speakers: Jacek Laskowski (when I think “Java Polish blogger” he’s the one to come first to my mind), Sławomir Sobótka (craftsmanship is probably his unrevealed and top secret second name), Szczepan Faber (bartender at Mockito), Paweł Lipiński (great TDD presentation show-man)
  • hear and even talk with Ted Neward, Linda Rising, Sang Shin (who don’t know these names, shame on you! :) )
  • see when Martijn Dashorst (Wicket talk) /Nicolas Leroux (Play talk) / Dierk König (Grails talk) attacks and argue with Matt Raible after his talk Comparing JVM Web Frameworks when Matt will declare that none of Wicket/Play/Grails are best of best web framework? ;)

If you want to be a part of some of these things above, let’s meet at 33rdDegree conference. Coming soon in April 2011 :)


Be Sociable, Share!

Wicket Tutorial, part 3 – first form in our application

Tags: , , , , ,

Hello Visitor :) In previous posts we created base project and added common layout to ItemDirectory Wicket application. Today we are going to add first form to allow users to insert some data into our application.

As main feature of ItemDirectory is to manage information where items (books, movies, music, postage stamps) are stored in our home/work, the first data we need to know are locations where we actually can store those things. So we start with adding table, entity and form to manage locations of our precious items.

Database, entity and DAO

First thing we need is locations table in database and entity mapping class:

- sql create table script listing:

create table locations (
	id bigint(20) not null auto_increment,
	name varchar(255) not null,
        PRIMARY KEY (id),
	UNIQUE KEY unique_name (name)
);

- entity class listing:

@javax.persistence.Entity
@Table(name = "locations")
public class Location extends AbstractEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
   @Column(length=255, nullable=false)
    private String name;
        protected Location() {
		super();
	}
	public Location(String name) {
		super();
		this.name = name;
	}
	// getters, setters omitted
}

As you can see, Location class is very simple: only one field, but the only thing we want at the moment from this entity is a name describing where item is stored. Is it “Bookcase in living room, second drawer from the top” or “Cabinet in the saloon, top bookshelf”.

Continue reading this post …


Be Sociable, Share!