Home > devoxx > JavaPolis 2007 – Day five

JavaPolis 2007 – Day five

Last day of JavaPolis today and it finishes at two o’clock. For my first presentation today I attended Java for high performance 3D and 2D graphical applications by Frank Suykens.

He first showed us a few demo 2D and 3D applications written in Java which were quite fast and responsive. Some tips to write applications with great performance are

  • Do benchmarking and profiling in order to measure performance.
  • Use good algorithms (BSP-Tree, R-Tree).
  • Always use caching.
  • Always use latest JRE is possible.

He then showed us a nice air traffic demo from Luciad with 3D rendering and some really nice and smart features. They used heavyweight OpenGL in order to do all these and then Frank went through several tips of how to achieve high performance in critical applications using Swing.

  • Use GLCanvas
  • Use GLJPanel
  • Make sure all components are heavyweight. For example for a popup menu use setDefaultLightweightPopupEnabled(false) to indicate that the component is heavyweight it will be hidden behind other components.
  • Use Vertex Buffer Objects (VBO) when drawing triangles.
  • Reuse Swing components.
  • Use incremental gc if the time really matters.
  • Use tools such as JConsole, JProfiler, VisualGC in order to profile the memory.
  • Us -XX:+PrintGCDetails.

A nice tip at the end of the presentation is that Luciad is hiring, so if you are interested in 2D and 3D programming with Java drop them an e-mail.

Next talk was about Real Options in a Nutshell by Olav Maasen and Chris Matts. This session was mainly about changing peoples minds and behaviour when there is really the need to do so. Decisions have to be based on logic and facts rather than emotions.

It’s all about options and the three things we should have in mind are

  • Options have value
  • Options expire
  • Never commit early unless you know why.

Another good point is that people don’t like uncertainty. They always want to hear specific dates. For example it’s always better if you postpone a project deadline to let the manager know the exact date of the next release than say “in a few days”. Make a decision then rather than don’t make a decision now because nobody likes uncertainty.

Always take time to evaluate a product, don’t rush things even if the managers push for the quickest way to market.

Always create options, then when you have to decide you have several options.

Good design upfront helps you identify good options in the future.

And always prepare to run fast when you make decisions, but make sure that you have rest before.

Last session I attended was TDD beyond the acronyms by Lasse Koskela. Lasse Koskela spoke about test driven development and design and how this can help us build better code faster. The principles of TDD are three easy steps

  • Write a test and see it failing.
  • Make the test to pass.
  • Refactor it and improve the design in the safety of the test.

A question arises when we do TDD. What should we test? The answer is rather simple; think about the design and what kind of behaviour is missing from the application. In the beginning we want to test the application as soon as possible and therefore we need to make the test pass asap. We don’t really care about what the code looks like in this stage as long as it works (even hard coded values are fine). Then as soon as the test passes we can refactor it and improve the design. We should restructure the code without changing its behaviour.

There are three ways to use test-doubles (terminology below according to Martin Fowler)

  • Stubs – they only implement a subset of methods of the real objects and they return hard-coded values.
  • Fakes – they replace a real db with a db in memory.
  • Mocks – Some sort of self verifying object.
Advertisements
Categories: devoxx
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: