Three options for Web Data Retrieval - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Three options for Web Data Retrieval

Description:

This presentation assumes you're familiar with DHTML and. JScript. ... DHTML Data Binding ... You need to use its DHTML ID to link to HTML elements. ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 28
Provided by: dinoes
Category:
Tags: data | dhtml | options | retrieval | three | web

less

Transcript and Presenter's Notes

Title: Three options for Web Data Retrieval


1
Three options for Web Data Retrieval
  • 3 technologies let you connect to remote data
    sources and invoke methods without leaving the
    current page.

Dino Esposito desposito_at_vb2themax.com
2
Agenda
  • Remote Scripting
  • DHTML Data Binding
  • Remote Data Services
  • Annotated Overview

This presentation assumes youre familiar with
DHTML and JScript. A knowledge of scriptlets
would help.
3
We have a problem...
  • Migrating the C/S metaphor to the world of Web.
  • Migrating a stateful metaphor to a stateless
    protocol such as HTTP.
  • Any request to the server means a new page to be
    sent to, and displayed by, the browser.

Reduce the traffic over the network, Simplify
state maintainance, Increase the responsiveness
of the application
4
We have a solution...
  • A typical schema that youve probably implemented
    countless times...

IIS
Default.asp
5
It has to be a better way...
  • A way in which you just issue remote calls, get
    the results and update the current page.

IIS
6
Remote Scripting
  • Library of script functions (mostly) based on
    JavaScript.
  • Lets you call public methods from an ASP page.
  • You can do that from either a client-side HTML
    page and another server-side ASP page.
  • Remote Scripting (RS) is included in Visual
    InterDev 6.0.

rs.htm Client-side proxy rs.asp Server-side
stub rsproxy.class Transportation layer
7
Using RS on the client
  • Initialize the RS engine by calling
    RSEnableRemoteScripting()
  • Include the rs.htm file in your page.
  • Call RSExecute() to invoke (sync/async) a remote
    method.
  • You are returned a structure with the return
    value and possible error messages.
  • You can get a local copy of the remote object.
    Object-based vs. Function based syntax.

8
Using RS on the client
lt!-- typical header for a RS-enabled HTML page
--gt ltBODYgt ltSCRIPT language"JavaScript"
src"http//expoware/_ScriptLibrary/rs.htm"gt lt/SCR
IPTgt ltSCRIPT language"JavaScript"gt
RSEnableRemoteScripting("http//expoware/_ScriptLi
brary") lt/SCRIPTgt function execSynch() var
co RSExecute(pageURL, "GetEmpInfoAsArray",
frm.empName1.value)
refreshPage(co)
aspObject RSGetASPObject(pageURL) function
execSync() var co aspObject.GetEmpInfoAsArr
ay(empName1.value)
9
Using RS on the server
  • Invoke the RS method dispatcher at the top of any
    ASP page RSDispatch.
  • Include the rs.asp file in your page.
  • Define a public interface for the functions
    externally callable
  • Such an interface is based on an object with a
    fixed name public_description. A JS or VBS 5.0
    class.

10
Using RS on the server
lt!-- typical header for a RS-enabled ASP page
--gt lt RSDispatch gt ltSCRIPT RUNATSERVER
languagejavascriptgt lt!--INCLUDE
VIRTUAL"/_ScriptLibrary/RS.ASP"--gt function
Description() this.GetEmpInfoAsArray
DoGetData public_description new
Description()
11
RS Architecture
IIS
12
RS in action
  • How to access the Employees table in the
    NorthWind database and display the data for a
    given employee.

13
Cross-browsing
  • RS is based on JavaScript
  • Uses a Java applet to communicate with the remote
    ASP page
  • It works on any Java/Javascript-enabled browser
    and any Web server that supports ASP

14
DHTML Data Binding
  • Supported by IE 4.0 and higher, data binding (DB)
    is the Web counterpart of Visual Basic's
    data-bound controls.
  • Data binding lets you bind a data source with one
    or more HTML tags on a page.
  • You dont have to take care of the connection or
    retrieving and marshaling a recordset.
  • The loading of the data is asynchronous.

15
Using Data-binding
  • You need to embed an ActiveX control to govern
    the operation. You need to use its DHTML ID to
    link to HTML elements.
  • For any tag to bind, specify the DATASRC and
    DATAFLD attributes. They link the element to a
    field in the data source.
  • You connect to a data source through the
    properties of the ActiveX control.

16
Using Data-binding
ltOBJECT style"displaynone" id"rds"
classid"clsidBD96C556-65A3-11D0-983A-00C04FC29E3
3"gt lt/OBJECTgt ltSPAN DATASRC"rds"
DATAFLD"employeeID"gtlt/SPANgt rds.Server
"http//expoware" rds.Connect "DSNNW"
rds.Sql select from employees"
17
Data-binding Architecture
ltobject idrds...gt lt/objectgt ltspan
datasrcrds datafldemployeeIDgt lt/spangt
18
Data-binding in action
  • Working with single tags
  • Working with HTML tables
  • Using a DHTML scriptlet to format a table
    on-the-fly
  • Access to any OLE-DB provider.

19
Remote Data Services
  • RDS comprehends a couple of controls that
    provides the third way to get data through the
    Web without leaving the current page
  • DataSpace, DataFactory
  • RDS issues calls to COM objects located on the
    Web server.
  • You need to know the progID of the object
  • RDS brings COM far beyond DCOM

20
How RDS works...
IIS
21
RDS in action
  • Using the DataSpace and the DataFactory objects
    to create remote HTTP-based instances of COM
    objects and get recordsets.

22
More on RDS
  • Youre still working over stateless protocol.
  • Any remote method invoked requires a new
    roundtrip.
  • Any state held between two calls, gets lost.
  • Design stateless components to work with RDS

23
Annotated Overview 1
  • Remote Scripting
  • ? Works with Netscape, ? Best with DHTML
  • No knowledge of COM required
  • Completely script-based
  • Object mirroring
  • Both synchronous and asynchronous calls
  • Require page modifications

24
Annotated Overview 2
  • Data Binding
  • ? Easy to use, ? Requires IE4
  • Not suitable if youre getting raw data to
    manipulate before displaying
  • Easy to componentize through DHTML Scriptlets
  • Allows local sorting and filtering
  • Allows raw text and HTML
  • Association between tags and data sources

25
Annotated Overview
  • RDS
  • ? Based on COM, ? Requires MDAC 2.1
  • Less page intrusive than RS or DB
  • Lets you think in terms of components
  • Part of the Microsoft Windows DNA
  • Doesnt allow asynchronous calls
  • Support HTTP and HTTPs

26
References
  • Remote Scripting
  • Cutting Edge, http//www.microsoft.com/mind
  • http//msdn.microsoft.com/scripting
  • http//msdn.microsoft.com/voices/scripting.asp
  • http//www.asptoday.com
  • DHTML Data Binding
  • Cutting Edge, http//www.microsoft.com/mind
  • http//www.asptoday.com
  • Remote Data Services
  • http//www.asptoday.com
  • Professional ADO RDS with ASP - Wrox Press

27
Q A
Write a Comment
User Comments (0)
About PowerShow.com