PATH  WebObjects 4.0 Documentation > What's New in WebObjects 4.0

Table of Contents Previous Section

Comparison of Request Processing

The following table shows the sequence of events in processing a traditional, component action request and compares it to the sequence of events for processing a new direct action. Note that in both component actions and direct actions, the bulk of the time is spent in the generate response phase, in which the component performs appendToResponse:inContext: and sends each of its dynamic elements appendToResponse:inContext:. This step is the same in component actions and direct actions.
Component Action Direct Action
The adaptor creates a WORequest object and passes it to the application. The adaptor creates a WORequest object and passes it to the application.
The application determines that the WOComponentRequestHandler should handle the request. The application determines that the WODirectActionRequestHandler should handle the request.
The application, session, and the request component are created, if necessary, and sent the awake message. Application awake is called.
The takeValuesFromRequest:inContext: message is propagated from the application to the session to the request component to each dynamic element in the request component (if the request has input values). WODirectActionRequestHandler parses the URL and instantiates the WODirectAction class.
The invokeActionForRequest:inContext: message is propagated from the application to the session to the request component to each dynamic element in the request component, resulting in the appropriate action method in the component being invoked. WODirectActionRequestHandler sends the message performActionNamed: to the WODirectAction, resulting in the appropriate action being invoked. If there are any input values, WODirectAction uses takeFormValues... methods to extract them from the WORequest.
The action method creates and returns a response component or response. The action method creates and returns a response component or response.
The application awakens the response component. The appendToResponse:inContext: message is propagated from the application to the session to the response component to each dynamic element in the response component. The object returned by the action method is sent a generateResponse method to guarantee that the object returned is a WOResponse. If the action returns a WOComponent, WOComponent's generateResponse invokes appendToResponse:inContext:, which sends each dynamic element in the component an appendToResponse:inContext: message as well.
The application forwards the WOResponse to the adaptor. The application forwards the WOResponse to the adaptor.
The application, session, and all of the components are sent the sleep message. The WODirectAction is release or marked for garbage collection. Application sleep is called.
The component is saved in the session so it can handle any subsequent requests. If the returned component contained any component actions, the component is saved in the session so it can handle any subsequent requests.

Table of Contents Next Section