Berichten met label News Item

Kennissessie Services op 24 oktober: de videos

Op 24 oktober 2011 vond een kennissessie plaats over services in gedistribueerde en/of embedded omgevingen. Deze sessie was georganiseerd door Luminis in samenwerking met Thales en leden van de Apache community, en ging in op de vraag hoe het toepassen van services kan helpen bij het verbeteren van de flexibiliteit van bestaande systemen.

De video presentaties van deze sessie zijn nu beschikbaar.

Innovatie, Services en Open Source
Rene van Hees, Technical Authority Software bij Thales

OSGi en Dynamische Services
Marcel Offermans, lid van de Apache Software Foundation

Apache Celix en Apache Foundation
Alexander Broekhuis, Software Engineer Luminis, committer Apache Celix

, , , , , ,

Nog geen reacties

CHARTER Surveillance Use Case – Industrial Evaluation

Screen shot 2011-10-10 at 4.18.26 PMThis month, Luminis has started development of a surveillance use case. The purpose of the case is industrial assessment and validation of tools and technologies developed in the “Critical and High Assurance Requirements Transformed through Engineering Rigor” project (CHARTER).  The ultimate goal of CHARTER is to ease, accelerate, and cost-reduce the certification of embedded systems. The CHARTER tool-suite employs real-time Java, Model Driven Development (MDD), rule-based compilation and formal verification. The coming series of articles will describe evaluation experiences in the surveillance use case.

The CHARTER project includes user partners from four key industries: aerospace, automotive, surveillance and medical, each of which develops embedded systems that require high assurance or formal certification in order to meet business or governmental requirements. The four user partners will each validate the CHARTER tools and methodology using industrial applications and actual development scenarios, which will provide feedback for the project and ensure the tools and technologies perform as expected, and deliver the expected improvements in embedded systems development. As part of the evaluation process, metrics will be used to quantify industrial experiences in terms of development effort, cost savings, verification time, etc., to document for others the benefits achieved.

The CHARTER project was established to improve the software development process for developing critical embedded systems. Critical embedded software systems assist, accelerate, and control various aspects of society and are common in cars, aircraft, medical instruments and major industrial and utility plants. These systems are critical to human life and need to be held to the highest standards of performance through formal certification procedures. Improving the quality and robustness of these systems is paramount to their widespread adoption.

, , , , , , , , , ,

Nog geen reacties

GraniteDS and AIR for mobile

In this article I will briefly show how to resolve some obstacles I came across when I developed my first application with AIR for mobile and GraniteDS. The most noteworthy reason of using AIR to create mobile applications is of course the multi-platform deployment using a single codebase. Furthermore, with Granite you are able to disclose the services of an existing Java backend to a mobile platform without significant changes to the backend. This offers great potential for enterprises who are struggling with the fragmented mobile market and don’t want to completely rewrite their existing Java backend.

I will assume you have some familiarity with AIR for mobile and Granite. It’s mostly the same as for Flex but there are some things you have to take into account.

1. Get the right version of Granite

The latest version of Granite is 2.2.1 GA. However, in the most recent version of AIR and Flex Adobe made some changes in the API which breaks backwards compatibility for some features of Granite. Therefore this release of Granite won’t work using the newest SDK. Refer to this post on the Granite form for more info on how to make these changes yourself. If you don’t want be bothered with building Granite yourself just download this version of GraniteDS to get started immediately.

2. Connecting to the right server

A problem for AIR applications in general (both desktop and mobile) is setting the right server settings. It is quite simple when running within the browser: The server address is changed with a single reconfiguration of the swf-file and all clients are using the new address on a browser refresh. With AIR it is a bit different and you’re not always at liberty to ‘hardcode’ the service settings in the AIR distribution package.
Granite offers a method for dynamic server configuration using the server initializer component:

Tide.getInstance().addComponentWithFactory(
  "serviceInitializer",
  DefaultServiceInitializer, {
    contextRoot: '/my-app',
    serverName: “10.0.0.1”,
    serverPort: “8080});

Note that once a connection is made, it is not possible to reconnect with another configuration, because the service initializer is only used once. You have to restart the application to enable the new connection settings or reset Tide’s RemoteObject. Unfortunately Tide’s API doesn’t support this reset. I came up with a small workaround which requires you to extend the EJB class with an extra reset method with the following body:

public class Ejb extends org.granite.tide.ejb.Ejb {
  /**
   * Reset the Tide Connection to allow new server settings
   */
  public function resetConnection():void {
    if (_ro) {
      _ro.disconnect();
    }
    _ro = null;
  }
 
}

