SAGE Computing Services Consulting and customised training workshops Best Practices in Apex Development Penny Cookson Managing Director www.sagecomputing.com.au Agenda Managing Workspaces TTeemmppllaatteess Where to put your code Security Documentingg an Appex apppplication Tips and techniques www.sagecomputing.com.au Designing the Workspace Structure Single workspace Multiple workspaces wiitthh llotts off wiitthh smallll numbbers applications? of applications? Which developers will work on the aapppplliiccaattiioonnss?? What schemas do the applications aacccceessss?? Do I need to subscribe to objects in a ddiiffffeerreenntt aapppplliiccaattiioonn?? www.sagecomputing.com.au Recommendations on Naming Standards Have Them www.sagecomputing.com.au Naming Standards Keep default names for page items where possible, i.e. Pn_COLUMNNAME Additional display information use Pn_CONTENTNAME or Pn_CONTENTNAME_DISP AApppplliiccaattiioonn iitteemmss FF_NNAAMMEE oorr AAPPPP_NNAAMMEE Meaningful name for Page Validations, e.g checkdates, validate_mandatoryy_items Meaningful name for Page Processes, e.g check _dependencies, clear_state, create_event Meaningful name for Application Processes, e.g app_check _dependencies, app_clear_state, apppp_create_event www.sagecomputing.com.au Naming Standards Meaningful name for Page Computations, that indicates the item being set Meaningful name for Application Computations, that indicates the item being set, e.g set_surname, sseett_ff_ttoottaall, sseett_aapppp_ccuurrrreenntt_iidd, ee.gg sseett_ssuurrnnaammee, set_total Name Lists of Values for the information being fetched, e.g. ORGANISATIONS_LOV, or if the LOV is for a specific page, ORGANISATIONS_P415_LOV UUssee aa ssttaannddaarrdd aalliiaass ffoorr aann aapppplliiccaattiioonn, ee.gg. TTMM ffoorr tthhee timesheet, this can also be used as a prefix to the names of database packages Give each page an alias www.sagecomputing.com.au Some Obvious Stuff Use the Wizards where possible GGoo wwiitthh tthhee pprroodduucctt Do not hard code formatting attributes NNeevveerr rreeffeerreennccee aann aapppplliiccaattiioonn iidd http://server:port/pls/apex/f?p=TS:CAL:&SESSION.::::: DDoo nnoott cchhaannggee OOrraaccllee templates/stylesheets/JavaScript files DDeessiiggnnaattee rraannggeess ooff ppaaggeess ffoorr ffuunnccttiioonnaall aarreeaass ooff the application NNuummbbeerr eevveerryytthhiinngg iinn iinnccrreemmeennttss >> 11 Generate DML using Object Browser www.sagecomputing.com.au UI Defaults Define UI Defaults before creating any ppaaggeess Initial creation only in 3.2 BBii ddiirectiionall iin 44.00 www.sagecomputing.com.au Where to Put your Code In a central location where it can get mmaaxxiimmuumm rreeuussee In a location that makes application mmaaiinntteennaannccee aass eeaassyy aass ppoossssiibbllee As close as possible to the location where thhe codde wiillll bbe executedd www.sagecomputing.com.au Where Code Will be Executed Externally ee.gg WWeebb SSeerrvviiccee JavaScript PL/SQL in iinn tthhee cclliieenntt tthhee SSeerrvveerr browser Apex Custom AAppeex ccooddee codde packkages Custom JJavaSScriiptt www.sagecomputing.com.au
Description: