Prev | Current Page 466 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

When a request is done without an action parameter or
with an action parameter with an invalid value, the view value is assumed by default.
The three actions are very intuitive: view will show the page content, edit will show a form to edit
the page content whereas save will store the content and show the newly modified page with a
save - confirmation message.
When you have to use a request, always assume that the sent information can be manipulated for
malicious intent; transforming the input parameters into an enum is a sure way to prevent errors and
unexpected results.
The WikiController.hx , located in the src directory, contains the definitions of the WikiController
class and of the RequestAction enumeration. Every text content has been assigned to a private static
variable. This is a good practice that makes life easier to the developer when he or she needs to change
242
Part II: Server Side, JavaScript, and Flash; Oh My!
some values at a later time because he won ??™ t have to scroll the whole code to find the spots to change
possibly forgetting some parts.


Pages:
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478