This method resets Tide’s RemoteObject so the next remote call will force a reinitialization using the current settings of serviceInitializer. Refer to Granite’s issue tracker or forum thread for more details.

3. Automatic logout

Applications running on mobile platforms are always susceptible to unpredictable interruptions. For example when a phone call or text is received. Mobile AIR applications provide a deactivate event which is dispatched when the application is halted somehow. The application I wrote was using Tide’s Identity class for user login. Therefore I added an event handler to automatically logout the user and push the LoginView on top of the navigator stack:

private function deactivateHandler(event:Event):void {
  if (identity.loggedIn) {
    identity.logout();
  }
  navigator.popAll(); // Purge the navigator history to disable back button usage
  navigator.pushView(LoginView);
}

4. Build, build, build!

This isn’t directly related to Granite or AIR for mobile. But since they can both be used for enterprise scale applications I thought I’d mention it shortly: Make sure you have a proper build script. Now, I’ve got an example from Chris Black which provides a good starting point. I’ve only added the metadata compiler options required for Tide and of course a reference to the Granite libraries and generated Actionscript classes.

 
 <mxmlc ... >
 
  <!-- .... -->
 
  <!-- location of generated as classes with gas3 -->
  <source-path path-element="${gen.src.dir}" />
 
  <compiler.library-path dir="${basedir}/libs" append="true">
    <include name="granite-essentials.swc" />   
    <include name="granite.swc" />
  </compiler.library-path>
 
  <keep-as3-metadata name="Bindable" />
  <keep-as3-metadata name="ChangeEvent" />
  <keep-as3-metadata name="Destroy" />
  <keep-as3-metadata name="Id" />
  <keep-as3-metadata name="In" />
  <keep-as3-metadata name="Inject" />
  <keep-as3-metadata name="Managed" />
  <keep-as3-metadata name="ManagedEvent" />
  <keep-as3-metadata name="Name" />
  <keep-as3-metadata name="NonCommittingChangeEvent" />
  <keep-as3-metadata name="Observer" />
  <keep-as3-metadata name="Out" />
  <keep-as3-metadata name="PostConstruct" />
  <keep-as3-metadata name="Transient" />
  <keep-as3-metadata name="Version" />
 
</mxmlc>

One plus one

I can imagine one must be thinking: ‘Everyone could have figured that out!’ And I totally agree, because that’s exactly what this article is about. With some experience with Flex, a developer can write a mobile application on top of a Java EE backend. It doesn’t take much to utilize an existing backend from a mobile platform. Since the latest release of AIR the performance for iOS and Android is pretty good and together with the Granite Enterprise Platform the barrier to emerge an enterprise application to a mobile platform has become much lower.

, , , , , , ,

2 reacties

Misinterpretatie bij zowel gebruiker als ontwikkelaar beperken

Misinterpretatie bij zowel gebruiker als ontwikkelaar beperken

Requirements beschrijven waaraan een product moet voldoen, wat het biedt, welke randvoorwaarden er zijn, hoe het eruit gaat zien, voor wie het bedoeld is, hoe het gaat werken, etc. Maar het blijft een beschrijving, met als nadeel dat iedereen die het leest een eigen interpretatie heeft.

Bij de meeste projecten worden diverse scenario’s met de eindgebruiker of de klant nagespeeld om te bepalen of de specificatie aansluit bij de verwachting. Dit naspelen maakt het voor een eindgebruiker inzichtelijk, aangezien het simuleren en visualiseren van het beoogde gedrag veel meer tot de verbeelding spreekt. En dit voorkomt dat de eindgebruiker een eigen interpretatie maakt van de specificatie. Zoals beschreven in een blog van Karl O’Brien over ‘Requirements are done…‘: “It is like watching a movie versus reading the book, everyone can interpret a book in many ways.”.

Echter stopt het vaak bij de simulaties voor de eindgebruikers, terwijl dezelfde manier van visuele simulatie ook voor de ontwikkelaars en testers van groot belang is. Kans op misinterpretatie bij een eindgebruiker is nu beperkt, maar bij de ontwikkelaars en testers is de kans daarop nog steeds erg groot. Resultaat: het product wordt ontwikkeld met de misinterpretatie en sluit nog steeds niet aan bij de eindgebruiker, tot groot onvrede. Want per slot van rekening heeft de gebruiker tijd geïnvesteerd in validatie, maar ziet deze daar onvoldoende van terug.

Werkwijze

