in reply to Re: why use OO nature in CGI?
in thread why use OO nature in CGI?
You mean HTML tag generation by functions/methods, instead of by embedded literal HTML?There's actually a third option that I prefer for HTML forms in particular: mutable widget objects that serialize to HTML (or XHTML) on request. The memory overhead of this approach is slightly higher than HTML-generator functions, but this is far outweighed by the increased flexibility and, most importantly, potential for reuse. Fields with input and output filters, auto-inflate/deflate of values, compound fields (single "logical" fields made up of multiple "physical" HTML fields), etc., all make dealing with large, complex forms so much easier, IME.
|
|---|