Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dyalog’09. Overview of MildServer Morten Kromberg Dyalog’09 – Princeton, NJ.

Similar presentations


Presentation on theme: "Dyalog’09. Overview of MildServer Morten Kromberg Dyalog’09 – Princeton, NJ."— Presentation transcript:

1 Dyalog’09

2 Overview of MildServer Morten Kromberg Dyalog’09 – Princeton, NJ

3 Goals and Philosophy The goal is to make it possible for ”ordinary” APL developers to develop web pages The ”MildServer” is an experimental platform for this work. What’s the problem, anyway? MildServer OverviewDyalog’09 - Princeton3

4 What’s the Problem? POST /linreg.dyalog HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms- application, application/vnd.ms-xpsdocument, application/xaml+xml,... blah blah blah... Accept-Language: da Content-Type: multipart/form-data; boundary=---------------------------7d83002220638 UA-CPU: x86 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1;... blah blah... Content-Length: 2198 Connection: Keep-Alive Cache-Control: no-cache Cookie: UserId=mkrom; Session=dOiEkOvDgxAVdTpXZMRhpwCxpalFAI5p2pvbbhTHHAA= -----------------------------7d83002220638 Content-Disposition: form-data; name="Degree" 1 -----------------------------7d83002220638 Content-Disposition: form-data; name="X" 1 -----------------------------7d83002220638 Content-Disposition: form-data; name="Y" 2 MildServer OverviewDyalog’09 - Princeton4

5 The Desired Answer... HTTP/1.0 200 OK Content-Length: 2515 content-type: text/html; charset=utf-8 Demo Server Linear Regression Degree... 1 2 3... of polynomial MildServer OverviewDyalog’09 - Princeton5

6 What’s The Problem (again)? Decode the HTTP Headers and Data –Make data available to the application developer (Detect and) Manage ”Sessions”: Persistence of data from one request to the next –A ”Cookie” is a bit of data stored on your PC, which is transmitted to the server with every request –A session cookie tracks a user from one page to the next Provide Security: Identify the User and Restrict Access to parts of the Web Site Help the application developer generate HTML –And a bit later (perhaps), more complex controls MildServer OverviewDyalog’09 - Princeton6

7 BIG Thanks to ”WildHeart” I have been allowed to steal code from the ”WildServer” and other servers Stefano Lanzavecchia has built –(all the tricky bits about decoding HTTP!) WildServer is a more complete, ”more object- oriented” HTTP server developed by Stefano MildServer is Mortens ”watered down” environment ”Anyone who is able to write an APL function should be able to turn it into a web page” ™ MildServer OverviewDyalog’09 - Princeton7

8 A MildServer Page Each page is a class which must derive from MildPage It must have a public function called Render which takes an instance of HTTPRequest as its argument Render must end by calling one of: –Request.Return (HTML) –Request.ReturnFile (FileName) –Request.Fail (HTTPCode) MildServer OverviewDyalog’09 - Princeton8

9 Page Data For each user session, an instance of the page class is made (object orientation is a good tool for this ) If your page has Public Fields or Properties, MildServer will move data from the HTTP request into your page if the HTTP element has the same name Any data inside the instance will survive until the session ends (times out after inactivity or user LogOut) MildServer OverviewDyalog’09 - Princeton9

10 Page Data – Example... MildServer OverviewDyalog’09 - Princeton10

11 Source Code Management... MildServer is also a demonstration of the ”new way” of developing Dyalog applications ALL the code is in UTF-8 text files, managed by SALT (the Simple APL Library Toolkit) SubVersion (a free source code management system) is used to manage the source code It is available as a download from the APL Wiki This does not compromise the way that you develop APL applications at all... MildServer OverviewDyalog’09 - Princeton11

12 MildServer Components MildServer is a TCP/IP server which accepts connections, incoming data, and returns output HTTPRequest is a class which decodes an HTTP Request into APL data SimpleAuth is a basic security provider which uses the HTTP Challenge protocol based on XML input SimpleSessions is a simple cookie-based session manager which preserves application data for the duration of a session MildServer OverviewDyalog’09 - Princeton12

13 MildServer Configuration MildServer OverviewDyalog’09 - Princeton13

14 Open, Modular Design Note that the Session Handler and Authentication components are configurableSession Handler Authentication Each one is defined in a script file; you can enhance them or replace them Over time, more and more of the MildServer should become configurable The idea is that the community will build a more sophisticated shared web framework in APL MildServer OverviewDyalog’09 - Princeton14

15 My Own ”To Do” List Make HTMLInput Class ExtensibleHTMLInput Add optional Authentication HandlersAuthentication –Combine SSL and certificates with passwords –Provide a more elegant security plugin using an HTML subform rather than the HTTP Challenge protocol Error Logging and Reporting module prototypedError Logging Run MildServer as a Windows Service (autostart when Windows starts) MildServer OverviewDyalog’09 - Princeton15

16 Conclusion Proposition: –MildServer is sufficient for many ”simple” applications –Anyone who can write an APL function can implement a web site using MildServer –Scripted code does not compromise the ”APL Way” NO additional components needed (IIS/Apache) It is an experiment (but already in ”production” use in simple applications)... –Please take a look and comment, and contribute! MildServer OverviewDyalog’09 - Princeton16


Download ppt "Dyalog’09. Overview of MildServer Morten Kromberg Dyalog’09 – Princeton, NJ."

Similar presentations


Ads by Google