design based dev

73
Design-based Web Application Development: The Essential New Paradigm Rob Tweed M/Gateway Developments Ltd

Upload: rajivmordani

Post on 13-May-2015

677 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Design Based Dev

Design-based WebApplication Development:

The Essential New Paradigm

Rob TweedM/Gateway Developments Ltd

Page 2: Design Based Dev

Does this sound familiar..?

Page 3: Design Based Dev

Does this sound familiar..?

• Acting as advisor on web applications to adesign consultancy in London

• Won a project to develop a pilot forInternet shopping:– Major UK supermarket– Leading US-based IT vendor

• Recognised that success criticallydepended on design

Page 4: Design Based Dev

Does this sound familiar..?

• Lots of background design effort– Psychology of shopping– Physical versus virtual store layout

• Storyboard developed and accepted– Designers were competent with HTML/CSS

• Data model designed and accepted– Single A4 page

• So far, so good…

Page 5: Design Based Dev

Does this sound familiar..?

• Developing it as a web application wasbeyond the skills of the DesignConsultancy

• Brought in a team of programmers whospecialised in web applications

• The rot soon set in….

Page 6: Design Based Dev

Does this sound familiar..?

• Oracle data model expanded to a diagramthe size of the board-room table– Incomprehensible to all but the database guy

• Programmers produced a working version– But the code was un-recognisable

• “where’s our HTML gone?”– Could not be maintained by the designers

Page 7: Design Based Dev

Does this sound familiar..?

• From the moment the programmers wereinvolved, the Design Consultancy were outof the loop

• Project was in the hands of programmerswith no design skills

• Project extension:– Given to the software company– Design Consultancy frozen out– Project later crumbled and fizzled out

Page 8: Design Based Dev

When was this?

Page 9: Design Based Dev

When was this?

• 13 years ago, in 1995

Page 10: Design Based Dev

Would things be different today?

Page 11: Design Based Dev

Would things be different today?

• No

Page 12: Design Based Dev

It’s the single biggest problem inweb/Ajax application development

Page 13: Design Based Dev

Why is it a problem?

• What makes an application successful?• What differentiates:

– Poor applications?– Mediocre applications?– Great applications?

Page 14: Design Based Dev

Why is it a problem?

• What makes an application successful?• What differentiates:

– Poor applications?– Mediocre applications?– Great applications?

• It’s not the programming!

Page 15: Design Based Dev

Web Applications

• What makes an application successful?• What differentiates:

– Poor applications?– Mediocre applications?– Great applications?

• Answer: Design

Page 16: Design Based Dev

What’s the problem?

• Web Application Development:– Assumed to be a programming task– Not a design task

• Designers do not understand:– programming– databases

• After the initial design stage, the designer has norole in the rest of the development lifecycle

• Designs are easier to maintain than programs!

Page 17: Design Based Dev

The industry solution?• AjaxWorld: Yakov Fain (Farata Systems), Mar

30, 2008:– Do We Need to Teach Designers Programming?– “Adobe invited professors from different schools to

discuss what has to change in the curriculum ofVisual Design and Software Engineering disciplinesso designers can understand programming better andsoftware developers would be better at designing theuser experience”

– “Do we need to breed new creatures called d-e-s-i-g-n-o-p-e-r and d-e-v-i-g-n-e-r? “

– “Developers are from Mars; designers are fromVenus”

Page 18: Design Based Dev

The industry solution?

• There isn’t one

Page 19: Design Based Dev

Design-focusedWeb/Ajax Development

• So I’m going to propose a way forward– based on 13 years’ considering the problem– and 10 years’ providing a solution

• Let’s first understand why things are theway they are…..

Page 20: Design Based Dev

What are web Applications?

• Programs that:– Generate HTML– Are accessed via HTTP– And they access a database

Page 21: Design Based Dev

What are web Applications?

• Programs that:– Generate HTML– Are accessed via HTTP– And they access a database

