1. Mayflower Barcamp

Letztes Wochenende fand das erste Barcamp von Mayflower statt. Alle Mitarbeiter aus allen Standorten von Mayflower und SektionEins trafen sich in einem idyllischen Bauernhof im Altmühltal. Die Zielsetzung wich von einem traditionellen Barcamp etwas ab: Teams fanden sich zusammen, um an einem selbstgewählten Thema zu coden. Einzige Bedingung: Open Source oder Mayflower-Kontext! Weiterlesen

Dojo 1.0 released

Gestern wurde endlich die
Version 1.0 von Dojo released (http://dojotoolkit.org). Im Vergleich zu Dojo
0.43 hat sich in Version 1.0 einiges getan, die wichtigste Änderung: es werden
nun die Funktionalitäten sauber getrennt in drei kleinere "Projekte".
Persönlich freue ich mich, dass in Sachen Performance sich einiges getan hat und
die Engine massiv beschleunigt wurde. Bereits in PHProjekt 5 haben wir Dojo für
einige Teile eingesetzt, für die Version PHProjekt 6 nutzen wir nun neben einigen
Widgets auch die Möglichkeiten des Event- Handlings und der DOM- Manipulation
von Dojo, sowie natürlich die Ajax- Funktionalität. In PHProjekt 6 wird eine
MVC- Architektur auch auf Seiten des Clients umgesetzt. Unabdingbar für die
Entwicklung des Client- MVC ist für mich ebenfalls die Tatsache, dass Dojo ein "normales" objektorientiertes
Interface für JavaScript zur Verfügung stellt, das Klassen und Vererbung
anbietet. Um es in den Worten von Kollege Hartmann auszudrücken: „Dojo
ermöglicht dadurch ernsthafte Programmierung mit JavaScript!“

Leider ist auch mit dieser Version das Problem der Dokumentation nicht endgütig verbessert worden, es
bleibt einem nicht erspart, sich durch das „Dojo- Book“ auf den Webseiten zu kämpfen. Hoffentlich gibt sich das im laufe der Zeit, denn das ist immer noch
ein großes Manko.

Dojo goes offline

With the advent of Web2.0 and more and more AJAXian applications popping up, there has been a tremendous trend to move from classical desktop applications to web based applications. While you can use an approach of offloading the whole application to the desktop (i.e. with Microweb and the like), more and more JavaScript toolkit libraries offer „offline“ functionality. That means there will be functionality for offloading the data to the client and care for the synchronisation to the server later on.

 

These features are especially useful for application usage where you don’t always have Internet connection, but need to synchronize the data later to the server. Dojo, a very powerful JavaScript toolkit, now gives you handy offline features. According to the website:

Dojo Offline is a free, open source toolkit that makes it easy for web applications to work offline. It consists of two pieces: a JavaScript library bundled with your web page and a small (~300K) cross-platform, cross-browser download that helps to cache your web application’s user-interface for use offline.

Dojo offline with its small cross-platform, cross-browser download is licensed as BSD, so it’s very easy to integrate it into your applications. There’s also a video that shows you the usage of the offline tool. Dojo offline is currently marked as Beta. Overall, great work, guys!

Performant DOJO

When your rich internet applications become more complex and mature, you learn that there are some rules to obey to achieve a sucessful dojo project. What does successful mean ?

  • easy extendible
  • good client performance
  • easy maintainable, readable code
  • economical memory usage

Our rules ;)

1. Build dojo from SVN
Its seems to be disturbing to your own work that the dojo team has comitted a fix last night that breaks a api. But, these fixes don’t come from nothing, means the chance is there that you had a warning like "xy is deprecated and will be replaced by zz" when you read the console output. You read the console messages, don’t you?
All in all its much faster on the major dojo release dates to have it all there, instead of fixing it all on one day. It is much likely that this will cost You a remarkable amount of time.

2. Use dojos compression
The compression & buildsystem is a important thing that will help you to reduce the time the whole dojo system requires to load and initially execute. A important factor if you are not using a one page Ajax application model or limited ressources.