Hoe kun je dit concreet vormgeven, zodat naast gebruikers ook de ontwikkelaars en testers hierin meegenomen worden? Enkele voorbeelden van technieken:

Applicatie-flow

De applicatie-flow bevat schermschetsen van alle flow onderdelen, en deze zijn in de juiste volgorde geplaatst en met pijlen aan elkaar gekoppeld. Zo is er inzicht te krijgen in hoe de applicatie gaat werken.
Bij een van onze projecten hebben we de complete applicatie-flow uitgeprint en groot aan de muur gehangen. Wanneer er een nieuw onderdeel door de ontwikkelaars opgepakt werd, kon de werking daarvan goed uitgelegd worden aan de hand van de applicatie-flow. Ook bij onduidelijkheden waren de ontwikkelaars met regelmaat bij de applicatie-flow-muur te vinden.

Webflow aan de muur

Webflow aan de muur

Paper prototypen

Paper prototyping stelt ons in staat om heel snel ideeën te verifiëren met klanten en gebruikers. Zoals de term al suggereert wordt het prototype van de software gemaakt van papier, gebruikmakend van bijvoorbeeld PostIt notes, gekleurd papier, schaar en markers. Maar ook het tekenen of knippen/plakken van schermelementen kan goed werken. De verschillende schermonderdelen worden in papier uitgevoerd en op het ’scherm’ (een vel papier of het bureaublad) geplaatst. Vervolgens kan de gebruiker met de ’software’ gaan werken. Wij zijn de ‘computer’, en reageren op de acties van de gebruiker zoals de software het uiteindelijk ook zou gaan doen. Deze manier van werken is goed om te valideren bij een klant, en de uitkomst kan vervolgens via het paper prototype aan engineers getoond worden.

Paper prototype

Paper prototype

Wire frames

Het visualiseren van concepten in schetsmatige schermen dwingt ontwikkelaars beslissingen te nemen over functionaliteiten en structuur, en brengt problemen in een vroeg stadium aan het licht. De visualisaties maken het ook mogelijk om de concepten te communiceren naar mensen buiten het team, bijvoorbeeld klanten of gebruikers.
Tenslotte vormen visualisaties zeer expliciete ontwerpdocumentatie; een goede serie (eventueel pixel-perfect) schetsen laat engineers weinig te raden over.

Wire frames als flow diagram

Wire frames als flow diagram

Simulaties

Veel van het gedrag kan via de bovenstaande manieren inzichtelijk gemaakt worden. Maar het blijft bijzonder moeilijk om interactie aspecten via statische plaatjes duidelijk te maken of tekstueel te beschrijven, laat staan dat gebruikers en ontwikkelaars het vervolgens juist kunnen interpreteren.
Door simulaties in te zetten kan met een clickable prototype, video of animatie veel beter bepaald worden of een interactie aspect werkt zoals het bedacht is. Enerzijds kan aan gebruikers getoond worden hoe bepaald gedrag zal gaan werken, en anderzijds is het ook uitermate geschikt voor engineers om het beoogde gedrag correct te implementeren.

Voordeel

Deze technieken voorkomen of beperken misinterpretatie, niet alleen bij de eindgebruikers, maar ook bij de ontwikkelaars en testers. De hele ontwikkelketen dient dit inzicht te hebben, want “de ketting is zo sterk als de zwakste schakel”.

, , , , , ,

Nog geen reacties

MetaEdit+ 4.5 Review

MetaEdit+MetaEdit+ DSM Environment by company MetaCase is a commercial language workbench that in contrast to inflexible CASE tools, enables users to build their own modeling and code generation tools (aka DSM tools). It comes in two main product components:

  • MetaEdit+ Modeler provides customizable DSM functionality for multiple users, multiple projects, running on all major platforms.
  • MetaEdit+ Workbench i) allows building custom modeling languages (DSLs), and text generators and 2) includes the functionality of MetaEdit+ Modeler and MetaEdit+ API (the latter is not reviewed in this document).

This review is written from the MDE perspective and will cover major MDE functionally related to specification of modeling languages. For a complete picture of MetaEdit+, readers are advised to consider other aspects (e.g. collaboration, versioning, etc…) as well.

This review covers MetaEdit+ Workbench version 4.5.

Language Specification

AMetaEdit+ supports graph-like visual languages represented as diagrams, matrixes or tables. There is a limited support for spatial languages: touch and containment relationships are derived from canvas coordinates of modeling elements. There is no actual tool support to preserve these relationships: for example, as a modeller moves a “container” element, contained elements do not move along as expected, but remain at old coordinates.

