Application code, Session code – Apple WebObjects 3.5 User Manual
Page 23

The Ingredients of a WebObjects Application
23
Application Code
In addition to having one or more components, your application can also
include application code. In application code, you declare and initialize
application variables and perform tasks that affect the entire application.
The application code file is named Application and its extension is based on
the programming language you use to create it (
Application.wos
,
Application.java
, or
Application.m
).
Session Code
Sessions are periods during which one user is accessing your application.
Because users on different clients may be accessing your application at the
same time, a single application may have more than one session accessing it
at a time (see Figure 3). Each session has its own copy of the components
that its user has requested.
Figure 3.
Application, Sessions, and Components
You perform tasks that affect a single session and store variables that persist
throughout a session in the session code file. The session code file is named
Session and has the appropriate extension (
Session.wos
,
Session.java
, or
Session.m
).
A Note on WebObjects Classes
True to its name, WebObjects is an object-oriented environment for writing
web applications. Therefore, when you write a component, an application
file, or a session file, you are really writing a class. This is true whether you
use WebScript, Java, or Objective-C. You can learn about these classes and
application
component
session