CSP is similar to ASP in many respects, but there are some differences that you should be aware of. The most important difference lies in the notion of the Application and the Session. ASP supports the notion of both an Application
and a Session,
while Crystal Enterprise only supports the latter.
ASP supports the notion of an Application. The application is a global model, which is essentially stateless. This means that the application exists as long as the server does, or lets it. It applies to all users currently communicating with the server. To illustrate this notion with an example, consider an online shopping store. The store application keeps track of inventory, and when a purchase is made, it adjusts the inventory as required. It maintains a global state over all users; that is, if one user sees that there are forty pairs of shoes available for purchase, all other users should see the same thing.
CSP does not support this feature. Instead, it makes use of sessions, since these are more applicable to the Crystal Enterprise model. As well, CSP does not support the use of ASA files, which mostly apply to Applications.
The session does not maintain a global state. Rather, it maintains state for a particular user, and when that user is no longer communicating with the server, the session is destroyed. This is useful in that you can store information for each user independently, and easily. Consider the online shopping example once more. Imagine a feature that enables the user to add items to a shopping cart. Each user will have his or her own cart, and each cart will most likely be different. Things become easy in this case, however, when sessions are utilized as each user's individual settings are stored in the session object. Once the user leaves the web site, the session is no longer needed, and is destroyed. In the case of Crystal Enterprise, this is especially useful, as each user will be different from the next. An additional advantage of using sessions is that each session is independent, and has no knowledge of the active sessions. This means that there is no way one user could see the contents of another user's session.
There is one small difference in the way that ASP and CSP implement the Session
object. ASP keeps track of the Session
by storing a cookie that depends on the virtual directory in which the ASP file that created the Session
is stored. In this case, if the user navigates from a page in one virtual directory to another virtual directory, the session from the first directory will not be available. Since CSP implements the Session
differently, it is not restricted to virtual directories as mentioned in the above example.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |