P. 1
Simplifying Desktop Development With Glimmer

Simplifying Desktop Development With Glimmer

Views: 114|Likes:
Published by Best Tech Videos
Ruby has gained a lot of popularity in the last few years, especially in web development, due to the infamous Ruby on Rails framework. However, it has not gathered the same momentum in building desktop applications despite the fact that a number of desktop application frameworks exist out there.

There is still a need for a Ruby desktop development framework that satisfies all of these goals sufficiently and reliably:

* Platform-independence
* Native widget support
* Industry-strength and reliability
* Strong community support
* Ease of use

Enter Glimmer; a new Eclipse open-source project that leverages the Ruby language and Eclipse SWT library to enable easy and efficient authoring of platform-independent desktop user-interfaces. It comes with a UI authoring DSL and built-in data-binding support to greatly facilitate writing maintainable and testable desktop application code.

In this presentation, I will introduce Glimmer, provide a quick tutorial for its syntax and paradigms, demonstrate some applications, and explain how to test-drive a Glimmer application by following the Model-View-Presenter pattern.

Watch a video at http://www.bestechvideos.com/2008/12/08/rubyconf-2008-desktop-development-with-glimmer
Ruby has gained a lot of popularity in the last few years, especially in web development, due to the infamous Ruby on Rails framework. However, it has not gathered the same momentum in building desktop applications despite the fact that a number of desktop application frameworks exist out there.

There is still a need for a Ruby desktop development framework that satisfies all of these goals sufficiently and reliably:

* Platform-independence
* Native widget support
* Industry-strength and reliability
* Strong community support
* Ease of use

Enter Glimmer; a new Eclipse open-source project that leverages the Ruby language and Eclipse SWT library to enable easy and efficient authoring of platform-independent desktop user-interfaces. It comes with a UI authoring DSL and built-in data-binding support to greatly facilitate writing maintainable and testable desktop application code.

In this presentation, I will introduce Glimmer, provide a quick tutorial for its syntax and paradigms, demonstrate some applications, and explain how to test-drive a Glimmer application by following the Model-View-Presenter pattern.

Watch a video at http://www.bestechvideos.com/2008/12/08/rubyconf-2008-desktop-development-with-glimmer

More info:

Published by: Best Tech Videos on Mar 17, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/10/2015

pdf

text

original

Simplifying Desktop Development with Glimmer

Andy Maleh Journeyman Craftsman Obtiva Corp.

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Preview
      

Introduction Overview of Widgets Hello World Glimmer Listens Data-binding Test-driving with MVP First Glimmer Game

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Introduction

Requirements for a Ruby UI Toolkit:
   

Platform independence Native widget support Industry strength Ease of use

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Introduction

Current Ruby UI Toolkits:
       

TK FXRuby GTK wxWidgets Monkeybars Shoes Limelight ...

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Introduction

Introducing Glimmer:
    

Leverages SWT library used in Aptana RadRails IDE Works on Windows, Mac, and Linux Offers built in native widget support Provides an ultra-light UI authoring DSL Facilitates clean separation of logic and UI code via Data-Binding

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Overview of Widgets

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Overview of Widgets

Shell

    

Composite

Group TabFolder Combo List Control
   

Text Label Spinner Button

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Hello World

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Hello World

SWT example in Java:
Display display = Display.getDefault(); Shell shell = new Shell(display); shell.setText("SWT"); shell.setLayout(new FillLayout()); Label label = new Label(composite, SWT.NONE); label.setText("Hello World!"); shell.pack(); shell.open(); while (!display.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose();

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Hello World

API Goals
   

Concise and DRY Asks for minimum info needed to accomplish task Convention over configuration As predictable as possible for existing SWT developers

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Hello World

Glimmer example in JRuby:
shell { text "SWT" label { text "Hello World!" } }

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Glimmer Listens

Listeners allow user interaction with widgets
text { on_modify_text { contact_model.validate } on_focus_lost { contact_model.save } } button { text "Delete" on_widget_selected { contact_model.delete } }

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Glimmer Listens

(http://glimmer.rubyforge.org/svn/samples/login.rb/)

Demo

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Data Binding

 

Enables syncing of UI state with model state bidirectionally Facilitates clean separation between application logic and UI code Requires much less code than listeners Relies on modified version of MVC pattern

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Data Binding

(http://glimmer.rubyforge.org/svn/samples/contact_manager/)

Demo

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Test-driving with MVP

A presenter is a special kind of model that handles presentation logic

Examples:
  

Abstracts the UI
 

Enablement/disablement of fields based on certain events Action logic triggered by clicking a button Aggregation/formatting of data to display

Properties represent different fields on the UI Methods represent different action widgets (e.g. buttons) on the UI

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Test-driving with MVP

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Test-driving with MVP
 

Write UI code using Glimmer (without databinding and event listeners) Test-drive presenter that abstracts UI  Every UI field is represented by a property on the presenter  Every UI button is represented by a method on the presenter Update UI code to data-bind fields to properties on the presenter and hook event listeners to methods on the presenter

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

First Glimmer Game

(http://glimmer.rubyforge.org/svn/samples/tictactoe/)

Demo

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Review
      

Introduction Overview of Widgets Hello World Glimmer Listens Data-binding Test-driving with MVP First Glimmer Game

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Q&A

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

More Information
Glimmer Eclipse Technology Project: http://www.eclipse.org/proposals/glimmer/ Glimmer Newsgroup: http://www.eclipse.org/newsportal/thread.php?group=eclipse.technology.glimmer Original Glimmer Project Page at RubyForge (moving to Eclipse now): http://rubyforge.org/projects/glimmer/ Glimmer InfoQ Interview: http://www.infoq.com/news/2008/02/glimmer-jruby-swt Glimmer EclipseZone Introductory Tutorial: http://eclipse.dzone.com/articles/an-introduction-glimmer Sneak Peak at Glimmer: http://andymaleh.blogspot.com/2007/11/sneak-peak-at-glimmer.html

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

Contact Info

andy@obtiva.com andymaleh.blogspot.com

Andy Maleh

Obtiva Corp.
obtiva.com

Simplifying Desktop Development with Glimmer ®2008 by Annas Maleh; made available under the EPL v1.0

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->