dcsimg
Linux Today: Linux News On Internet Time.




More on LinuxToday


Linux.com: Unix Web Application Architectures - Part 4: Other Issues

Oct 01, 2000, 18:54 (0 Talkback[s])
(Other stories by Samuli Kärkkäinen)

WEBINAR:
On-Demand

Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers


"I think of Web apps as a group of functions, each of which receives zero or more parameters. Each function implements a different page or operation in the application. Let's say we are using plain CGI, and calling function delete_user with parameter username=johndoe, with session carried in parameters. The HTTP request could then be http://www.foo.com/cgi-bin/delete_user?s=987654321&username=johndoe. I'll talk about a function call when there is a link to some function, a function is the target of a form's ACTION attribute or similar."

"There is no standard mechanism for making sure that each function is called with correct set of parameters, whose format is as expected. To use an analogy to traditional programming, there is no standard way of giving a prototype for functions. I consider it important that this checking is done for all functions. Some people may find such a requirement a hindrance, but long term advantages are often acquired by doing more work in the short term."

"For example, functions pointed to by an ACTION attribute of a form may receive a large number of parameters, namely the values of the form's INPUT elements. In this situation, it's only a matter of time when there occurs a mismatch between what the function expects and the +parameters with which it is called. Even when calling a function with few parameters, it is easy to make a typo or to fail to encode the parameters properly."

Complete Story

Related Stories: