Tuesday, April 01, 2008

First Glimmer Game

Nick Malnick and I programmed the first game to utilize the Glimmer engine. We did so by writing tests first and following the model-view-presenter pattern with data-binding.

It is a simple 2-player Tic Tac Toe game that I demonstrated during my talk at EclipseCon 2008:

I finally committed the completed version to SVN. For those interested in looking at the code, feel free to do so by clicking on these links:Notice how easy it is to create a 3x3 grid in Ruby by relying on (1..3).each iterator statements and blocks. Also, notice how simple it is to data-bind and add listeners using the Glimmer bind keyword and on_[action] syntax.

Of course, a big part of the reason why I like Glimmer for building desktop applications is to have the ability to write very concise domain model code in Ruby. Check out the TicTacToeBoard and TicTacToeBox classes for examples of very readable and easy-to-maintain domain model code, especially in comparison to the often bloated setter/getter infested Java domain models.


Anonymous said...

When this program is famous, and you are rich and powerful, I will be able to say I was there when this was first written.

Is it requirement for Glimmer projects to be written at the bar while drinking beers?


Andy Maleh said...

It's not a requirement, but it just goes to show that Glimmer programs are THAT easy to write ;)