In MetaEdit+, languages are specified with a set of specialized tools. In the following, we describe the tools per each aspect of the visual language definition: abstract syntax, concrete syntax, static and dynamic semantics.

Abstract Syntax

This aspect is defined with GOPPRR metatypes. GOPPRR is an acronym for metatypes Graph, Object, Property, Port, Role and Relationship. For each metatype, there is a form-based tool, e.g. Object tool allows specification of object types  and Graph tool allows assembling types produced with the other tools into a specification of abstract syntax. GOPPRR tools support single inheritance.

Graph tool also allows linking DSL objects to graphs of other DSLs through decomposition and explosion structures. Furthermore, through sharing language concepts (of any OPPRR metatype) among graphs, DSLs can be integrated so that changes in one model can be automatically reflected in models based on different languages.

An alternative to these form-based tools for abstract syntax specification is a visual metamodeling DSL. However, this functionality is best used as easy start-up leading to automated generation of barebone GOPPRR metamodels. Once a language developer changes a GOPPRR metamodel (which is inevitable), visual metamodeling is best discontinued to avoid manual round-trip between the two metamodels.

Concrete Syntax

By default, MetaEdit+ provides generic symbols. However, language developers are free to specify custom symbols for objects, roles and relationships. These symbols are either defined with a WYSIWYG vector drawing tool or imported from vector graphics (SVG) or bitmap files. Symbols can display text, property values and dynamic outputs produced by text generators (more on generators in section M2T Transformation). Moreover, symbols or their parts can be conditionally displayed. Finally, symbols can be reused among different DSLs via a symbol library.

MetaEdit+ does not directly support multiple concrete syntaxes per language, which (the lack of such support) is still a common practice among language workbenches. However, its capability to display symbols based on conditions allows to work around this limitation.

Static Semantics

This aspect covers constraints and business rules. The purpose of these rules is to ensure a consistent and valid model.

In general, DSM tools should verify a model against the static semantics of its DSL at different times. These times can be classified as ‘live’ (i.e. when a user is modelling) and ‘batch’ (i.e. invoked on events caused by actions such as user demand, model saving or transformation). Furthermore, tool actions following violation of a constraint can be classified as prevention (i.e. a violating action is canceled and a warning message is displayed) or merely informative (i.e. a violating action is allowed, but model will display clues about invalid constructions until the effect of the action is corrected).

MetaEdit’s Constraint tool (available from the Graph tool) allows ‘live’ checks against constraints and preventive protection of models (‘live’ and ‘preventive’ in the terms of the above classifications). The tool is very expressive and easy to use, but covers only limited number of types of constraints, namely:

  • object connectivity in a relationship
  • object occurrence in a model
  • ports involved in a relationship
  • property uniqueness

More advanced constraints have to rely on MERL generator (see section M2T Transformation), which can inform users about invalid constructions during modeling (‘live’ and ‘informative’ in the terms of the above classifications). MERL generator can also be used for ‘batch informative’ and ‘batch preventive’ checks: a checking report can be run on demand or included as preventive check before any other transformation is carried out.

Dynamic Semantics

MetaEdit+ can define dynamic semantics through a process of translating DSL concepts to concepts in another target domain with defined dynamic semantics. Examples of target domains in code generation applications are e.g. C++ or Java. A major benefit of language workbenches is that they are capable of automating this and other useful kinds of processes.

PROCESS AUTOMATION

MDE applications need capabilities to automate processes in which models are inputs and outputs. MetaEdit+ provides various levels of support for model-to-model (M2M), model-to-text (M2T) (e.g. in code generation applications) and text-to-model (T2M) (import of legacy code, data type definitions, etc. into models) types of transformations. (The latter transformation type is not reviewed.)

M2T Transformation

Text (and more specifically code) generation is accomplished with Generator tool that can efficiently navigate models, filter and access information, and output text into external files, Generator Output tool and DSL symbols.  All these tasks are specified with imperative language MERL. While MERL is very concise and efficient for most of these tasks, I think that navigation and access tasks are better accomplished in a declarative way.

MERL generators are defined per graph type (i.e. per DSL) and can be acquired from supertypes of a given graph type via an inheritance hierarchy. If a generator has to be used for different graph types, then the generator should be defined for the common parent graph type. On the other hand, DSL developer can define new or redefine generators already provided by parent graph types.

Finally, MERL provides support for modularization by allowing includes of generators in other generators. Making modular generators pays off well, as there are many reuse opportunities in MetaEdit+: generators can be reused not only for text generation but also in concrete syntax (symbols) and validation/reporting purposes (symbols, generator output tool).

