Vara Framework

40
VARA FRAMEWORK Introducing….

Transcript of Vara Framework

Page 1: Vara Framework

VARA FRAMEWORKIntroducing….

Page 2: Vara Framework

Agenda

Introduction

Benefits

Challenges

Demonstration

Next Steps

Page 3: Vara Framework

INTRODUCTION

Vara Framework

Page 4: Vara Framework

About Mike Merchant

12+ Years in Software Development

10 Years between KP and SCE

Developed or managed on 50+ projects

Experience in Flex, Java, .NET and others

Founder and President of MCW

Software, an RIA consulting firm in Lake

Forest, CA

Page 5: Vara Framework

Introduction

“What is this Vara Framework?”

– User workflow framework for Flex

– New architecture? New use of patterns?

– Based on concepts I’ve been thinking about

and working on for most of my software

development career

– Developed version for VB 6.0 around 2000

– Developed first Adobe Flex version last year

– Used and maintained by MCW Software

Page 6: Vara Framework

Introduction

“How come I’ve never heard of it?”

– This is the first time we have presented it

publicly (11/5/2009)

“Why should I care?”

– Vara makes building large-scale, enterprise

RIAs simpler, faster, easier to maintain, and

more consistent.

Page 7: Vara Framework

Observations

We are going to talk about CRUD

(a.k.a. Create, Read, Update, Delete)

Applications handle CRUD similarly

Forms should handle CRUD consistently

Applications tend to repeat this logic for

each and every screen

Logic is very difficult to abstract

Page 8: Vara Framework

Observations

Views have arbitrary complexity

Resources have arbitrary complexity

Mapping is usually not simple

Simple binding does not solve this

MVC does not go far enough

Page 9: Vara Framework

Observations

Any widely used frameworks that

concretely handle CRUD operations???

Desire for frameworks is NOT to dumb

down or eliminate the developer.

Desire for frameworks comes from being

pragmatic and the need to efficiently build

applications that are easily maintainable

and flexible.

Page 10: Vara Framework

Scenario #1: SDI Application

Assume we are building an application

that shows one employee form at a time

(i.e. single-document interface - SDI)

Open an employee record from a list

Make some changes

Open another employee record from list

What actions need to take place?

Page 11: Vara Framework

Scenario #1: SDI Application

Load new record…but wait…

Clear existing record…but wait...

Save existing record…but wait…

– Has existing record changed?

– Should the user be prompted to save changes?

– How did user respond to the prompt? Yes? No? Cancel?

– Is the data valid?

Page 12: Vara Framework

Scenario #1: SDI Application

Save existing record

– How to extract data to save from view?

– Where to send that data?

– Remote Object? Web Service?

– Was save successful?

– What to do after save? Update record in list?

Page 13: Vara Framework

Scenario #1: SDI Application

Clear existing record

– How do we reset the form?

– Do we need to clear the resource?

Load new record

– Where do we load from?

– How to populate the data onto the view?

– What to do after load?

Page 14: Vara Framework

Scenario #2: MDI Application

Assume we are building an application

that uses multiple employee form at a time

(i.e. multiple-document interface - MDI)

Open an employee record from list

Make some changes

Close the form

Page 15: Vara Framework

Scenario #2: MDI Application

Close form… but wait…

Clear form… but wait...

Save existing record…but wait…– Has existing record changed?

– Should the user be prompted to save changes?

– How did user respond to the prompt? Yes? No? Cancel?

– Is the data valid?

Save record– How to extract data to save from view?

– Where to send that data?

– Remote Object? Web Service?

– Was save successful?

– What to do after save? Update record in list?

Clear record– How do we reset the form?

– Do we need to clear the resource?

Close form

Page 16: Vara Framework

Scenario #3: PITA Application

Write an application that has 100 data

entry forms of arbitrary complexity

(trees, tabs, data grids, file

uploads, custom components, etc.)

Handle the

loading, saving, closing, deleting, promptin

g, and validation consistently throughout

the application

Page 17: Vara Framework

Scenario #3: PITA Application

3 months into PITA project….

PITA Boss read usability study about benefits of single-document interfaces (SDI)

He wants you to convert those screens from MDI to SDI

He also wants prompting to occur only if the user has actually changed the record

Due to budget constraints, the timeline needs to be reduced

Page 18: Vara Framework

Core Ideas of Vara

Developer should be able to handle…

– Design and development of views

– Selection and development of resources

– View/Model interaction

– Resource/Model interaction

– User prompting

Page 19: Vara Framework

Core Ideas of Vara

Actions always occur in a certain order

Top-level action can start other actions

Workflow can orchestrate these actions

Common workflow can be provided

Interact with developer’s code in order to

manage the views and resources

Page 20: Vara Framework

Flex Application

Flex MVC Architectures

User Interface

Services

MiddlewareBusiness Logic

Data Access

Database Database

Layers

Network

Page 21: Vara Framework

Resource

Flex Application

Flex MVC Architectures

User Interface

Services

Business Logic

Data Access

Database

Layers

Page 22: Vara Framework

Resource

Flex MVC Architectures

User Interface

Services

Business Logic

Data Access

Database

Layers

View

ModelController

What about the resource?

Page 23: Vara Framework

Vara Framework

Vara Architecture

View

Resource

Model

Created by DeveloperProvided by Framework

Page 24: Vara Framework

Vara Architecture

View

Resource

View Adapter Implementation

Resource Adapter Implementation

Work

flow

Initialize

Load

Clear

Save

Unload

Close

Actions

Model

Vie

w

Ad

ap

ter

Reso

urc

e

Ad

ap

ter

Created by DeveloperProvided by Framework

Page 25: Vara Framework

Vara Workflow Actions

Load

Clear

Save

UnloadClose

Initialize

Destroy

Generic

Page 26: Vara Framework

Steps to Implement Vara

Step 1: Include Vara.swc in Flex project

Step 2: Create View Adapter class

Step 3: Create Resource Adapter class

Step 4: Declare BasicWorkflowImpl

Step 5: Add calls to xxxxAction.start()

Step 6: Override adapters as needed

Page 27: Vara Framework

Step 1: Include Vara.swc

Page 28: Vara Framework

Step 2: Create View Adapter

Step 3: Create Resource Adapter

Page 29: Vara Framework

Step 4: Declare Workflow

Page 30: Vara Framework

Step 5: Add action calls

Page 31: Vara Framework

Step 6: Override as needed

AdapterImpl

ViewAdapterImpl

Developer extends and overrides…Vara provides…

Page 32: Vara Framework

Summary

Page 33: Vara Framework

BENEFITS

Vara Framework

Page 34: Vara Framework

Benefits

Consistent handling of user workflow

across an application

Makes applications easier to maintain

Speeds up coding by reducing duplication

Increases flexibility and agility in

responding to customers demands

Page 35: Vara Framework

CHALLENGES

Vara Framework

Page 36: Vara Framework

Challenges

Remember Flex applications are

single-threaded and asynchronous

Remember to call proceed()

Integration with other frameworks?

Dependency injection

More use of event handling

Enable more modularity

Page 37: Vara Framework

DEMONSTRATION

Vara Framework

Page 38: Vara Framework

Demonstration

Download samples.zip from SourceForgehttps://sourceforge.net/projects/vara/files/Downloads/samples.zip/download

Page 39: Vara Framework

NEXT STEPS

Vara Framework

Page 40: Vara Framework

Next Steps

Download the SWC:https://sourceforge.net/projects/vara/files/Downloads/Vara.swc/download

Download the source (SVN):https://sourceforge.net/projects/vara/develop

Join the discussion:https://sourceforge.net/projects/vara/forums/forum/1032315