Posts Tagged ‘Ajax’

HTML5 gets a database

June 9, 2011

As a relative late comer to HTML5 trying to catch up on a spec that spans over a 1000 pages is no mean feat, let alone the fact that the definition of what makes up HTML5 is covered across several specs (see previous blog on standards spaghetti). If you’ve been following this series then you’ll have worked out I have a few favourite features that I think will radically change the perception of web applications, and you guessed it HTML5’s support for database access is another.

The specification started out as early as 2006 with WebSimpleDB (aka WebSQL), and went as far as implementation into many browsers including webkit, Safari, Chrome and Firefox. From what I can find Oracle made the original proposal in 2009 and the W3C made a switch to Indexed DB sometime in 2010. Although Mozilla.org already had their own implementation using SQL-Lite, they too preferred IndexedDB). The current status as of April 2011 of the IndexedDB spec is that it is still in draft, and according to www.caniuse.com early implementations exist in Chrome 11 and Firefox 4. Microsoft have released a prototype on their html labs site at to show their current support .

Clearly it is not ready for live commercial applications in the short term, but it is certainly something worth keeping your eye on and to plan for. When an application requires more than simple key value pairs or requires large amounts of data, IndexDB should be your choice over HTML 5’s WebStorage api’s (localStorage and sessionStorage).

The first important feature about IndexDB is that it is not a relational database but in fact an object store. Hence there are no tables, rows or columns and there is no SQL for querying the data. Instead data is stored as Javascript objects and navigated using cursors. The database can have indexes defined however.

Next there are two API modes of interaction, Asynchronous and Synchronous API’s. As you would imagine synchronous API’s DO block the calling thread (i.e each call waits for a response before returning control and data). Therefore it follows that the asynchronous API’s do NOT block the calling thread. When using asynchronous API’s a callback function is required to respond to the events fired by the database after an instruction has been completed.

Both approaches provide API’s for opening, closing and deleting a database. Databases are versioned, and each database can have one or more objectstores. There are CRUD API’s for datastore access (put, get, add, delete) as well as API’s to create and delete index’s.

Access to the datastore is enveloped in transactions, and a transaction can be used to access multiple data stores, as well as multiple actions on a datastore.

At a very high level, there you have it, IndexDB is a feature that allows you to manage data in the browser. This will not only be useful for online applications (e.g. a server based warehouse could export data cubes for local access) but also for offline applications to hold data until a connection can be established. I’d fully expect a slew of Javascript frameworks to add value ontop of what the standards provide, indeed persistence.js is one such example.

It’s good to see early implementations and prototypes for IndexDB and whilst the date for finalising this spec is unclear, I for one will be monitoring it’s progress closely and waiting with baited breath for it’s finalisation.

http://www.w3.org/TR/webdatabase/

http://www.w3.org/TR/IndexedDB/

http://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/

http://trac.webkit.org/export/70913/trunk/LayoutTests/storage/indexeddb/tutorial.html

HTML5 gets cross with domains

June 2, 2011

In my last post I overviewed a number of new communications features in HTML5 that in my mind will no doubt transform web applications moving forward. One of those features was Cross Document Messaging which is one of the most exciting new features I’ve found in the specification.

One of the big constraints of web applications has been allowing separate applications to talk to each other. For example let’s say you have a phone book application and you have a news feed application. If you wanted to show news for a person you selected in your phone book you couldn’t get the phone book to tell the news application which person you had selected, you would have enter the person’s name in the news application and then search: a series of manual steps as automation wasn’t possible.

Along came portal technology, followed by portal standards (JSR168 then JSR286), which enabled applications to do exactly this, share data (of course they have many other features and benefits to). Whilst a portal page can consist of applications (portlets) running off different servers, the main constraint of them sharing data is that they have to be on the same portal page i.e. you couldn’t have two applications running in separate browser windows or tabs and sharing data or passing messages between them.

