Vara Framework
-
Upload
mike-merchant -
Category
Technology
-
view
530 -
download
3
Transcript of Vara Framework
VARA FRAMEWORKIntroducing….
Agenda
Introduction
Benefits
Challenges
Demonstration
Next Steps
INTRODUCTION
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
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
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.
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
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
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.
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?
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?
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?
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?
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
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
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
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
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
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
Flex Application
Flex MVC Architectures
User Interface
Services
MiddlewareBusiness Logic
Data Access
Database Database
Layers
Network
Resource
Flex Application
Flex MVC Architectures
User Interface
Services
Business Logic
Data Access
Database
Layers
Resource
Flex MVC Architectures
User Interface
Services
Business Logic
Data Access
Database
Layers
View
ModelController
What about the resource?
Vara Framework
Vara Architecture
View
Resource
Model
Created by DeveloperProvided by 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
Vara Workflow Actions
Load
Clear
Save
UnloadClose
Initialize
Destroy
Generic
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
Step 1: Include Vara.swc
Step 2: Create View Adapter
Step 3: Create Resource Adapter
Step 4: Declare Workflow
Step 5: Add action calls
Step 6: Override as needed
AdapterImpl
ViewAdapterImpl
Developer extends and overrides…Vara provides…
Summary
BENEFITS
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
CHALLENGES
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
DEMONSTRATION
Vara Framework
Demonstration
Download samples.zip from SourceForgehttps://sourceforge.net/projects/vara/files/Downloads/samples.zip/download
NEXT STEPS
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