[albatross-users] Session management how-to?

Dave Kuhlman dkuhlman at cutter.rexx.com
Wed Jun 19 10:31:41 EST 2002


I'm groping my way through Albatross -- reading the doc, reading
the code, building sample apps.

Albatross looks very much like the kind tool that I'm looking for,
specifically a Web app server that can be used as a framework for
building more specialized  application servers.

However, I need a clue or two about how to manage sessions in a
session based application.  I'm using SimpleSessionFileApp and
SessionFileAppContext.  Since I'm using a page object application,
I've created a .py file with one class for each page.  So, I have
these questions:

1. How and where do I create a new session.  Do I need to? I'm
    guessing I should put that code in the class for the start
    page.  What code and where?  In the page_enter method?  In the
    page_process method?

2. How and where do I delete (remove?) a session.  I'm guessing I
    should put that code in the class for the last page of the
    application.  What code and where?  In the page_display method
    (and after ctx.run_template())?

3. And what does each page class need to do in order to ensure that
    it is using the correct session data/state for the current
    request?

What I'm looking for is something like the following:  If you want
to implement a application based on PageObjectMixin,
SimpleSessionFileApp, and SessionFileAppContext, then (1) create
the session by putting this code in the X method of the class for
the start page; (2) delete/remove the session by putting this code
in the Y method of the class for the last page; etc.

I need to understand the order and conditions under which page
object methods page_process, page_enter, page_leave, and
page_display are called.  Trace methods in my app and reading
section "4.1 Albatross Application Model" of the manual have me
less than enlightened.  Is there any place I can look for more
explanation on the processing model that Albatross follows?

Thanks in advance for help.

  - Dave


-- 
Dave Kuhlman
dkuhlman at rexx.com
http://www.rexx.com/~dkuhlman



More information about the Albatross-users mailing list