• So they therefore require a programmer– Designers understand static HTML pages + CSS– Designers don’t understand programming– Designers don’t understand databases

Page 22: Design Based Dev

Why does it get so complex?

• The web was never designed as anapplication platform:– Stateless

• No concept of a meaningful ongoing dialoguebetween browser and web server

– HTTP protocol• Simple request/response protocol• Wide open, simple URL + name/value pair

structure• Inherently insecure and open to abuse

Page 23: Design Based Dev

Why does it get so complex?

• The browser only communicates with theweb server– The programs that process the requests and

generate the HTML responses are hooked inbehind the web servers

• The web pages are dynamically generatedby programs and content depends on:– What the user has done so far– The contents of the database

Page 24: Design Based Dev

Why does it get so complex?

• Programmer’s responsibility to:– Create the illusion of a session– Provide the navigation between generated

pages in response to user activity– Provide a consistent and adequate layer of

security around the URL requests within asession

Page 25: Design Based Dev

But we have frameworks don’t we?

• Rather than everyone re-inventing wheels,tools have developed that automate thesemechanisms

• Almost all are based on the concept of theModel View Controller (MVC)

Page 26: Design Based Dev

Web Application: MVC View

Web Page 1

Step 1:User decideswhat to do:

eg clicks button or link

Page 27: Design Based Dev

Web Application: MVC View

Web Page 1

Step 2:URL sent to

controller Controller

Page 28: Design Based Dev

Web Application: MVC View

Web Page 1

Step 3:URL analysedand mapped tocorrespondingbusiness logic

Controller Businesslogic

URL map

Page 29: Design Based Dev

Web Application: MVC View

Web Page 1

Step 4:Business logic

selects next view Controller Businesslogic

URL map

View

Database(model)

Page 30: Design Based Dev

Web Application: MVC View

Web Page 1

Step 5:View is

generated Controller Businesslogic

URL map

View

Web Page 2

Database(model)

Page 31: Design Based Dev

Web Application: MVC View

Web Page 2

Process repeats:User decideswhat to do:

eg clicks button or link

Page 32: Design Based Dev

Web Application: MVC View

• Web pages are programmatically-generated markup = the “view”

• The URL is the focus of attention• Closely reflects how it actually works

– Only a very slight level of abstraction• Totally programmer orientated paradigm

– Focuses on the how– The what and the design gets lost in a ton of

code

Page 33: Design Based Dev

Creating the “Eh?” Team

• In the MVC paradigm:– Designer storyboards the application– Design agreed– Handed over to programmers– From this point onwards, designer can no

longer participate in the life-cycle of theapplication

• What the programmers develop isincomprehensible

Page 34: Design Based Dev

• To make matters worse:

Page 35: Design Based Dev

Perpetuating the “Eh?” Team• Little discipline applied by MVC environment• MVC “plumbing” isn’t automated:

– How to submit, post and validate forms is left to eachprogrammer

– In-page coding is a free-for-all– Cut, paste and modify components

• 1 or more years later, nobody can understandtheir own code, let alone another developer’s– Quicker to rewrite pages than figure out how they

work

Page 36: Design Based Dev

So how do we solve this problem?

• Let’s stand back and look at what we’redoing…

Page 37: Design Based Dev

What are web applications?

• Programs that:– Generate HTML– Are accessed via HTTP– And they access a database

Page 38: Design Based Dev

What are web applications?

• Programs that:– Generate HTML– Are accessed via HTTP– And they access a database

• Right?

Page 39: Design Based Dev

What are web applications?

• Programs that:– Generate HTML– Are accessed via HTTP– And they access a database

• Right?– Yes of course they are in reality– But do we need to think of them in this way?

Page 40: Design Based Dev

What are web applications?

• Here’s another way to conceptualise them

Page 41: Design Based Dev

What are web applications?

• Here’s another way to conceptualise them• They are web pages:

– That have some content fetched from adatabase

– Whose flow between them is determined inpart by:

• the user’s interaction; and/or• content in the database