3. good XHTML matters
Dojo parses a lot of information to get all that markup transformed into CSS styled widgets that have all that magic functionality inside. So far it is important to produce correct markup, without ANY style attributes (use class and css by id), tables only where they are required and the minimum set of (X)HTML nodes.
Examples that use only 60 Nodes (XHTML) with div/span based layout perform better than the same code with table based HTML 4.01, style attribute using markup and 185 Nodes. Simply because you tell the same story with less characters.

4. (X)HTML event attributes -> NO NO NO
XHTML Attributes do not need to be noted down in the markup, they can be added programmatically. In any HTML / JS contect you can choose to add them by js code, may it be dojos event connect or the pure javascript methods that add event functionality to the dom.
Its much more likely to find all the connected and used events when you are doing that by code in ONE place and not ditributed over the whole project.

5. Dont use javascript global scope in your project

When you develop the application code using dojo and maybe a bit of DOM, avoid using variables outside your function scope. Why ?

  • The variables outside the function scope are slower to access
  • references to dom nodes are much likely not to get garbage collected and you will need more RAM to execute your application code over time.

You can use objects to create your application code and informations like the actual used browser (i know its implemented in dojo .. just say for fast accesses sake)  can be stored in a objects member variable instead of beeing globalized around. If you are generating these objects using prototype of objects you will save some more memory on you application.

So far, these are the basics i have learned to make my life in the dojo easy and effective.
Besides you are much likely to be at home in time at the evening and able to meet timelines because refactoring and changes to dojo are not that big things and cost not too much time. Hope that helps in any way.

Virtual Data Grid: becoming reality soon

TurboAjaxIf you use Dojo, have a look at the fabulous widgets called TurboWidgets from TurboAjax.com: it’s available for non-commercial and commercial usage. One of the great widgets (besides Theme support where you can also create your own corporate theme look and feel) is a data grid which can be customized in a wide variety.

As I’ve discovered in the TurboWidget forums, they’re working on a virtual data grid. Imagine you want to display a list of 100,000 or more items which can be a major pita especially when working with slow internet connectivity. The solution is a real virtual data grid. They showcase a demo here. Release date will be hopefully by end of July, and I’m looking forward to it. :-)

As you can see in the screenshots, while scrolling down the grid will be empty or displaying „…“ ….

… while loading the data. After finished loading, it shows the normal grid data:

Unfortunately, we have to wait until end of July, but I hope the guys from TurboAjax will have it ready soon. :-) Combined with a XMLHttpRequest based PHP backend (which will be triggered by the Grid’s data model) this will be a very userfriendly solution for displaying large data sets.

Creating desktop-like applications on the web

We recently were asked to make an offer to create a web based solution for a desktop software. Visually we only had some screenshots of the original desktop application. To make it easier for the customer to decide how a possible solution could look as a web application, we tried to create a prototype looking kind of similar to what his product looks like until now. Calls for Web2.0, don’t you think?

Here at Mayflower we have a lot of experience mainly with Prototype (and also with the mighty, prototype-based Scriptaculous) and Dojo. Although the documention of prototype seems more complete and easier accessible, Dojo is more mightful, and, yes, it’s an API ;-)

Dojo calls itself „the Open Source Javascript toolkit that makes professional web development better, easier, and faster.“ It’s licensed under the AFL and the BSD as well and is supported by the Dojo Foundation which list some of the big names in the industry as their sponsors and partners. Recently Sun joined the list of companies supporting the Dojo Foundation.

Dojo does not only contain widgets for flashy Web2.0 applications, but lots of different things to write real JavaScript applications (hm, isn’t that an antagonism ;-), with support for crytographic routines (dojo.crypto), linear algebra and other mathematical support (dojo.math). It also brings some new data structures out of the box (dictionary, FIFO, FILO).

To get a visual impression of what Dojo’s widgets are capable of so far, you should check out the „see it in action“
section on the Dojo website.

So we decided to create the prototype not using prototype but using Dojo (using the meanwhile deprecated 0.2.2 version) – sounds odd, he?

Weiterlesen