M2M Transformation

Models can be transformed 1) programmatically via the SOAP and WebServices-based API of MetaEdit+ (this option requires product component MetaEdit+ API) or 2) through code generation of an intermediate external representation (in the XML format) and consequent import thereof as new model.

These two options amount to a generic support at a minimum level that is commonly provided nearly by all language workbenches. Moreover, code generation of an intermediate representation cannot implement in-place M2M transformations, of which application examples are: model optimization, model layout, model interpretation, model weaving and any repeatable model manipulation in general.

OTHER

  • DSL evolution: MetaEdit+ updates existing models instantly yet non-destructively to reflect changes in DSLs.  The update policy ensures that models created with the older DSL versions are not broken and remain usable with existing generators. Instant update is also very useful when fine-tuning a DSL with end users.
  • According to MetaCase, a MetaEdit+ project can hold over 4 billion objects. A typical project would contain about 40-100 models (graphs).
  • In the multi-user version, users can simultaneously access and share all models within a Repository. Locking is made at the object-level, so several users could collaboratively work on the same model at the same time.
  • Multi-user collaboration in MetaEdit+, product line analysis of commonality and variability and proper separation of concerns reduce the need for version control as it is known in software engineering. Therefore MetaEdit+ does not provide its own versioning system. Best practices for versioning with MetaEdit+ can be found here.
  • Model interoperability: by default, all models and DSLs can be exported in an XML format. The schemas are very simple, which make it easy to post-process such files if needed. Moreover, the M2T transformation capabilities of MetaEdit+ enable DSL developers to easily create custom export generators.

CONCLUSION

MetaEdit+ is a versatile language workbench that enables building high quality visual DSLs for any kind of domain, be it technical or business. Another key quality of MetaEdit+ is efficient DSL/GOPPRR tools, which allow light-weight, agile and fast DSL development and evolution. A testament to this quality is the fact that MetaCase is one of few language workbench makers that routinely designs and builds DSLs in improvisation with audience at conferences, workshops, etc. In my opinion, this impressive productivity is possible because GOPPRR tools are based on paradigms that are optimum for DSL development (DSM for DSM so to speak).

Highlights of MetaEdit+ are:

  • Proper level of abstraction: DSL developers are completely shielded from details of how DSM-tools are implemented. DSL development tools focus on essential abstractions for specification of languages and generators.
  • High-levels of automation: DSM-tools are completely and automatically generated from abstract language specifications.
  • High quality of tools: each DSL development task has its own dedicated tool.
  • Numerous enhancements: high integration of tools, non-destructive evolution of languages, inheritance mechanism, reuse opportunities for types, symbols and generators, visual metamodeling, etc.
  • Very cheap introductory license.

Naturally, there are a few drawbacks as well:

  • No specific support for model-to-model transformation.
  • Somewhat limited constraints support.
  • Limited support for spatial relations.
  • Uncommon user interface.
  • Form-based GOPPRR tools prevent a global overview of a metamodel.
  • Expensive  standard licenses.

Code generation applications are the oldest tradition in MDE and this is where MetaEdit+ excels. As MDE discovers new applications, my experience is that the code generation specialization becomes restrictive. Admittedly, it is possible to implement some types of M2M transformations with code generation (via intermediate representation). However, the problem with this workaround is that it introduces accidental complexity both to MDE developers and more importantly to end users (that have to keep repeating the generate/import routine, sometimes complicated by model merge).

That said, in my opinion MetaEdit+ gets the big things right. Whether its shortcomings are little things is a subjective matter that is best evaluated in the context of a concrete problem domain.

, , , , , , , , , , , , , ,

Nog geen reacties

DSL Design Tutorial at PPL2010

Photo from Inception (2010)In MDD explicit knowledge of the domain is crucial for successful development of domain-specific modeling languages (DSML). Yet many starting DSL developers are missing the skill of domain knowledge conceptualization. The main symptoms are difficulty to come up with good language concepts and struggling with levels of abstractions.

While language design remains an art, there are a number of paradigms, techniques and guidelines that can make creation of DSLs easier. These helping means are the core of the DSL design tutorial developed at Luminis Software Development.

The tutorial was given for the first time during the PPL2010 conference that took place on November 17 & 18 at Océ R&D, Venlo, NL. A small group of participants learned basics of domain analysis, participated in domain definition and implemented a simple metamodel of their own. The general feedback was very positive.

The slides for the tutorial can be downloaded here from the Bits&Chips website.

, , , , , ,

Nog geen reacties