Page 42: Design Based Dev

“Static” web sites

Web Page 1NextPage Web Page 2

NextPage Web Page 3

NextPage

Page 43: Design Based Dev

Web Application

Web Page 1

From a designer’s point of view:

Database

Step 1:Run a method that

fetches the dataneeded for the page

fetchData()

Page 44: Design Based Dev

Web Application

Web Page 1

From a designer’s point of view:

Step 2:Display the

page

Page 45: Design Based Dev

Web Application

Web Page 1

From a designer’s point of view:

Step 3:User decideswhat to do:

eg clicks button or link

Page 46: Design Based Dev

Web Application

Web Page 1

From a designer’s point of view:

Database

Step 4:Method called that

validates and savesdata into database

saveData()

Page 47: Design Based Dev

Web Application

Web Page 1

From a designer’s point of view:

Step 5:Move to

next page

NextPage Web Page 2

Page 48: Design Based Dev

Web Application

From a designer’s point of view:

Repeat the process….

Web Page 2

Database

fetchData2()

Page 49: Design Based Dev

Web Application

From a designer’s point of view:

Web Page 1

Page 50: Design Based Dev

Design-focused Web Applications

• Page content and navigation is the primary focus– No programming code needed in pages

• “Fetch” method called when page loads• “Save” methods linked with user-triggered

events (eg submit buttons)• Technical stuff should “just work”:

– Invocation of methods– Orchestration of the MVC mechanics– Session and security management

Page 51: Design Based Dev

“Static” web sites

Web Page 1NextPage Web Page 2

NextPage Web Page 3

NextPage

Page 52: Design Based Dev

Web Page 1NextPage Web Page 2

NextPage Web Page 3

NextPage

Design-focused Web Applications

Database

fetch fetch fetchsave save save

Page 53: Design Based Dev

What about Ajax?

• Event-driven DOM manipulation:– replacement of innerHTML

• Page fragments– “pages” that just contain the replacement markup– fetch and save methods

• Just specify 3 key things:– Event– Page fragment name– Target Id

Page 54: Design Based Dev

Design-focused Ajax framework

ContainerPage

FetchMethod

State & Session Management

“Back-end” Server

“Front-end” technology (PHP, JSP, Python etc)

Page 55: Design Based Dev

Design-focused Ajax framework

ContainerPage

RequestPage

Fragment

Page Fragment

Event

Replaces DOM content

FetchMethod

State & Session Management

XMLHttpRequest

“Back-end” Server

Page 56: Design Based Dev

Design-focused Ajax framework

ContainerPage

RequestPage

Fragment

Page Fragment

Event

Replaces DOM content

FetchMethod

State & Session Management

“Back-end” Server

Page 57: Design Based Dev

Design-focused Ajax framework

ContainerPage

State & Session Management

“Back-end” Server

Page 58: Design Based Dev

Interfacing design and programming

• Clearly need a conceptual interfacethrough which the designer andprogrammer can inter-operate

• This is provided by the “Session” datastore

Page 59: Design Based Dev

The Session Interface

Web Page SessionData-store Database

Provides the interface between the designer and the programmer

Programmer

Using APIs providedby framework

Designer

Using specialsyntax to refer toSession values

Page 60: Design Based Dev

No data binding!

• Data binding is a scourge!– It begins with a blessing– But it ends in a curse

• The Session data-store de-couples thepage’s data from the physical database

Page 61: Design Based Dev

This changes everything

• Any designer who can design HTMLpages can be in control– Abstraction using additional “macro” XML tags– Describe what is required, not how to do it

• No coding apart from occasional, simple Javascript– Designer’s high-level pages compiled to

produce the how• Technology-independent• PHP, JSP, ASP.Net, Ruby, Python, etc

Page 62: Design Based Dev

This changes everything

• Transitions and method orchestration mustbe automated– Also session and security management

Page 63: Design Based Dev

This changes everything

• What’s left for a programmer is trivial:• Fetch• Save/validate

