Designers Challenge Preparing Applications for the Future Using

  • Slides: 21
Download presentation
Designer’s Challenge Preparing Applications for the Future Using MVC Concepts By Don Bakke President,

Designer’s Challenge Preparing Applications for the Future Using MVC Concepts By Don Bakke President, SRP Computer Solutions, Inc.

What is MVC? • At the very least it’s just another computer acronym…Model-View-Controller •

What is MVC? • At the very least it’s just another computer acronym…Model-View-Controller • It might be new to you but it’s been around for 30 years • In varying degrees it is probably something you are already doing but didn’t know it • But before we explain MVC any further…

Audience Poll • Who here already has been or will plan to integrate an

Audience Poll • Who here already has been or will plan to integrate an Open. Insight application with an alternative visual interface and/or with an alternative database server? • If you answered “yes” to this question then MVC should be of interest to you…

“The Shape of Things to Come” Percentage of Topics Related to Alternative Connections 40.

“The Shape of Things to Come” Percentage of Topics Related to Alternative Connections 40. 00% 35. 00% 30. 00% 25. 00% 20. 00% 15. 00% 10. 00% 5. 00% 0. 00% 2002 2004 2005 2007 2008 2010

Model-View-Controller – A Bit of History • Architectural pattern for designing software where an

Model-View-Controller – A Bit of History • Architectural pattern for designing software where an application is described in and designed in three separate layers: – Model = Relates to the application’s database and business logic – View = Relates to the application’s presentation of the data – Controller = Relates to the application’s flow and ties the other layers together • Generally assumes that application layers are loosely connected

Model-View-Controller – A Bit of History • Coined in the late 70’s and made

Model-View-Controller – A Bit of History • Coined in the late 70’s and made popular in the early 80’s with Smalltalk • Developed with Object Oriented technology in mind • Early versions assumed dumb clients • Spin-off versions include Model-View-Presenter, Model -View-Template, and Model-View. Model

Who Needs to Know MVC? • Anyone who needs to substitute or allow for

Who Needs to Know MVC? • Anyone who needs to substitute or allow for alternative layers with minimal code rewrite – Presentation layer - WPF, Flex, HTML, i. Phone, web. OS – Data layer - SQL, U 2, Amazon. S 3, Google App Engine (e. g. Cloud resources – Tom Wilson) – Leverage existing resources – Tom Wilson • Anyone who wants easier code management and documentation • Anyone who develops with teams who are focused on a specific layer of the application

Who Needs to Know MVC? • Anyone who wants better unit testing of their

Who Needs to Know MVC? • Anyone who wants better unit testing of their code • Anyone who wants more reusability of their code • Anyone who wants more scalability in their application • Ask a Java, PHP, Ruby, . NET, or Cocoa developer

Who Doesn’t Need to Know MVC? • Anyone who prefers a ‘git-r-done’ approach •

Who Doesn’t Need to Know MVC? • Anyone who prefers a ‘git-r-done’ approach • Anyone who never intends to work outside of Open. Insight

Model-View-Controller – A Closer Look • Disclaimers – I am not an MVC purist

Model-View-Controller – A Closer Look • Disclaimers – I am not an MVC purist or expert – Much of what I am presenting is a “work-inprogress” effort – While MVC philosophy is always the same, pundits will differ on how to apply it

Model-View-Controller – A Closer Look • Separation of Concerns (Layers) – Model API Events

Model-View-Controller – A Closer Look • Separation of Concerns (Layers) – Model API Events Requests – View Notifications View Controller Model – Controller API Results • Presents Data User Receivers. Data Userto Inputs Handles Responses • Handles Event Processing Calls Appropriate Resources Notifications Business Logic

Model-View-Controller vs. n-Tier Architecture View Presentation Tier Controller Model Logic Tier Business Logic Physical

Model-View-Controller vs. n-Tier Architecture View Presentation Tier Controller Model Logic Tier Business Logic Physical Data MVC Data Tier n-Tier

Amazon’s Shopping Cart

Amazon’s Shopping Cart

AREV

AREV

Open. Insight

Open. Insight

Flex - Form Design Courtesy of Clay Borne

Flex - Form Design Courtesy of Clay Borne

Calculate Shipping - Flowchart Start Have Zipcode? No Yes Set “Missing Zipcode” Error Shipping

Calculate Shipping - Flowchart Start Have Zipcode? No Yes Set “Missing Zipcode” Error Shipping Logic Return Shipping Costs Display Shipping Cost (Color Red if too much) Display Error End

MVC Examples – Side by Side Comparison Basic MVC Pure OI OI Form View

MVC Examples – Side by Side Comparison Basic MVC Pure OI OI Form View Controller Basic+ (Commuter) In Process Engine Basic + Model Linear Hash Basic+ (MFS) HTML / OI Flex / OI HTML Javascript Flex/Flash Action. Script OECGI/2 Basic+ Linear Hash Basic+ (MFS) OI/ SQL OI Form Basic+ (Commuter) In Process Engine Basic + SQL Basic+ or Direct

Final Thoughts • Don’t swallow the elephant – Take one bite at a time

Final Thoughts • Don’t swallow the elephant – Take one bite at a time – Translation: Don’t force yourself to convert everything to MVC. Ease into it • Don’t force a square peg in a round hole • Build a framework and standards to make this easier

Thank you Any Questions?

Thank you Any Questions?