Cross Document Messaging overcomes this. Essentially an application can use PostMessage to send a message:

 my_iFrame.contentwindow.postmessage(‘Hi there’, ‘http://www.myapp.com/’);

NOTE: you can’t send message from a https to http (or vice versa) application.

 The targeted application must implement an event listener:

 window.addEventListner(“message”, msgHandler, true);

and obviously create the msgHandler function to process the message.

  function msgHandler (e) {…..handling code…..}

The receiving application will be notified of the senders web address (origin) and can therefore choose to ignore the message if it is coming from an unrecognised source. It is best practice for the receiving application to maintain a “white list” trusted origins and check these before processing messages.

Even with trusted origins messages coming in as strings need to be validated as they could contain script and open themselves up to an “inject attack”. This is where the string contains script rather than data, if the script is evaluated it essentially issues a set of commands to the receiving apps server.

The two applications can be in entirely separate browser windows, hence overcoming the constraint of a portlet approach.

The concept of Origins is used by other new features such as XMLHttpRequest. As per my last post previously this API was only able to talk it’s own origin. Now it can talk to other origins, essentially allowing for content to be aggregated in the client rather than just at the server as is the case today.

 This is a simple posting of a powerful capability, certainly an area web developers should consider delving deeper into.

Does HTML5 mean the end of the road for Gears, HTA and Flash?

March 10, 2011

Web standard HTML5 contains loads of great features, from video playback to drag-and-drop. But the best bit, and currently one of the least talked about elements, might be the capability to run apps offline.

The normal web experience is hindered by connectivity. Users can typically access web apps while they have a connection to the internet. Once offline, individuals lose access to email, calendar or notes. There are, of course, workarounds. Google Gears, for example, allows users to navigate compatible sites offline and synchronise when back online.

Microsoft HTML Applications (HTA), meanwhile, is a Microsoft Windows formalisation that provides a web-like experience offline. And Adobe Flash can also be run offline, allowing users to run Flash-based content.

Such workarounds are OK but they are also a bit messy. People want the same experience online or offline; they want to get hold of – and manipulate content – regardless of location and they don’t want to be hindered by platform specific technologies or plug-ins.

HTML5 provides that standardisation. Its two–pronged approach re-connects the user through an SQL-based interface for storing data locally, and an offline cache that helps ensure apps are always available (see further reading, below).

With regards to availability, HTML5’s application cache mechanism provides the ability to have a fall back page for rendering pages when offline. It also provides a means to update cache dynamically. The key, here, is client-side management.

And without wanting to bang my own drum too loudly, it is a rhythm I have been hinting at for a long, long time. I blogged two years ago (see further reading) about client-side management as a method for keeping data in the browser, rather than the server, and as means to reducing memory and processing requirements.

“If only it was supported as standard by the browser rather than having to use hidden fields,” I concluded – and now that day is fast approaching. HTML5 creates a standards-based method for creating local apps that run offline.

As mentioned earlier, HTML5 also provides the ability to store data locally through a client-side SQL database. A series of apps could potentially work with this database, providing a new level of accessibility and integration.

The total approach represents a huge step forwards for web development. It also signals that the end is nigh for proprietary workarounds like Gears, HTA and Flash. HTML5 is the future and web developers simply must get with the program.

Further reading:

http://www.w3.org/TR/offline-webapps/

http://blogs.computerworlduk.com/facing-up-to-it/2008/07/client-side-session-management/index.htm

The new legacy is HTML !

November 22, 2010

The legacy of past computing decisions is one of the biggest technology challenges facing businesses. What’s more, lessons from the past are not being heeded.

Let’s start with the most famous legacy code of them all – because if you’ve encountered COBOL, you’ve encountered legacy. Invented in 1959, the object-oriented language became a mainstay of business computing for the next four decades.

The legacy, however, quickly turned into a significant burden. Gartner reported that 80% of the world’s business ran on COBOL in 1997, with more than 200 billion lines of code in existence and an estimated 5 billion lines of new code produced annually (see further reading, below).

The reliance on that rate of production came home to roost towards the end of the last century, when language problems led to the panic associated to Y2K. The story since then has been one of decline. The continued move of business online has led to a clamour for new, sleeker and internet-ready programming languages.

First specified in 1990, HyperText Markup Language (HTML) became the predominant web development language. Its use ran alongside the development of open standards, such as JavaScript and the Cascading Style Sheets of CSS.

Such languages and styles helped to define the layout of the Web. But that is far from the end of the story. Online development in the era of HTML has become increasingly patchy, with more and more developers using varying styles of code.

Additional online tools, such as Silverlight and Flex, create further complexity. The result is that HTML, and an associated collection of standards and tools, are fast becoming the new legacy.

Just as in the case of COBOL, more and more lines of code are being produced. The disparate pace of online development is such that we will end up with reams of legacy HTML, JavaScript and CSS code.

Learn from history and get to grips with the problem now. Make sure you have proper documentation and standards. Select tools that are integrated with the rest of your business processes and which allow users to make the most of earlier development projects.

Think about how certain approaches – such as a mix of HTML/JavaScript and Ajax-server based technologies – will allow your business, and even your end-users, to use the same development techniques on desktop and mobile environments.

Also look to the future and take a look at HTML5, which is currently under development as the next major revision of the HTML standard, including features that previously required third-party plug-ins, such as Flash. Don’t stop there carry on with CSS3, Web Worker and WebFonts all new evolutions of current web technologies that will tomorrow be mainstream.

The end result should be the end of fragmented development and a legacy of useful web applications, rather than unusable and unidentifiable code.
Further reading:

http://www.wired.com/thisdayintech/2010/05/0528cobol-conference/


Digg!

Fat client / Rich client / Mobile client

October 8, 2010

It’s a given that you’d better get online if you want to reach out to your customers. With more and more people having mobile access to the internet, firms need software that can help clients to interact on the move.

Step forward web-based rich internet applications (RIAs), which are online tools that have many of the features of their desktop counterparts. The use of RIAs date back a decade but their use continues to evolve.

As analyst Gartner concludes in respect to enterprise-level adoption (see further reading, below), RIA platforms are still in a dynamic and early adopter phase of market evolution. What is certain is that the RIA market is highly competitive.

 As well as the most distinct and prominent flavours, Apple pushes the use of its own software. Such divisions are inherent to the RIA market and competition is now taking a specific route.

 Most RIAs are splitting into two distinct groups: client technology, where a specific app – such as Silverlight or Flex – is installed into the client; or the server-based and Ajax route, where users only need a browser and no other client requirements.

 The distinction between the two approaches is such that Gartner considers Ajax and client-based RIAs as similar but separate technologies. Many firms choose to opt for the client approach – but for me, going with the client approach seems like a backwards step. It like we’re re-inventing the battle between desktop and browser apps, only this time both options are in the browser.

 First, users normally need to install a specific framework that executes the RIA before an application can launch. In Java-based alternatives like Ajax, there is no installation requirement – built-in browser functionality means required components are kept server-side.

 Second, the line between the desktop and the browser is blurring (see further reading). The browser is increasingly seen as the operating system, with individuals able to securely access social networking, music streaming and enterprise applications via the browser.

 Take note, however, that going for development via the browser is not a standalone decision. Businesses must also consider mobile development – and must avoid relying on a specific toolset for mobile development.

 Get the decision wrong and you can find your business in a similar platform-specific cul-de-sac, this time on the mobile rather than the desktop. By going with a mix of HTML/Javascript and Ajax-server based technologies, your business can use the same developers on desktop and mobile environments.

 HTML/Javascript and server-based Ajax is the route that will allow you to reach out to an increasingly mobile and browser-based audience. And in the future, it’s a combination that will help your business cope with the increasing range of screen sizes.

 Open source development frameworks like Rhodes and PhoneGap allow skilled web specialists to write once and deploy anywhere, creating mobile apps that have access to local device functions like camera, contacts and GPS.

 If you want to give your software the greatest reach, make sure your web-based developments take a direction that allows you to serve your savvy customers.

Further reading

 http://www.gartner.com/DisplayDocument?doc_cd=164266

 http://www.computerworlduk.com/TOOLBOX/OPEN-SOURCE/blogs/index.cfm?entryid=2389&blogid=22&tsb=comment


Digg!

User Experience Platforms (UXP)

April 22, 2010

The customer is definitely king. In this age of interactivity and engagement, businesses must work hard to ensure the demands of their clients’ – both internal and external – are met.

More providers and blue-chip businesses are therefore paying more attention to the user experience platform (UXP), a method for providing an open and intuitive access to information that puts the client first. Such a focus is more than overdue.

Analysts and the media have been expecting developments related to the UXP for a number of years. Back in 2005, an article in CIO magazine (see further reading, below) referred to the “Google Effect” – where web-based employees demand simple, satisfying and intuitive access to information.

Researcher IDC was already coining the phrase “user experience platform”, a fast-emerging area of development that aimed to improve the lives of information workers through the integration of existing intranets and transactional applications.

Back in 2010 and the reality hasn’t been quite as fast-emerging as might have been expected. Try a web search for “user experience platforms” and you’ll quickly see that the area is not that clearly defined.

While other buzz phrases – such as cloud computing and Web 2.0 – have an equally contested nature, they do at least garner a strong element of provider, media and end-user interest. Expect the pendulum to swing towards UXP in 2010.

Smart phones – the basic building blocks for the mobile UXP – currently account for 14% of overall mobile device sales, but Gartner expects they will make up around 37% of global handset sales by 2012.

Such growth means more providers will aim to enter the market to provide intuitive devices. For new entrants, Gartner suggests brand and user experience will be significant differentiators for mobile handsets.

Technology specialists are already beginning to take note and some are prioritising the phrase “user experience platform” in their information. Take Sony Ericsson, who recently announced that their forthcoming Xperia X10 handset has a new UXP that will provide an “open, human and intuitive experience”.

The Sony handset – like many others – is based on the Linux-based Google Android operating system. The platform promotes the open development of user-centred applications and Android will account for 14.5% of the worldwide smartphone market by year-end 2012.

The pendulum is already swinging towards open, intuitive access to mobile applications. Take steps to satisfy your users demands now and prioritise the UXP.

Further reading

http://www.cio.com/article/15817/Intranet_Trends_to_Watch_for_in_2006

http://www.technewsworld.com/story/68543.html


Digg!

Are desktop applications dead?

July 21, 2009

Last month, I wrote about the potential benefits of web browser based-computing. This month, I go further and explain why we should all turn to the web.
Sometimes providers might be slow to place enterprise software in the cloud, making it harder to convince your workers to use browser-based applications.
But just because it is harder, should we avoid browser-based software? Open, easily adaptable, easily accessible – what excuse is there for still using desktop apps?
When it comes to working online, workers have one big fear – losing connectivity. It is all well-and-good having network access but what is the point if you lose access and lose your information?
Google users discovered the annoyance that comes with losing access to online applications recently, when the provider’s popular Gmail software was unavailable for a few hours.
Such problems are not great, but what would you rather trust? Your own email application running on a small data centre, or Google’s Gmail service that is backed by the world’s biggest infrastructure?
Like problems with offline access, some users are often put off browser-based software because of security concerns. IT consultancy firm Avanade recently found that, by a 5-to-1 ratio, respondents trust existing internal systems over cloud-based systems.
But like concerns with online access, the hype surrounding security is often more significant than the real life problems. Providers specialising in cloud-based security make it their business to ensure information is protected.
Can you say the same for internal staff, many of who have other business priorities and could – either intentionally or unintentionally – leave the door open to your priceless information?
Finally, some IT leaders are put off by business economics. Why would you choose to use browser-based computing when there is a smaller range of applications to choose from?
Again, the theory is quickly becoming redundant. From Salesforce.com’s first foray into online software through to Google’s Premier version of its apps suite, IT leaders now have a broad range of online choices.
And the choices are only likely to become greater, as more providers start to push their software into a highly resilient cloud. Start looking at web-based options now – because the earlier you start analysing your options, the larger your competitive edge on your opposition

Further reading

Gmail offline for some users

http://news.bbc.co.uk/1/hi/technology/7934443.stm

Security concerns for cloud computing

http://www.computerweekly.com/Articles/2009/03/27/235439/security-concerns-for-cloud-computing.htm


Digg!

Twitter is the perfect mobile app

March 17, 2009

It’s been bubbling under the surface for a while, but now everyone is Twittering.

From Stephen Fry to Barack Obama, a roll call of famous and not-so-famous individuals are logging on to social networking site Twitter and providing a mini blog of their everyday lives.

With individuals choosing to communicate and break information on this fast-moving platform, Twitter could have significant implications for issues of accessibility and customer experience.

But as the media hypes Twitter within an inch of its life, let’s take a deeper look at this ‘latest and greatest information revolution’. The platform certainly provides a format for instant communication and collaboration.

But what’s really different about this application? Is the mix of updates and messaging anything different, or – more importantly – anything better?

Probably not, when used in isolation as a web-based application. Users update their profiles with 140 characters; it’s a concept that will already be familiar to Facebook users. The fast-paced mode of interaction between users, meanwhile, will be familiar to instant messaging addicts.

What is different is the potential portability of the application. Facebook is more than an update – it’s a portal for photos, games and comment. It’s also a portal best viewed through the desktop.

Depth also hamstrings other social software platforms, such as wikis and LinkedIn. Both formats provide a useful format for detailed knowledge and collaboration that is more easily viewed through the PC.

Twitter is different because it is best experienced as a mobile application. Specially-written APIs, such as TwitterMobile and TwitterBerry, allow users to receive updates on the move.

And because the format of Twitter is so simple, it’s convenient to view information and respond using mobile devices. Twitter is all about updates; it should be about the here and now of a specific moment in time.

More consumable than most blogs and social networks, Twitter is the perfect mobile app. In fact, why text when you can ‘direct message’ through Twitter and connect with a much broader range of contacts?

If the mobile is the future of the computer, then Twitter could be the social application of choice for a portable generation.

Think online and offline to avoid getting stuck in the clouds

October 20, 2008

The Telegraph Media Group (TMG) recently announced it is not refreshing its current Microsoft Office, Exchange and Windows XP deployment and is instead moving about 1,400 internal users to cloud-based service Google Apps.

TMG’s decision to move into cloud computing – where IT-related capabilities are provided using internet technologies – could be indicative of a sea change.

More IT managers are considering a similar transition to desktop provision through the cloud, where employees can access applications and information through internet-enabled devices. For IT managers looking to the cloud, is there any major difference between online and offline provision?

The key benefits of an off-the-shelf package are well-rehearsed. Most employees will have spent most of their working lives adapting or using standard Microsoft Office packages.

Standardisation promotes usability, with workers able to benefit from working with an accepted format for spreadsheets or written documents. Such usability has helped cement Microsoft’s desktop dominance – until now.

Where as IT managers would previously have shied away from change, most now realise that best value requires an innovative and transformative approach.

Google Apps, for example, encourages collaboration. Users are able to benefit from a broad suite of applications, sharing and creating knowledge documents attached in Google Mail.

Cost is also an important factor. The Premier Edition of Google’s desktop service offers low-cost licensing and technical support, with bugs fixed and patches updated automatically.

Problems associated to storage are also removed, as information is stored in the cloud, rather than on a firm’s own resource-hungry servers.

But such a method can bring security concerns. Storing information centrally means IT managers need to be aware of potential dangers and ensure workers are trained.

And while TMG’s move into the cloud shows a leading-edge stance, mass adoption will rely on providers – such as Google – ensuring online applications have a familiar feel and high-specification functionality.

Working in the cloud also means users will need 24/7 access to the internet. Look for a provider that can match your demands, allowing workers to use cloud-based tools offline – because a drop in service availability can have damaging effects on productivity.

While the world gets carried away with rich internet experiences through Ajax and Web 2.0, users must remember the browser also serves a meaningful life offline – as well as online.

Google’s approach shows how businesses can create applications, whether workers are connected or disconnected – which has to a useful trick in helping your firm to stay ahead of the game.

And moving from the tried-and-trusted into the clouds should be all about increasing efficiency.


Digg!

Endless options mean web development does not have to hit the rails

September 26, 2008

As I have stated before, better application interaction across different devices should be the web standard we all aim for.

However, progress has been sticky – and it can be difficult for users to access applications on different devices.

Standards such as XForms and WHATWG provide a step in the right direction, but are constrained by either the need for user plug-ins or the slow development of the framework.

So, how do alternative standards – such as JavaServer Faces (JSF) and Ruby on Rails (RoR) – provide more opportunities for creating web applications?

As its name suggests, JSF is Java-based – and its component-based framework aims to ease the development of user interfaces (UIs).

The approach allows the creation and re-use of specific components, promoting the quick and flexible development of web pages.

One of the other key benefits of JSF is the ability to work with a range of internet technologies. Particularly notable is the interaction with Ajax, which can help developer’s enrich JSF designs with Ajax-based components.

Work on the JSF specification continues apace and a series of big-name vendors are helping to push the development and adoption of the standard.

RoR – which is an open source framework for creating web applications – is also receiving an increasing amount of backing.

The framework intends to push agile programming, providing standard models for web site construction and the automatic allocation of information in databases.

Apple started shipping the framework in late 2007 and other firms continue to show an interest.

Microsoft, for example, recently announced plans to increase its commitment to Ruby. The Redmond-based software giant plans to take part in the RubySpec project, an attempt to provide a complete specification for the RoR programming language.

Such progress shows how developers do not need to feel constrained as they attempt to create usable web applications.

As my previous posts have aimed to highlight, the world of front-end development for SOA is a crowded place and each framework offers a unique blend of benefits and constraints.

My advice is simple. First, don’t re-invent the wheel – there is definitely an available framework that suits your needs, without having to create a presentation platform.

Second, take tour time before sourcing a solution. Look at all your presentation requirements across online and offline experiences, analyse support for devices and variations in presentation, and also investigate the skills you may – or may not have – in your organisation.

Just remember that the options are out most definitely out there.


Digg!