11.03.2015 Views

Unicon Book

Unicon Book

Unicon Book

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

vi<br />

CONTENTS<br />

11.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196<br />

12 Writing Large Programs 197<br />

12.1 Abstract Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197<br />

12.2 Design Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198<br />

12.2.1 Singleton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199<br />

12.2.2 Proxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199<br />

12.2.3 Chain of responsibility . . . . . . . . . . . . . . . . . . . . . . . . . . 201<br />

12.2.4 Visitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202<br />

12.3 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204<br />

12.3.1 The package declaration . . . . . . . . . . . . . . . . . . . . . . . . . 204<br />

12.3.2 The import declaration . . . . . . . . . . . . . . . . . . . . . . . . . . 205<br />

12.3.3 Explicit package references . . . . . . . . . . . . . . . . . . . . . . . . 205<br />

12.3.4 Name conflicts and name mangling . . . . . . . . . . . . . . . . . . . 206<br />

12.3.5 Compilation order and the unidep tool . . . . . . . . . . . . . . . . . 206<br />

12.4 HTML documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207<br />

12.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208<br />

13 Use Cases and Supplemental UML Diagrams 209<br />

13.1 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210<br />

13.1.1 Use case diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211<br />

13.1.2 Use case descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 212<br />

13.2 Statechart Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213<br />

13.2.1 Events and conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 214<br />

13.2.2 Actions and activities . . . . . . . . . . . . . . . . . . . . . . . . . . . 214<br />

13.3 Collaboration Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215<br />

13.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216<br />

III Example Applications 217<br />

14 CGI Scripts 219<br />

14.1 Introduction to CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219<br />

14.1.1 Organization of a CGI script . . . . . . . . . . . . . . . . . . . . . . . 220<br />

14.1.2 Processing input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220<br />

14.1.3 Processing output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221<br />

14.1.4 Common CGI environment variables . . . . . . . . . . . . . . . . . . 221<br />

14.2 The CGI Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . 222<br />

14.3 An Example HTML Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223<br />

14.4 An Example CGI Script: Echoing the User’s Input . . . . . . . . . . . . . . 225<br />

14.5 Debugging CGI Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!