Blog Tag – Stickfight has thrown down the gauntlet (well fingerless glove)

August 16, 2010

Boxing gloves As part of our preparation for polishing our Adobe Flex skills Mark Myers has suggested a Blog Tag – where we set each other an Adobe Flex technical challenge in which we have 2 weeks to write a blog explaining how to solve it.

Here is my first challenge to Mark.

Your challenge is to create a custom component which has no external dependencies i.e. a black box which utilises the inbuilt internationalisation features of Adobe Flex to display popup help in the users currently selected language.  The popup help should have a close button and a more info button both of which should dispatch appropriate events – you do not need to handle the additional info action in the component.

The popup help should be suitable styled and positioned either at the calling event (mouse click) or in a fixed position (maybe configurable – top, middle, left etc)

Ideally though the component will utilise the inbuilt internationalisation features of flex it should be possible to swap out this approach to use an alternative source / method for the content without having to change the core code.

Good luck Mr Myers!

If anyone else wants to get involved just drop us a note – its a good way to learn new stuff and build content in your blogs.

0

Adobe Flex Frameworks & why they matter (particularly if your coming from Lotus Notes)

August 4, 2010

rl-header-logo-310-253 Frameworks – particularly micro AS3 frameworks for Flex seem to be in vogue, but why?  What do they offer?  Other than adding what looks like making your apps more complex.

If your a Lotus Notes / Domino developer I am sure you have come across the classic tactical application which has grown over time to be a business critical application, you know the one which has had multiple developers over time (who have now left) and of course there is no documentation.

One of the advantages of Lotus Notes is its quick to develop and there are multiple ways to do the same thing – particularly Domino apps.

One of the disadvantages of Lotus Notes is there are multiple ways to do the same thing (you see what I did there ;-)

This leads to an unholy mess of an application – you have code everywhere, you have business logic in hide when’s, you have computed text creating fields on the fly, multiple script libraries with 40 functional routines etc.  This ultimately leads to several things happening: 

  • Bugs and errors go up -  but hey doesn’t matter its quick to fix right – maybe before IT compliance rears its head?
  • Support and lights on budgets get consumed by these Notes apps, but they were quick and cheap to develop right?
  • Adding new functionality suddenly takes a lot longer than you would expect – mainly because you have no idea what the impact will be and you have to find out how it all fits in – assuming you didn’t build the complete app.  Ever added a new lookup view to an application because it was easier to do rather than workout the impact of modifying an existing lookup view.

Of course the IDE doesn’t help – the Domino Designer is really staring to show its age when compared to other IDEs.  To be fair it has to manage a lot of different design elements as well as 2 clients.

Adobe Flex apps could suffer from similar problems if you followed the same route but this is where a framework comes into its own + some other bits like Unit Testing and Continuous Integration. 

Frameworks provide a structure to your applications – i.e. they help to define a best practice application architecture, which ultimately means as a developer you know where your various bits of code should be placed and if you were joining a team or working on existing application you would already know how its structured.  Not only do frameworks help with structure they also are designed to make it easier to unit test by isolating key functionality, which also makes it much easier to add new functionality as well as much better reuse.

There are several frameworks available (list taken from http://corlan.org/flex-frameworks/):

  • Cairngorm (Adobe Open Source) – MVC framework
  • PureMVC (Open Source) – MVC framework
  • Mate (Open Source) – Mate is a tag-based, event-driven Flex framework
  • Swiz (Open Source) – Metadata-based Dependency Injection framework
  • Spring ActionScript (Open Source) – Dependency Injection framework part of SpringSource
  • Parsley (Open Source) – IOC Container (Configuration and Dependency Injection), MVC, and localization
  • Robotlegs – automated metadata based dependency injection micro-architecture (framework) with a light footprint and limited scope

After looking at several I have decided for now to settle on Robotlegs

Robotlegs is an IoC/DI container that is modeled on the PureMVC application structure. It is designed to be MVCS, model-view-controller-service, providing metadata dependency injection across these layers.

Ok so what does that mean in English ;-)   Basically it means that the framework breaks your code elements in Flex down into:

