PostNuke

Flexible Content Management System

News

pnMeeting 2007: Frank Schummertz ports a module to .8 style

Contributed by on Sep 08, 2007 - 07:52 PM

Frank's first example regards the use of DBUtil instead of the usual SQL code. DBUtil reduced the amount of lines of code by 60% and at the same time made all calls trans database compatible. Less lines of code reduce also the risk of errors. And Frank presented the way the result of the SELECT gets filtered through the permissions which is also done in a few standard lines of code.



Of course Formicula 2.0 makes use of pnForms. This reduces for example the edit function for the contacts to 3 lines of code plus the few lines that build the form and automatically validate the inputs. The programmer doesn't have to handle all kinds of wrong inputs - that is all done by the the forms API. The module will only receive validated values.



In a general overview Frank picked out single lines of code from Formicula and pointed out the differences to .7 - Among others were the use of the LogUtil with takes care of occurring errors and the fact that the pnRender object now has a parameter for disabling the caching.



Frank emphasized the fact that the correct use of all .8 APIs reduce the size of a module by 30-50%.
743