COM and the Web Jim Fawcett CSE 791
COM and the Web Jim Fawcett CSE 791 – Distributed Objects Spring 2001
Web Programming Model n Web Programming supports distributed processing: n Client-side: n n XHTML, scripts, Active. X controls, Java Applets Server-side: n CGI (C, C++, Perl, …), ASP (Vbscript, Java. Script), ISAPI (C, C++)
Programming Models n Both browser and web-server support a programming model: n n n Browser – window/document/element Web Server – Request & Response objects In IE 5 and IIS the programming model is derived from a parse tree: n n IE 5 builds parse tree from XHTML elements. IIS builds parse tree from ASP pages and serverside scripts.
Powerful Programming Model n This is a very flexible, powerful model: n Can plug in reusable control components n n Support methods, properties, events Applications can support the browser and DHTML parser controls: n So both the application and the web page can determine what the user sees and how a user interacts with the system by interacting with the DHTML parse tree.
What does Control have to Provide? n To be hosted in a web page and communicate through events, the web page must: n n n Provide dispatch interfaces Provide connectable objects for each event type Implement IProvide. Class. Info 2 Implement IObject. Safety Provide property persistance n n Uses (parts of) structured storage All of these are supported with Impl classes in ATL
What does Web Page have to Provide? n n n Object tag with control GUID A script-based event handler Script-based calls to control’s methods Param tags to set properties Very little work for Web Page designer. A lot of work for the control designer.
DHTML Behaviors n The Browser model has been strengthened in IE 5. 5 by supporting behaviors: n A style-based subroutine that determines how a specific tag will behave.
Programming Model Again n This web programming model allows us to do some very interesting things: n We can build GUIs that the user can change easily, in some fundamental ways, if we base it on the web model, e. g. : n n An application that provides basic resources. Controls that provide reusable blocks of behavior n n n Controls can simply provide intricate behavior They can also bind to data sources, e. g. , xml or relational databases. A web page that binds to controls, sets styles and behaviors, and provides most of the content. n The user can control the GUI by modifying DHTML
- Slides: 25