Introduction to AIR for mobile

A couple of weeks ago, Adobe released a preview of the new Flash Builder and SDK. One of the new features is support for mobile devices using AIR. For now, only Android 2.2 is capable of running mobile AIR applications, but since Steve has changed the rules again, AIR on iOS is nearby, according to Adobe. Time to take a test drive with a tutorial.

Goal

We will create a simple RSS reader. Not a very exciting example, but already shows some nice features of AIR for mobile. I’ll assume you have experience with Flex or AIR, but I think you will manage with some level of programming experience. If not, feel free to leave a reply if you have any questions or take a look at the full source.

Setup

Empty project contents

Download and install the preview release of Flash Builder called Burrito It provides a wizard to start an empty mobile application. By default the wizard creates two mxml files containing a MobileApplication and a View component.

The MobileApplication class is inherited from the Application class used for desktop AIR. The mobile version provides, among other things, an action bar and a navigator. Furthermore its firstView property points to the empty view component. The view component is a normal group, but optimized for mobile use as well.

Article list

Open the main view component (called <projectName>Home.mxml). Create a List component in the main view. Provide positioning constraints to let it occupy the whole screen.

<s:List left="0" top="0" bottom="0" right="0" />

To retrieve the feed, create an HTTPService pointing to the RSS feed in the declaration section of the view. Add a resultHandler function to parse the feed-data. Parsing xml data is quite simple. You can just navigate to the DOM-tree as it were a normal ActionScript object. Use the data property of the view to store the articles locally. Using this property will provide some benefits with navigation, which will become clear in a bit.

<fx:Script>
  <![CDATA[
    import mx.rpc.events.ResultEvent;
 
    protected function service_resultHandler(event:ResultEvent):void {
      data = event.result.rss.channel.item;
    }
  ]]>
</fx:Script>
<fx:Declarations>
  <s:HTTPService
    id="service"
    url="http://lsd.luminis.nl/feed/"
    result="service_resultHandler(event)" />
</fx:Declarations>

Now there are only a couple of things left to do. Invoke the server and provide the list with the articles and instructions to show them.

Both are quite simple. The feeds are retrieved by invoking the send() method of the service. To automatically retrieve them, this method should be invoked when the view is created so we will use the creationComplete handler.

<s:View
  xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark"
  title="Home"
  creationComplete="service.send()">

Finally, bind the data property to the dataProvider of the list and set its labelField attribute to ‘title’.

<s:List
  dataProvider="{data}"
  labelField="title"
  left="0" top="0" bottom="0" right="0" />

Your view will probably look something like this.

<?xml version="1.0" encoding="utf-8"?>
<s:View
  xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark"
  title="Home"
  creationComplete="service.send()">
 
  <fx:Script>
    <![CDATA[
      import mx.rpc.events.ResultEvent;
 
      protected function service_resultHandler(event:ResultEvent):void {
        data = event.result.rss.channel.item;
      }
 
    ]]>
  </fx:Script>
 
  <fx:Declarations>
    <s:HTTPService
      id="service"
      url="http://lsd.luminis.nl/feed/"
      result="service_resultHandler(event)" />
  </fx:Declarations>
 
  <s:List
    dataProvider="{data}"
    labelField="title"
    left="0" top="0" bottom="0" right="0" />
 
</s:View>

Emulator

Emulate hardware buttons

Emulate hardware buttons


Now it is time to run a first test. Click the Run button and select ‘On Desktop’ as launch method in run configuration dialog. Also choose a device to simulate and run the application.

When the emulator is launched it shows a list of articles after a couple of seconds. Now you can select Rotate Right from the Device menu to display the landscape view. You will also notice the list is able to scroll up and down when dragging your mouse pointer (Which of course is the emulated equivalent of a one-finger swipe)

Article details

Next is to create a detailed view showing the full content of an article. Close the emulator and return to Flash Builder. In the views package, create a new component and call it DetailView. Bind the title attribute to data.title. Add a label as well and bind the text property to data.description. Don’t forget to specify the positioning constraints.

<s:View
  xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark"
  title="{data.title}">
 
  <s:Label
    text="{data.description}"
    left="20" right="20" bottom="20" top="20" />
</s:View>

All view components provide a navigator object. We will use this in the change event handler of the article list. This event is fired when the user selects an article from the list. It looks as follows:

import spark.events.IndexChangeEvent;
 
protected function articleList_changeHandler(event:IndexChangeEvent):void {
  navigator.pushView(DetailView, data[event.newIndex]);
}

