N tier web applications


Published on

VFP & Web n-tier session circa 2008

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

N tier web applications

  1. 1. Building n-Tier WebApplications with VFP Mike Feltman
  2. 2. About mePresident F1 TechnologiesDesigner/Lead Developer Visual FoxExpressFrameworkVery Experienced VFP Developer xBase Developer Since 1987 Fox Software Tech Support, Marketing & Development 1988-1990Moderately Experienced Web Developer Web Development Since 1994 ASP, Web Connection, AFP, JavaScript
  3. 3. AgendaSupply ListN-Tier Web ArchitectureModel View Controller Web ArchitectureInteracting with VFPGood JavaScriptBad JavaScriptIntroducing PrototypeAdding JavaScript with Prototype
  4. 4. Supply ListWeb Server  IIS (Internet Information Server)  ApacheHTML Editor  Standards: FrontPage, Dreamweaver, Visual Studio.NET, Microsoft Expression Web  Popular Low Cost Alternatives: HotDog, CoffeeCup  No-frills: Notepad, VFP  Barf Bag: WordVFP Compatible Server Side Scripting Language  Web Connection, Active FoxPro Pages (AFP) , FoxWeb or ActiveVFP  ASP, ASP.NET & COMJavascript Framework  Prototype (and many popular add-ons)  JQuery  DOJOJavaScript Debuggers  Firebug for Firefox  Debugbar for Internet Explorer
  5. 5. N-Tier Web ArchitectureUI HTML/XHTML (content) CSS (formattting) JavaScript w/ Prototype (behavior)Business VFP Objects for communicating between UI & DataData VFP Tables
  6. 6. Model-View-ControllerModel (The Data) VFP TablesView (The User Interface) HTML/XHTML (content) CSS (formattting) JavaScript w/ Protype (behavior)Controller (The Business Layer) JavaScript w/ Protype (plumbing) VFP Objects for communicating between UI & Data
  7. 7. Interacting with VFPWeb Connection & AFP are ISAPI ExtensionsWC & AFP files use <% and %> as scriptdelimitersVFP Code can fall anywhere within a web pagebetween delimitersClassic ASP is very similar except code isVBScript/Jscript that gets to VFP via COM.ASP.NET, PHP and other server platforms withCOM support can also talk to VFP
  8. 8. VFP DemosRendering an HTML TableRendering an HTML FormSaving with an HTML Form
  9. 9. “Good” JavaScriptPages should be functional w/oJavaScript. How much depends on yourrequirements. JavaScript is used toenhance functionality & improve the userexperience.Load JavaScript Last, after DOM isloaded.More difficult to write.Often requires writing it twice.
  10. 10. “Bad” JavaScriptPages require JavaScript to functionOk, when you control the browserBecoming more acceptable all the time.Easier to write.
  11. 11. Introducing PrototypeJavaScript FrameworkCross BrowserClass Based OOPAdvanced EventsAJAXImproved JSON Support
  12. 12. Case Study: St. Martin de PorresCurrent Site Wanted Outdated  Modern/Current Look & Ugly website Feel Static  Old Content to Expire Requires a “geek” to  New Content to be readily update it apparent Poorly maintained &  Consistent Look & Feel designed: ie bad layouts,  Real sense of community, little consistency interaction with the parish & outlying community  Maintained by Parish Personnel
  13. 13. SolutionVFP & AFP Data Driven Content Management System Classes Define different types of contentJavaScript with Prototype Dynamic Behavior Makes Site Easy To Use AJAX based data entry makes it easy for end- users to update site.
  14. 14. Adding JavaScript w/ ProtoType Prototype functions & objects  $  Ajax.Request UpdateContent Login (AJAX Form Submission)
  15. 15. More PrototypeTemplateJSONClassesEach
  16. 16. ResourcesPrototype: http://prototypejs.orgActive FoxProPages: http://afpages.com/Script.aculo.us: http://script.aculo.us/Prototype & script.aculo.us
  17. 17. SummarySeparation of Concerns makes morefunctional, easier to maintain websites.Prototype makes DOM programmingmuch easier, less stressful, faster andmore fun.VFP works well on the web.
  18. 18. Thank you!Remember to fill out your sessionevaluation.Session slides, white paper, and codesamples will be updated.