Page 64: Design Based Dev

Can this be done?

• Our Enterprise Web Developer (EWD)technology is built on these concepts

Page 65: Design Based Dev

Example: Ext-JS Grid

Page 66: Design Based Dev

Ext-JS Javascript version<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Array Grid Example</title><link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /><link rel="stylesheet" type="text/css" href="../../resources/css/xtheme-default.css" /><script type="text/javascript" src="../../adapter/ext/ext-base.js"></script><script type="text/javascript" src="../../ext-all.js"></script><script type="text/javascript" src="array-grid.js"></script><link rel="stylesheet" type="text/css" href="grid-examples.css" /><link rel="stylesheet" type="text/css" href="../shared/examples.css" /><script language="javascript">Ext.onReady(function(){

var store = new Ext.data.SimpleStore({ fields: [ {name: 'company'}, {name: 'price', type: 'float'}, {name: 'change', type: 'float'}, {name: 'pctChange', type: 'float'}, {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'} ] }); store.loadData(myData); var grid = new Ext.grid.GridPanel({ store: store, columns: [ {id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'}, {header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'}, {header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'}, {header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'}, {header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} ], stripeRows: true, autoExpandColumn: 'company', height:350, width:600, title:'Array Grid' }); grid.render('grid-example'); grid.getSelectionModel().selectFirstRow();});</script></head><body><h1>Array Grid Example</h1><div id="grid-example"></div></body></html>

Page 67: Design Based Dev

Ext-GWT (Java) version

Page 68: Design Based Dev

Ext-GWT (Java) version

column = new ColumnConfig(); column.setId("symbol"); column.setHeader("Symbol"); column.setWidth(100); configs.add(column); column = new ColumnConfig(); column.setId("last"); column.setHeader("Last"); column.setAlignment(HorizontalAlignment.RIGHT); column.setWidth(75); column.setRenderer(gridNumber); configs.add(column); column = new ColumnConfig("change", "Change", 100); column.setAlignment(HorizontalAlignment.RIGHT); column.setRenderer(change); configs.add(column); column = new ColumnConfig("date", "Last Updated", 100); column.setAlignment(HorizontalAlignment.RIGHT); column.setDateTimeFormat(DateTimeFormat.getShortDateFormat()); configs.add(column); ListStore<Stock> store = new ListStore<Stock>(); store.add(TestData.getStocks()); ColumnModel cm = new ColumnModel(configs); ContentPanel cp = new ContentPanel(); cp.setBodyBorder(false); cp.setHeading("Basic Grid"); cp.setButtonAlign(HorizontalAlignment.CENTER); cp.setLayout(new FitLayout()); cp.setSize(600, 300); Grid<Stock> grid = new Grid<Stock>(store, cm); grid.setStyleAttribute("borderTop", "none"); grid.setAutoExpandColumn("name"); grid.setBorders(true); cp.add(grid); add(cp); } }

package com.extjs.gxt.samples.client.examples.grid;

import java.util.ArrayList;import java.util.List;

import com.extjs.gxt.samples.resources.client.TestData;import com.extjs.gxt.samples.resources.client.model.Stock;import com.extjs.gxt.ui.client.Style.HorizontalAlignment;import com.extjs.gxt.ui.client.store.ListStore;import com.extjs.gxt.ui.client.widget.ContentPanel;import com.extjs.gxt.ui.client.widget.LayoutContainer;import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;import com.extjs.gxt.ui.client.widget.grid.ColumnData;import com.extjs.gxt.ui.client.widget.grid.ColumnModel;import com.extjs.gxt.ui.client.widget.grid.Grid;import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;import com.extjs.gxt.ui.client.widget.layout.FitLayout;import com.extjs.gxt.ui.client.widget.layout.FlowLayout;import com.extjs.gxt.ui.client.widget.table.NumberCellRenderer;import com.google.gwt.i18n.client.DateTimeFormat;import com.google.gwt.i18n.client.NumberFormat;

public class GridExample extends LayoutContainer {

public GridExample() { setLayout(new FlowLayout(10));

final NumberFormat currency = NumberFormat.getCurrencyFormat(); final NumberFormat number = NumberFormat.getFormat("0.00"); final NumberCellRenderer<Grid<Stock>> numberRenderer = new NumberCellRenderer<Grid<Stock>>( currency);

GridCellRenderer<Stock> change = new GridCellRenderer<Stock>() { public String render(Stock model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Stock> store) { double val = (Double)model.get(property); String style = val < 0 ? "red" : "green"; return "<span style='color:" + style + "'>" + number.format(val) + "</span>"; } };

GridCellRenderer<Stock> gridNumber = new GridCellRenderer<Stock>() { public String render(Stock model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Stock> store) { return numberRenderer.render(null, property, model.get(property)); } };

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig(); column.setId("name"); column.setHeader("Company"); column.setWidth(200); configs.add(column);

Page 69: Design Based Dev

Design-focused version

<ewd:config fetchMethod="ewd.test.getAJWGridData"><ext:config path="/ext-2.2" />

<html><head> <title>Design-focused Development: ExtJS Grid Examples</title></head><body>

<ext:grid datastore="stocks" title="Array Grid" stripeRows="true" autofill="false" width="600" height="350"> <ext:gridColumn header="Company" width="265" sortable="true" /> <ext:gridColumn header="Price" type="float" width="75" sortable="true" /> <ext:gridColumn header="Change" type="float" width="75" sortable="true" /> <ext:gridColumn header="% Change" type="float" width="75" sortable="true" /> <ext:gridColumn header="Last Updated" width="85" type="date" dateFormat="n/j h:ia" sortable="true" /></ext:grid>

</body></html>

Page 70: Design Based Dev

Design-focused version

<ewd:config fetchMethod="ewd.test.getAJWGridData"><ext:config path="/ext-2.2" />

<ewd:xhtml><head> <title>Design-focused Development: ExtJS Grid Examples</title><script language="javascript">function moveOn(currentRecord,currentRow) { var nvp="record=" + currentRecord ; ewd.ajaxRequest("myNextPage","myTargetDiv",nvp);}</script></head><body>

<ext:grid datastore="stocks" title="Array Grid" stripeRows="true" autofill="false" width="600" height="350“ onRowSelect="moveOn"> <ext:gridColumn header="Company" width="265" sortable="true" /> <ext:gridColumn header="Price" type="float" width="75" sortable="true" /> <ext:gridColumn header="Change" type="float" width="75" sortable="true" /> <ext:gridColumn header="% Change" type="float" width="75" sortable="true" /> <ext:gridColumn header="Last Updated" width="85" type="date" dateFormat="n/j h:ia" sortable="true" /></ext:grid>

</body></ewd:xhtml>

Ajax Navigation

•Event•Next Fragment•Target ID

Page 71: Design Based Dev

The “A” Team• Designer stays in control throughout the lifecyle• Designer doesn’t need to have any knowledge of

programming, business logic or databasestructure/content

• Programmer just focuses on business logic tofetch/validate/process/save data– doesn’t waste any time on the “plumbing”– Isolated from design issues– Standardised processes– Discipline occurs because it’s the line of least

resistance during development

Page 72: Design Based Dev

Design-focused Development• Proven benefits:

– Much higher productivity compared with conventionaltechniques

– Applications are focused on design requirements• designer retains control throughout the life-cycle

– Cuts out all the complexity of Ajax– Integrates with most UI/widget libraries

• Leverage “best of breed” instead of reinventing wheels– Significantly lower maintenance than conventional

techniques• Because you just describe the what, not the how• Build an “A” team, not an “eh?” team!

Page 73: Design Based Dev

Conclusions

• The programmer-focused approach hashad its day

• Design, not programming, must takecentre-stage

• None of the main industry players have asolution

• It’s not just theory• Come and see how it can be done!