It simply instructs the navigator to create a new DetailView and push it on top of of the navigation stack. Furthermore the selected item from the article list is passed on to the data property of the DetailView.

Add the change handler and assign it to the change event of the article list:

<s:List
  dataProvider="{data}"
  labelField="title"
  change="articleList_changeHandler(event)"
  left="0" top="0" bottom="0" right="0" />

Article list inside the emulator

Article list inside the emulator

For performance optimization, AIR destroys the view when a user navigates away and recreates it when he returns. Only the contents of the data property is saved and passed into a recreated view of the same type. This is why we used it to store the articles. Otherwise the user has to wait for a reload when he returns to the main view.

When you launch the new version in the emulator, you will notice the application slides to the detail view when an article is selected. Click Back from the Device menu to simulate a click on the hardware back button.

Last but not least: action buttons

One thing our application is missing, is a button to go to the original webpage showing the full article. This button is placed inside the header of our detail view, next to the title.
To achieve this, add the button inside the actionContent of the detail view. Give the button an icon (I used one from the Tango project) and set the click handler to open the url of the article.

<s:actionContent>
  <s:Button
    click="{navigateToURL(new URLRequest(data.link))}"
    icon="@Embed('/assets/internet-web-browser.png')"/>
</s:actionContent>

Of course you might want an additional button to return to the article list instead of using the ‘hardware button’. Place this button inside the navigationContent. This will place the back button at the upper left corner. The click event of this button will invoke the navigation.popView() method to remove the current view from the stack and return to the previous one.

<s:navigationContent>
  <s:Button
    click="navigator.popView()"
    icon="@Embed('/assets/go-previous.png')"/>		
</s:navigationContent>
Action and navigator buttons

Action and navigator buttons

If you launch the application you will notice the buttons are nicely aligned at the top of the screen.

What’s next?

The next step will be to package the application to an apk file so you could install it on an Android device. This is done by the Export Release build wizard inside the Project menu of Flash Builder. It includes the ability to sign your application to allow distribution through the Android Market.

Another nice feature which I will not discuss in detail is to add gesture based navigation. Take a look at this article from Adobe to find out more. The approach discussed should be working for mobile AIR applications as well.

Unfortunately the most interesting benefit of using AIR for mobile didn’t become clear with this tutorial. It would be nice to deploy our application on other mobile plastforms as well. However the cross compiler for iOS isn’t available yet and the same goes for AIR on Windows Phone, BlackBerry or Symbian. We will just have to wait when Adobe is ready so we can fully benefit from the “Write once, run anywhere” promise.

, , , ,

3 reacties

Kantoorslang

Office 1719

De laatste tijd heb ik een lijstje gemaakt met uitspraken die volgens mij vrijwel nooit buiten kantoormuren geuit worden:

  • doorakkeren
  • inschieten
  • oppakken
  • opschalen
  • verwachting neerleggen
  • doorpakken
  • aanvliegen
  • ergens een ei over leggen
  • issue ergens beleggen
  • ergens op acteren
  • iets platslaan
  • aan de pruttel helpen
  • de hele spullenboel
  • doorsnijding
  • propositie

Wie heeft leuke toevoegingen?

, , ,

4 reacties

The thin line between embracing change and being critical

The thin line between embracing change and being critical

Blogging: never before have so many people with so little to say said so much to so few
Do you recognise the following? Suddenly there’s a lot of buzz about a new hype, everybody is talking about it and if you haven’t tried it yet, you are definately lagging behind.
Now you have to decide: will you hop onboard and give $hip_new_tech a try or are you skeptical and wait it out?

Sometimes a new technology has obvious advantages, which makes it easy to accept. Other things need some time to show their merits, or need a certain user base to become useful.

Following are some examples, I only have experience with some of them, so feel free to comment or add your own!

VCS vs. DVCS

In the recent years, several distributed source control systems, such as Git, Mercurial and Bazaar, have emerged. Centralised systems are mostly common practice at most projects and a lot of (mostly open source) projects have already switched to or are thinking about switching to a distributed one.
The distributed systems have some nice perks, everybody has the whole repository (i.e., better offline support), sharing commits without submitting them to the central server, local branches and more. On the other hand, they require learning the new tool, which can take a lot of time, especially with the less tech-savvy coworkers.
I’ve been using Git for a few years now. For a previous project, we were able to fully switch to Git with our team. This was my idea and it meant I had to take up some Git support work every now and then, but it was fun and provided the abovementioned advantages. In the projects that followed, the main repository was Subversion, but there is a Subversion connector for Git, which works fine for daily use. It has a few inconveniences, like not committing the removal of directories to Subversion, so someone else has to clean them up. For the rest, it’s great.

