The Enterprise Web Framework

13
The Enterprise Web Framework Greg Smalter Red Stapler Software, LLC

description

The Enterprise Web Framework. Greg Smalter Red Stapler Software, LLC. What is EWF?. EWF, the Enterprise Web Framework, is an environment in which to build data-centric web apps in a consistent way. - PowerPoint PPT Presentation

Transcript of The Enterprise Web Framework

Page 1: The Enterprise Web Framework

The Enterprise Web Framework

Greg SmalterRed Stapler Software, LLC

Page 2: The Enterprise Web Framework

What is EWF?

EWF, the Enterprise Web Framework, is an environment in which to build data-centric web apps in a consistent way.

The theme of the framework is to make the tough decisions for developers and prevent tedious work.

As always, we want to catch as many errors as possible at compile time.

Page 3: The Enterprise Web Framework

Features

A new lifecycle An automatically-generated user

interface Strongly-typed navigation Auto data modification Concurrency conflict checking

Page 4: The Enterprise Web Framework

Motivation for a new lifecycle

The ‘put everything in page_load’ strategy does not work well.

Understanding when to use Init, Load, and PreRender is difficult.

We want to eliminate scattered ‘if (!IsPostBack)’ statements.

The tendency to rely on ViewState is problematic.

Page 5: The Enterprise Web Framework

The EWF lifecycle

Developers never implement Init, Load, or PreRender.

Instead, the lifecycle looks like this to the developer: LoadData ValidateFormValues ModifyData

Page 6: The Enterprise Web Framework

Diagram

Page 7: The Enterprise Web Framework

LoadData

Contains all logic not related to validation or data modification

Controls can be added dynamically here.

The values of all controls are populated here.

Page 8: The Enterprise Web Framework

ValidateFormValues

Is provided with a new Validator object

Uses the Validator’s built-in methods to do common validation and type conversion

If any validation errors exist in the Validator after the method executes, the framework automatically adds the error messages to the status area.

Page 9: The Enterprise Web Framework

ModifyData

Is only executed if ValidateFormValues resulted in no validation errors

Is provided with an open database connection in a transaction

Successful execution triggers a new lifecycle in order to load the newly-modified data.

Page 10: The Enterprise Web Framework

Automatic UI generation

Optional Uses the file system to make

inferences about site organization Developers add elements to

designated locations – the framework places the element

Page 11: The Enterprise Web Framework

Strongly-typed navigation

Bad links within your own site are no longer possible.

Query parameters are now strongly typed – no more string parsing.

Parameters can be passed at the entity level or at the page level.

Page 12: The Enterprise Web Framework

Auto data modification

Applied on a per-page basis - useful for common forms such as a personal information page

Pages that use this should behave like a piece of paper.

All data is persisted on any type of postback, including navigating away.

Unnecessary database interactions are avoided by change detection.

Page 13: The Enterprise Web Framework

Concurrency checking

Basic automatic conflict detection prevents overwriting another user’s changes, alerts users to concurrent modifications.

Requires no additional database interaction or extra developer code

Presents user with options for conflict resolution