beautypg.com

Apple WebObjects 3.5 User Manual

Page 6

background image

vi

How WebObjects Works—A Class Perspective 72

Starting the Request-Response Loop 72

Taking Values From the Request 73

Accessing the Session 74

Creating or Restoring the Request Page 76

Assigning Input Values 78

Invoking an Action 79

Generating the Response 80

How HTML Pages Are Generated 82

Component Templates 82

Associations and the Current Component 84

Associations and Client-Side Java Components 85

Subcomponents and Component References 86

Part II

Special Tasks

Creating Reusable Components 91

Benefits of Reusable Components 93

Centralizing Application Resources 93

Simplifying Interfaces 96

Intercomponent Communication 98

Synchronizing Attributes in Parent and Child Components 102

Sharing Reusable Components Across Applications 104

Search Path for Reusable Components 105

Designing for Reusability 106

Managing State 109

Why Do You Need to Store State? 111

When Do You Need to Store State? 112

Objects and State 113

The Application Object and Application State 113

The Session Object and Session State 115

Component Objects and Component State 118

State Storage Strategies 120

Comparison of Storage Options 121

A Closer Look at Storage Strategies 122

State in the Server 123

State in the Page 124

State in Cookies 126

Custom State-Storage Options 128

Storing State for Custom Objects 131

Archiving Custom Objects in a Database Application 131

Archiving Custom Objects in Other Applications 132

Controlling Session State 133

Setting Session Time-Out 134

Using awake and sleep 135

Controlling Component State 135

Managing Component Resources 135

Adjusting the Page Cache Size 136

Using awake and sleep 137

pageWithName: and Page Caching 138

Client-Side Page Caching 139

Page Refresh and WODisplayGroup 140

Creating Client-Side Components 141

Choosing a Strategy 143

When You Have an Applet’s Source Code 144

When You Don’t Have an Applet’s Source Code 146

Deployment and Performance Issues 149

Recording Application Statistics 151

Maintaining a Log File 151

Accessing Statistics 152

Recording Extra Information 153

Error Handling 154

Automatically Terminating an Application 155

Performance Tips 156

Cache Component Definitions 156

Compile the Application 157

Control Memory Leaks 157

Limit State Storage 158

Limit Database Fetches 158

Limit Page Sizes 158

Installing Applications 159