The cloud

Another hip thing is ‘the cloud’, which allows you to host web sites, run applications and store stuff somewhere in a giant network. It sounds really scalable, you only pay what you use and most of the management is done by the cloud provider. There are some risks: you might need to modify the application to make it work, security and encryption could become more of an issue and there are new tools to get used to (e.g., for deployment and configuration).

NoSQL vs. RDBMS

The NoSQL-movement has gained a lot of momentum, known implementations include CouchDB, Jackrabbit, Cassandra and BigTable. It advocates that most data can be treated a lot less strict than old-style databases do. Think foreign keys, strict data types and designated master/slave servers. When true, this improves performance, flexibility and scalability, but you need to think through your decision, as some data really needs to have a restricted format.

Social networking: blogs, Twitter, LinkedIn

Internet has enabled new forms of communication, and every few years, a new one is invented.
First came blogs, then Twitter and LinkedIn. Now most sites have an array of icons to submit the current article to one of many networking sites.
Twitter has brought news reporting to everyone, blogs allow even me to say stuff to the world, networking sites help you to find people with common areas of interest.
They do however cost a lot of time and effort, which might intervene with other activities. Anybody wants to comment on this? Do you feel your real social life profits from this, or does it get in the way of it?

tl;dr

These are some things I could think of, do you have some other examples of hypes you aren’t sure about?
What do you usually do in these situations? Are you an early adopter or not so much?

, , , , , , , , ,

Nog geen reacties

Detachering versus inhouse

Detachering versus inhouse


Enkele maanden geleden is het project waarop ik gedetacheerd zat afgerond; inmiddels heb ik ook een paar maanden meegedaan aan een inhouse-project. Bij Luminis doen we weinig aan pure detachering, vandaar dat het me leuk lijkt om ‘ns te bekijken wat de overeenkomsten en verschillen met onze andere projecten zijn.

Een deel van onze projecten vindt plaats in onze eigen kantoren, een ander deel bij klanten, waar dan een aantal mensen van de klant en een aantal mensen van Luminis samenwerken.

Sfeer

De sfeer tijdens het werken aan het project hangt vooral af van het team waarin je werkt, en ook een beetje van de lokatie. Uiteraard heb je daar zelf enorm veel invloed op, je kunt een goede dosis humor meenemen, meegaan met de lunchwandeling, eens koffie voor een ander meenemen, et cetera.

Inhoudelijk is het lastig onderscheid maken. Natuurlijk richt Luminis zich op leuke, innovatieve projecten, maar dat was het project waarop ik gedetacheerd zat ook. Bij sommige projecten kun je van tevoren al redelijk inschatten dat het een saaie klus gaat worden, dat kun je dan ook aangeven bij je baas, met een beetje geluk mag een ander het doen :-) .

Bij inhouse-projecten ken je meestal je collega’s al, wat de start van een project misschien wat makkelijker maakt, zeker als je wat introverter bent (da’s tenminste mijn ervaring). Misschien heb je ook wel meer overeenkomsten met directe collega’s, omdat ze bij hetzelfde bedrijf werken en dus dezelfde visie delen.

Wanneer je gedetacheerd wordt ben je aan het begin naast de inhoudelijke kant van een project ook tijd kwijt aan het leren kennen van het team, de sfeer en de praktische zaken van het bedrijf waar je aan de slag gaat.

Overhead

Het verdwijnen van de overhead van gedetacheerd zijn is fijn, geen dubbele urenregistratie (met de onvermijdelijke verschillen, en het bijbehorende uitzoekwerk), geen extra e-mailaccount en kalendersynchronisatie.

Ook is de organisatiestructuur al bekend voor je, zodat je direct naar de juiste persoon kunt stappen om iets geregeld te krijgen.

M’n vorige project was bij een overheidsorganisatie, waar internet op de werkplek nu pas werkelijkheid aan het worden is. Het is een verademing dat dat bij Luminis anders is: een snelle internetverbinding, alle tooling (issue tracker, wiki, versiebeheer) is (intern en extern) bereikbaar. ‘t Is natuurlijk niet zo dat je nooit internet hebt op inhuurplekken, maar het komt vaker voor.

Et tu?

Wat zijn jouw ervaringen? Heb je bewust gekozen voor een detacheerder of juist een bedrijf dat zelf projecten doet? Was het een goede keus of zou je het een volgende keer anders doen?

, , , , , ,

1 reactie