Context – This is where the mapping between the various framework elements happen, its also acts as an event bus.  There needs to be at least one context but there can be more.

Mediators – mapped to your views.  Mediators are the middle men (or women) between your views and the framework.  They pass along view events to the framework and access view methods and properties on behalf of the framework.

Views – your visual components, datagrids, lists etc.  The idea here is the visual components have no dependencies on your application.  Instead they use mediators to pass information via events out to the framework.

Commands – This is where the business logic lives.  These are short lived objects.

Models  – These objects do the work on the data.  They raise events once the work has been done.  NB Value Objects (VO) are associated with the model and provide strong data typing.

Services – This part of the framework communicates to external services (XML, SOAP, RemoteObject etc) and raises events when work has been done.

Communication is done between the framework and the application by using standard flash events.

Heres a great diagram which shows how the bits talk to each other (links to Robotlegs site)

robotlegsflow

 

Resources

An Introduction to Robotlegs AS3 Part 1: Context and Mediators

An Introduction to Robotlegs AS3 Part 2: Models

An Introduction to Robotlegs AS3 Part 3: Services

Best Practices

3

Adobe Flex & Lotus Notes Presentation

August 3, 2010

Here is the presentation I gave at LCTY Manchester – its done using the prezi application which I highly recommend.

2

Problems Debugging Flex apps in the latest build of Firefox

July 26, 2010

I use Firefox and firebug to help debug Adobe Flex applications – firebug is a lot cheaper than paying for the advanced version of Flash Builder for the network monitor.

The problem is in the latest version of Firefox they introduced process isolation for plugins – this just causes any flex app to freeze when I am trying to debug it and the only way to kill Firefox is to end the task.

The solution (work around) is here.

1

LCTY Manchester – Presenting Flex & Notes Integration (possible freebies)

April 29, 2010

If you can make it to the LCTY Manchester on the 13th May I will be giving a presentation on integrating Adobe Flex and IBM Lotus Notes.

I will be covering:

  • Why Flex & Notes – the business case / the geek case?
  • Building Notes 8 Sidebar widgets.
  • Leveraging Notes Security.
  • Best practices for exposing Notes data and business logic to Flex.
  • Configuring environments to use Flex apps / widgets on non Domino web sites.
  • Lessons learned – e.g. Code Structure, Logging & Debugging, SSL & IE, Multi Panel Applications.

I will demo / breakdown a couple of Flex apps which we will be available to take away – including the supporting Notes Databases.

The aim of the presentation is to try to highlight from a technical and strategic perspective why you should consider leveraging Adobe Flex as a front end for your Notes applications, something you can take back to your managers / senior managers / IT Director.  Though the presentation is aimed at developers we will not have time to go into great detail so it should be fine for Administrator / Managers as well ;-)

Even if you still haven’t upgraded from version 6 of Notes there will still be something of value for you here.

Adobe UK have promised me some giveaways which I will distribute in the presentation.

1

ILOG Elixir – v3 Beta now available

April 28, 2010

ILOG Elixir

The next version of the excellent interface components produced by ILOG, now owned by IBM, for Adobe Flex is available as a Beta here.

You can tell its now an IBM product as the name has gone from ILOG Elixir to IBM ILOG Elixir Enterprise 3.0 ;-)

 

