1 / 25

Web Development Tools

Web Development Tools. 6.916 Lecture Thursday, October 19, 2000 Jim Miller (Microsoft). Web Site Review. Design HTML Decide where it’s not static Write code to parse incoming URL Write code to generate HTML page If you need state, use a data base If you need session state ...

Download Presentation

Web Development Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Development Tools 6.916 Lecture Thursday, October 19, 2000 Jim Miller (Microsoft)

  2. Web Site Review • Design HTML • Decide where it’s not static • Write code to parse incoming URL • Write code to generate HTML page • If you need state, use a data base • If you need session state ... • … use a cookie (client side)? • … encode in URL? • … store in data base, use URL (server side)

  3. ? What’s the Structure? Browser Shopping Service Supplier 1 HTTP / HTML Supplier 2 Idea:A Web Service is a Web site that provides a programmatic interface. Customer Data and Credentials Supplier 3 Merchandise, Prices, and Discounts

  4. Web Service Review Service Side • Write the service code • Expects SOAP as input • Define the externally visible methods • Create the WSDL description of those methods • Publish the WSDL • Run the service Client Side • Locate the WSDL • Load the WSDL • Convert to a client proxy • Write the client code, calling proxy • Generates and sends SOAP

  5. How Do You Find a Web Service? • Use the Web – someone ought to build a portal • Ask a Server – someone ought to standardize a “request for service description” • Provide a “well-known Web Service” • “Portal for programs, not people” • Categorize services • Who decides the categories • Can a service be in multiple categories? • What about business arrangements? • Take a look at http://uddi.org

  6. What About the Client? • Use a browser • “just” HTML • client-side scripts • download “controls” • Write a custom application • Use HTTP to connect • Use HTML, XML, SOAP, etc. as payload • Communicate via “side channel” to other sources

  7. Isn’t This Complicated? • Why not separate HTML from code? • Why not program in your favorite language, or languages? • Why not have rich, programmable tags? • Why write the WSDL at all? • Why not program with objects instead of SOAP strings? • What about multiple clients? • Isn’t it a pain to write separate code for each kind? • But doesn’t it look ugly and run slow if you don’t? • …and what about “odd” devices like cell phones

  8. Trivial Web Page Demo • You all know how to do this -- http://localhost/jsm.aspx • Let’s see how it looks in ASP.NET … • It would look the same even for a cell phone • I didn’t write any state maintenance code • From my point of view, there are just objects with state • Behind the scenes, of course, it’s the same old stuff… • I’ve combined the HTML and script code, but that’s not necessary and isn’t a good idea for large Web sites

  9. Trivial Page (HTML) <html> <body> <center> <form method="post" runat="server"> Type your first and last name: <asp:textbox id="Name" runat="server"/> <asp:button type=submit text="Hello" OnClick="SubmitBtn_Click“ runat="server"/> <BR> <asp:label id="FirstName" runat="server"/> <BR> <asp:label id="LastName" runat="server"/> <p> </form> </center> </body> ... See next slide

  10. Trivial Page (Script) <script language="C#" runat=server> void SubmitBtn_Click(Object sender, EventArgs e) { String[] Parts = Name.Text.Split(new char [] {' '}); FirstName.Text = "First name: " + Parts[0]; LastName.Text = "Last name: "; for (int i=1; i < Parts.Length; i++) LastName.Text += Parts[i]; } </script> </html>

  11. What’s This <asp: Stuff? • ASP.NET is a Web server, the successor to ASP • Basic model is static pages • Instructions to the server are embedded in HTML • <asp: … runat=server> indicates a “server-side control” • Tests for client, generates either HTML or DHTML or WAP or … • Programmable in two ways • Via the HTML • Via programs in any number of languages, appearing as objects (with fields, methods, state, and attributes) • While Microsoft ships a large number of these “server controls” • All the APIs to do it are public • We ship several source code samples • We want to start a market for third party controls

  12. Documentation on Label <asp:label id="FirstName" runat="server"/> FirstName.Text = "First name: " + Parts[0];

  13. How Does Scripting Work? • We don’t want to restrict the choice of language • We don’t want to restrict the operations available on the embedded controls • We want a rich set of operations with default behavior • ASP.Net defines • An object model for Web pages • An object model for Web controls • An object model for plugging in languages • Underneath, there’s a Common Language Runtime

  14. Common Language Runtime Frameworks Base Classes Common Language Runtime ExecutionSupport Security IL to native code compilers GC, stack walk, code manager Class loader and layout

  15. Execution Model VB VC ... Script NativeCode Install timeCode Gen IL Common Language Runtime “Econo”-JITCompiler Standard JITCompiler NativeCode

  16. Key to simpler programming model Generated automatically Stored with code in executable file (.dll or .exe) Uses existing COFF format Via existing extension mechanism Stored in binary format Convertible to/from XML Schema Convertible to/from COM type libraries Metadata

  17. What’s In The Metadata • Description of deployment unit (assembly) • Identity: name, version, culture[, public key] • What types are exported • What other assemblies it depends on • Security permissions needed to run • Description of types • Name, visibility, base class, interfaces implemented • Members (methods, fields, properties, events, nested types) • Custom attributes • User-defined • Compiler-defined • Framework-defined

  18. Metadata: Creation And Use Reflection Source Code Serialization (e.g. SOAP) Designers Compiler Other Compiler Debugger Metadata (and code) Type Browser Profiler Proxy Generator Schema Generator XML encoding (SDL or SUDS)

  19. Runtime Control Flow Assembly ClassLoader First reference to type IL to nativecode compiler ExecutionSupport ManagedNativeCode First call to method CodeManagers SecuritySystem CPU

  20. Compiling IL To Native • “Econo” JIT • Generates unoptimized native code • Code can be discarded and regenerated • “Standard” JIT • Generates optimized native code • Includes verification of IL code • Install time code generation • Done at install time • Reduces start-up time • Native code has version checks and reverts to runtime JIT if they fail

  21. Managed Code • Managed code provides... • Metadata describing data • Location of references to objects • Exception handling tables • So runtime can provide… • Exception handling • Security • Automatic lifetime management • Debugging and profiling

  22. Managed Data • Layout Provided by Runtime • Usually automatic • Metadata can specify • Order • Packing • Explicit layout • Lifetime Managed by Runtime (GC) • Working set is compacted • Data is moved • Object references are updated • No more intrusive than a page fault

  23. Calling Unmanaged Code Unmanaged NativeCode Common Language Runtime “Econo”-JITCompiler Standard JITCompiler Managed NativeCode

  24. Crossing The Boundary • Mode transition for code manager • Calling conventions differ on x86 • Fast, rarely more than register shuffle • Data type marshalling • Representations may not be the same • Pinning, copying, and/or reformatting needed • Custom marshalling supported • The IL to native compilers help • In-line code transition and simple marshalling • Per call site cost is very low • Plus a small cost on entry to a procedure that can make calls across boundary

  25. What’s Really Happening • When ASP.Net notices a new page, it calls the appropriate compiler to generate IL and metadata • The IL is compiled to native code • The native code runs • In addition to the regular URL there is a query form used to retrieve the WSDL • When the WSDL is requested the metadata is converted to WSDL, cached, and returned • There are tools that convert WSDL into proxy programs so clients can access the service • When SOAP is sent to the service, it is converted to objects as described in the WSDL and passed to the service code

More Related