Features:

  • Supports Flex SDK 4.0 & Flash Builder 4.0
  • New: Diagram services for custom display creation as flowcharts, network topologies, process modelers etc. (Spark)
  • New: Timeline components (Spark)
  • Improved: Gantt charts for planning and scheduling services (MX, FXG custom item renderers)
  • Rewrite of the gauges and map components under the Flex 4 Spark architecture (also delivered as Flex 4 MX components)
  • Numerous improvements on existing IBM ILOG Elixir components (organization charts, maps, calendar, pivot charts)
  • New: screen reader support for most components
  • Improved: keyboard navigation support
  • Improved: Flash builder integration with new wizards for creating custom gauges and Elixir libraries import in your projects
  • Leverages Flash Player 10 for better performances
  • Part of IBM Passport Advantage program, means product commitment for minimum 8 years.
  • New packaging: Elixir Enterprise extends Elixir with Diagram and Gantt modules.
0

HTC Desire Good – Vodafone Bad

April 16, 2010

I have an iPhone 3G with O2 and decided it was time to try something a little more open as my contract was up.

I decided to settle on the HTC Desire which gets good reviews and go with Vodafone as they offer a Pico cell (Sure Signal) – living in the sticks we don’t get a great mobile signal so thought it would be a good investment.

I picked up the phone yesterday and my O2 sim was still active as the number hadn’t ported yet.  I manually added the APN for O2 and bang we were off.  It was so fast!

The phone rocketed through the apps and the data speed was so fast – I was on a client site in central London  – right next to the Lloyds building.  It appeared the phone was running on the HSDPA network – something never seen on an iPhone.

Today my Vodafone sim became active and it all goes down hill.  I now get edge where I had HSDPA and worse I just had a call drop while sitting at a window looking at the Gherkin.

The ironic thing is I brought a Pico cell because I don’t get a great signal in the sticks but it appears with Vodafone you don’t get one in central London either.

This brings up an interesting question about the O2 network, when on the iPhone I rarely got a 3G signal and when I did it didn’t seem to make much difference but on the HTC Desire it was great.

So looks like the phone & contract are going back and I will get an O2 1 month sim and stick with the iPhone for now.

0

Flash / Flex on Android

March 31, 2010

Do you think a Flex app on a Google Nexus phone might be slow?

Think again.

1

Loving XPages101 Training Videos

March 31, 2010

Got to say very impressed with Matts Xpages Training Videos.

I have been putting off learning XPages because I wanted to concentrate on Adobe Flex and I haven’t been that happy with the training resources that have been available for XPages.  As a contractor my limited down time to learn new stuff means I need quality concentrated material.

I am at the early stages but I do have a production product to build so that helps ;-)

My biggest fear with X Pages is the concept of auto generated code – the drag this to the page and it just works kind of thing.  Reminds too much of the time we just used Domino generated views and realised we had to handcraft the lot.  As long as any auto generated code implementation doesn’t constrain you or force you to go around the houses to override it then its fine.

Still some great minds think X Pages are the bees knees so I am going into with an open mind as much as possible.

1

Authenticated Multi File Uploads – A possible solution

January 27, 2010

Jake has been work hard on building some excellent Flex components which play nice with Domino.

One issue he has hit is with a bug in the Flash Player which means for non IE browsers session authentication is not sent with the fileupload HTTP Post.  This means currently only anonymous individuals can upload attachments on non IE browsers.  This of course could be a real problem for applications which require users to sign in – is there any that don’t?

To get around this I have been brainstorming an idea which hopefully gets around this problem.

My original suggestion was just to allow the post to go to a design element which allows Write Public access and have an agent do the actual attaching – a proxy service.  The problem is this HTTP Post could then be executed by anyone who could see the HTTP traffic – though the actual agent would expect a valid UNID and discard anything else, this in turn with the fact that this would only work for documents which an originally authenticated user could see (to get the UNID) mitigates the risk quite allot.

Still…

The following flowchart describes a process which should mitigate even that issue. 

It basically shows that the initial request to Domino is to a restricted agent to create a stub document which in turn returns the UNID of this stub document.  This stub document UNID is then used to post the attachment via the public access agent – this agent will then look for the stub document to complete the request.   No stub document then no attachment.

As a new stub document is created for each request (and then discarded) it shouldn’t be possible for anonymous user to reuse the HTTP Post.

11