Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Build Joomla! businessapps with ChronoForms                 Russell Searle                 19 Jan 2013
Introduction     • Introduction     • Requirements     • Analysis and modelling     • Design     • Development     • Testi...
Why build business apps?• Businesses automate and connect business processes ->    significant cost reductions = improve p...
Elements of business apps  Feature       ChronoForms product  Forms         ChronoForms  Views         ChronoConnectivity ...
ChronoForms product range• ChronoForms  • Builds chainable CRUD forms for any data  • Simple form controls, rich set of ac...
ChronoForms features• Drag and drop form builder• Wizards for basic and complex forms• Basic set of configurable input ele...
Two types of forms CCK• “Vertical” data organisation   • Multiple physical records per logical record   • Fixed table and ...
Two types of forms CCK• “Horizontal” data organisation   • One physical record per logical record   • Custom table and col...
Comparison of forms CCKsFeature                   “Vertical” storage          “Horizontal” storageFlexibility             ...
Requirements    • Introduction    • Requirements    • Analysis and modelling    • Design    • Development    • Testing    ...
CFDemo organisation chart                CEO          CFDemo      Finance   Sales      HR         Fred      Sarah   Helen ...
Business processThe new online leave application process works as follows:• To gain access to online Leave Application fac...
More business rules• CFDemo managers may have staff who are not employees, e.g. casuals, contractors. In general these sta...
Analysis and modelling     • Introduction     • Requirements     • Analysis and modelling     • Design     • Development  ...
Analysis process• Business analysis is skilled, demanding, high-value work• Analysts think in terms of processes, structur...
Simplified JSD analysisA simplified method, based on Jackson SystemDevelopment1.   Obtain a written narrative description ...
Analysis methods• UML: Unified Modelling Language• Key product of OMG: Object Management Group• UML provides standards and...
Analysis toolsCommon UML tools:• Microsoft Visio  • Very commonly used, but doesn’t do code generation• NetBeans UML plugi...
uc Actors                                     CFDemo Leave Application                                       Applies for l...
Design    • Introduction    • Requirements    • Analysis and modelling    • Design    • Development    • Testing    • Depl...
Design methods and tools• Use some more UML, continue from analysis work• Most useful structural diagrams for design:  • C...
Data model• The data model is the single most important product  • If the data model is sound, there will always be a reas...
Data modelling• Make the effort to build a data model for any non-trivial  application• Build a fully normalised model (3N...
Data modelling tools• Microsoft Visio  • Very commonly used, but doesn’t do code generation• MySQL Workbench 5.x• phpMyAdm...
class Schema1                      #__chronoforms_data_leav edefinition                                                #__...
Data design• Actors                                  • Major Attributes  • Applicant                               • Leave...
Forms designLeave Application Forms List        Stage   Process Seq   Name                     Type     Use Case          ...
Development    • Introduction    • Requirements    • Analysis and modelling    • Design    • Development    • Testing    •...
Final HR Leave Application product           Demonstration
Testing     • Introduction     • Requirements     • Analysis and modelling     • Design     • Development     • Testing   ...
Testing ChronoForms• Use a good IDE and copy/paste code to/from CF    elements and actions; helps to get syntax right•   H...
Deployment    • Introduction    • Requirements    • Analysis and modelling    • Design    • Development    • Testing    • ...
Deploying ChronoFormsExporting an application:• Survey your forms and list any custom actions used• Identify any related g...
References • ChronoForms product site:   • http://www.chronoengine.com/ • Bob Janes’ support site:   • http://greyhead.net...
Upcoming SlideShare
Loading in …5
×

Build Joomla! 3.0 business apps with ChronoForms

1,413 views

Published on

This presentation is an expansion and elaboration of my talk on ChronoForms web application development from Jan 2011. Presented at Melbourne Joomla!Day on 19 Jan 2013.

Published in: Technology
  • Be the first to comment

Build Joomla! 3.0 business apps with ChronoForms

  1. 1. Build Joomla! businessapps with ChronoForms Russell Searle 19 Jan 2013
  2. 2. Introduction • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  3. 3. Why build business apps?• Businesses automate and connect business processes -> significant cost reductions = improve profitability• Use Joomla! as a framework, it has all the services and elements• Attract bigger clients for longer term engagements and more repeat business• Work on more interesting projects• More demanding custom development work attracts higher rates• Produce higher value applications and sites• Possibly reduce need to interface / integrate separate customer apps
  4. 4. Elements of business apps Feature ChronoForms product Forms ChronoForms Views ChronoConnectivity Workflow: mail ChronoForms Workflow: ChronoForms, state ChronoConnectivity
  5. 5. ChronoForms product range• ChronoForms • Builds chainable CRUD forms for any data • Simple form controls, rich set of actions, fully programmable• ChronoConnectivity • Builds views of any data • Front-end and back-end views in one view object• ChronoForums • A beta-version forum built on CF, similar to phpBB V3 • For sites that need a modified or customised forum • Reference installation for CF features and techniques• ChronoContact • A simplified contact form builder
  6. 6. ChronoForms features• Drag and drop form builder• Wizards for basic and complex forms• Basic set of configurable input elements, plus custom element• Extensive set of configurable form actions • A CF form does not have to have a UI!• Custom callable events• Pluggable architecture• Extremely customisable and programmable• Suits web developers: HTML, PHP, JavaScript, CSS, AJAX• Developed by Max (ChronoMan), supported by Max and Bob Janes (author of Packt book, custom actions and tutorials)
  7. 7. Two types of forms CCK• “Vertical” data organisation • Multiple physical records per logical record • Fixed table and column names, fixed key and indexes • RS Form! Pro organises main tables “vertically” Form builder RSForm! Pro Table #__reform_submission_values SubmissionValueId FormId SubmissionId FieldName FieldValue 1 1 1 name Joe Blow 2 1 1 email joe@blow@mail.com 3 1 1 address1 1 Fred Street 4 1 1 address2 5 1 1 suburb Carlton 6 1 1 state Vic 7 1 1 postcode 3084 8 1 1 country AU 9 1 1 phone 03 5555 1234
  8. 8. Two types of forms CCK• “Horizontal” data organisation • One physical record per logical record • Custom table and column names, custom key and indexes • ChronoForms organises data “horizontally” Form builder ChronoForms Table #__chronoforms_data_mailusers name email address1 address2 suburb state postcode country phone Joe Blow joe@blow@mail.com 1 Fred Street Carlton Vic 3084 AU 03 5555 1234
  9. 9. Comparison of forms CCKsFeature “Vertical” storage “Horizontal” storageFlexibility  Very flexible  Rigid structureAdaptability  Highly adaptable  Slow to adaptExtensibility  Easy, fast extension  Painstaking extensionEfficiency, performance ? OK for small-medium DBs  High performanceScalability  Limited, constrained  Practically unlimitedJoins and views  Hopeless  Practically unlimitedReport production  Poor reporting support  Strong reporting featuresProcessing complexity  Limited to simple apps  Highly complex DBs/appsData typing  Weak typing  Strong typing
  10. 10. Requirements • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  11. 11. CFDemo organisation chart CEO CFDemo Finance Sales HR Fred Sarah Helen Sam Payroll
  12. 12. Business processThe new online leave application process works as follows:• To gain access to online Leave Application facilities, you must log in to the CFDemo application as one of the CFDemo employees.• Begin the leave application process by clicking the Apply for Leave link in one of these places: • The Apply for Leave option in the HR drop-down menu from the top menu bar • The Apply for Leave option in the HR section menu in the left sidebar• You will be asked which type of leave you are applying for: Annual, Sick, Long Service or Bereavement leave.• If you are a manager who has the authority to submit leave applications on behalf of your staff, you will also be asked whether you are submitting the leave application for yourself, or on behalf of one of your staff members.• Fill out and submit the Leave Application form. Required values have labels marked with *. There are pop-up calendars for the starting and ending leave dates. Please be sure to enter the correct number of working days off. You must apply for a minimum of one days leave.• For sick leave applications, please upload a scanned copy of your doctor’s certificate. For bereavement applications, please identify your relationship to your deceased relative.• When you submit the form, three e-mails are sent: • You receive an acknowledgement e-mail at your registered e-mail address. • The Payroll Administrator will receive a request to check and confirm your available balance of the type of leave you have requested. • The manager who approves your leave applications will receive a copy of your application, for planning purposes.• When the Payroll Administrator checks your leave balance, another e-mail is sent to the manager who approves your leave applications: • Your manager will be asked to review and approve your leave application. The manager may refuse your application, but if so, he or she must record a reason. • If your manager is unable to review your leave application for some reason, the Payroll Administrator can review and update your application on behalf of your manager.• When your manager reviews and updates your leave application, two more e-mails are sent: • You receive an e-mail advising the managers decision. If your leave application is refused, please discuss the matter with your manager. • If your application is for Long Service leave, the Managing Director will also receive a copy of your managers decision on your leave application. • The e-mail to you is also copied to the Payroll Administrator, for management purposes.
  13. 13. More business rules• CFDemo managers may have staff who are not employees, e.g. casuals, contractors. In general these staff do not have trusted CFDemo e-mail addresses. Managers are expected to apply for leave on behalf of these staff members, and to communicate directly with them about their leave applications. For this reason, the LeaveApplicationProxy form requires entry of the applicant’s name but it does not allow entry of an e-mail address, and proxy leave applications do not attempt to notify the leave applicant at any stage of the work flow.• There are four types of leave but in each case, there are several options for the way that wages may be paid during the employee’s absence. This attribute is referred to as the “Leave Option”. It is selected during the initial leave application but can be changed later by the Payroll Administrator.• Each type of leave also has different attributes, as follows: • Annual Leave. This is the basic form of leave, there are no additional fields on the Leave Application form. • Sick Leave. Applicants are expected to provide a doctor’s certificate for all sick leave. This can be uploaded on the initial leave application, or the leave applicant can provide it later and the Payroll Administrator or the Approving Manager can upload it to the application at a later stage, even after leave has been approved. • Long Service Leave. There are no additional fields on the Leave Application form, but the CEO is copied in on the leave approval email notification. • Bereavement Leave: The leave applicant must specify his or her relationship to the deceased person, and only a specified set of relationships are accepted for the granting of Bereavement Leave. In addition, the leave days credit must be paid for from one pf the normal leave balances that are due to the applicant.• If the Approver Manager refuses a Leave Application, he or she must provide a reason for doing so, but that reason is not communicated in email notifications.• The system does not attempt to maintain the leave days’ balances for employees, the Payroll Administrator handles that separately with other systems.• Managers need a Leave Schedule report so they can review planned or past absences from their departments.• The Payroll Administrator needs the ability to review, update and delete all Leave Applications at any time. No mail notifications are sent when the Payroll Administrator updates Leave Applications outside the normal work flow.
  14. 14. Analysis and modelling • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  15. 15. Analysis process• Business analysis is skilled, demanding, high-value work• Analysts think in terms of processes, structures, models• Good modelling tools can generate schemas and code• Products of analysis • Business process narrative • Process and partial data models • Requirements • Functional spec • Test cases • Partial database schema • Basic classes in various target languages
  16. 16. Simplified JSD analysisA simplified method, based on Jackson SystemDevelopment1. Obtain a written narrative description of the business process, including objects, inputs, outputs and actors2. Get four highlighters3. Highlight all nouns in colour #1: these are candidate entities, or candidate master tables4. Highlight all verbs in colour #2: these are candidate actions, transactions or relationships5. Highlight all adjectives in colour #3: these may be candidate attributes for related entities6. Highlight all adverbs in colour #4: these may be candidate conditions or modifiers
  17. 17. Analysis methods• UML: Unified Modelling Language• Key product of OMG: Object Management Group• UML provides standards and specs for modelling business and application processes, structure, behaviour and architecture• UML tools produce various diagrams• Users can understand and react to UML diagrams• Most useful behavioural diagrams for analysis: • Use cases • Activity • Sequence • Interaction • Communication
  18. 18. Analysis toolsCommon UML tools:• Microsoft Visio • Very commonly used, but doesn’t do code generation• NetBeans UML plugin• Eclipse Model Development Tools• IntelliJ IDEA UML Designer• Visual Paradigm for UML• Enterprise Architect• Dia
  19. 19. uc Actors CFDemo Leave Application Applies for leav e «Notfiy»CFDemo «Notify» Payrolluse case Applicant Check Leav e Balance «Notify» «Notify» «Notify» Approv er Approv e / Refuse Application
  20. 20. Design • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  21. 21. Design methods and tools• Use some more UML, continue from analysis work• Most useful structural diagrams for design: • Class • Object • Package• For web sites, page layout and form styling may also be required, but this is usually a separate stream of work
  22. 22. Data model• The data model is the single most important product • If the data model is sound, there will always be a reasonable solution for functional requirements, and support cost and effort will be predictable • If the data design is incomplete, wrong or weak, the application will have a high life-cycle cost, it will cause trouble and pain, and it will eventually break• Make every effort to align the data model with the real world • Entities • Relationships • Indexes • Foreign keys • Attributes • Constraints • Stored procedures • Triggers
  23. 23. Data modelling• Make the effort to build a data model for any non-trivial application• Build a fully normalised model (3NF) • You can always de-normalise it later if necessary for performance, reporting or data warehousing • But not vice versa: difficult and expensive to normalise a non-normal database• Elaborate BA’s partial data models and schema • Or start with entities and attributes from simplified JSD analysis method• Refine until you can prove that use cases are satisfied
  24. 24. Data modelling tools• Microsoft Visio • Very commonly used, but doesn’t do code generation• MySQL Workbench 5.x• phpMyAdmin also includes a basic data modeller • You have to set up phpMyAdmin configuration storage. This is a bit tricky, but it’s worth doing.• IBM Data Studio• Many other database clients have data modelling features• Many UML analysis tools also have data modelling features
  25. 25. class Schema1 #__chronoforms_data_leav edefinition #__chronoforms_data_leav eapplication «column» «column» *PK cf_id :INTEGER *PK cf_id :INTEGER cf_uid :VARCHAR(255) cf_uid :VARCHAR(255) cf_created :DATETIME cf_created :DATETIME cf_modified :DATETIME cf_modified :DATETIME cf_ipaddress :VARCHAR(255) cf_ipaddress :VARCHAR(255) cf_user_id :VARCHAR(255) cf_user_id :VARCHAR(255) parameter :VARCHAR(255) +composite key stage :VARCHAR(255) parameterValue :VARCHAR(255) applicant :VARCHAR(255) parameterDescription :VARCHAR(255) Definition references leavetype :VARCHAR(255) name :VARCHAR(255) «FK» email :VARCHAR(255) + FK_parameter(VARCHAR) +various leaveoption :VARCHAR(255) «PK» leavecomments :VARCHAR(255) + PK_cf4_chronoforms_data_leavedefinition(INTEGER) leavestart :DATETIME leaveend :DATETIME +FK_parameter daysoff :INTEGER certificate :VARCHAR(255) relationship :VARCHAR(255) +various checkbalance :VARCHAR(255) Parameter approved :VARCHAR(255) references refusalreason :VARCHAR(255) approver :VARCHAR(255) +FK_rule, approveremail :VARCHAR(255)CFDemo FK_factor01, Rule references FK_factor02 «PK» + PK_cf4_chronoforms_data_leaveapplication(INTEGER) #__chronoforms_data_leav erule +FK_applicant, «column» +composite key FK_approverdata model *PK cf_id :INTEGER cf_uid :VARCHAR(255) User cf_created :DATETIME references cf_modified :DATETIME cf_ipaddress :VARCHAR(255) +name cf_user_id :VARCHAR(255) rule :VARCHAR(255) #__users factor01 :VARCHAR(255) factor02 :VARCHAR(255) +FK_factor04, «column» factor03 :VARCHAR(255) FK_result02 *PK id :INTEGER factor04 :VARCHAR(255) * name :VARCHAR(255) result01 :VARCHAR(255) * username :VARCHAR(150) result02 :VARCHAR(255) User * email :VARCHAR(100) reference * password :VARCHAR(100) «PK» * usertype :VARCHAR(25) + PK_cf4_chronoforms_data_leaverule(INTEGER) * block :TINYINT = 0 +name sendEmail :TINYINT = 0 * registerDate :DATETIME = 0000-00-00 00:... * lastvisitDate :DATETIME = 0000-00-00 00:... * activation :VARCHAR(100) * params :TEXT * lastResetTime :DATETIME = 0000-00-00 00:... * resetCount :INTEGER = 0 «PK» + PK_cf4_users(INTEGER) «index» + usertype(VARCHAR) + idx_name(VARCHAR) + idx_block(TINYINT) + username(VARCHAR) + email(VARCHAR)
  26. 26. Data design• Actors • Major Attributes • Applicant • LeaveDefinition • Approver • name, value, description • Delegate (dropped) • LeaveRule • PayrollAdmin • rule, factors x 4, results x 2 • ManagingDirector • LeaveApplication • applicantType• Entities = Tables • leaveType • LeaveDefinition • leaveOption • LeaveRule • stage • LeaveApplication • checkBalance• Relations • approved • LeaveApplication -> LeaveDefinition • All actors • LeaveApplication -> LeaveRule • etc …
  27. 27. Forms designLeave Application Forms List Stage Process Seq Name Type Use Case Next SeqControl 1 LeaveDefinition Form Defines entity-level parameters for Leave Application forms 2, 3 2 LeaveDefinitionList View List Leave Definitions for add or update 3Control 3 LeaveRule Form Defines combination rules to populate LeaveApplication forms 4, 5 4 LeaveRuleList View List Leave Rules for add or update 5Apply 5 LeaveApplicationMaster Switch Present Approver options or Applicant Leave Type option 6 or 7 6 LeaveApproverOptions Form Approver chooses Leave Type and either LeaveApplicationSelf or LeaveApplicationProxy 8 or 9 7 LeaveApplicantOptions Form Applicant chooses Leave Type 9 9 LeaveApplicationSelf Form Leave Application for Self 10 8 LeaveApplicationProxy Form Leave Application for Employee 10CheckBalance 10 LeaveCheckBalance Form Payroll Administrator approves available Leave Balance 11, 12 11 LeaveCheckBalanceList View Payroll Administrator reviews and updates all Leave Applications awaiting Leave Balance approval 12ApproveLeave 12 LeaveApproval Form Approver approves Leave Application 13, 14 13 LeaveApprovalList View Approver reviews and updates all Applications awaiting his/her Leave approval 14Control 14 LeaveApplicationAll Form Payroll Administrator updates any Leave Application 15 15 LeaveList View Payroll Administrator reviews and updates all Leave Applications end
  28. 28. Development • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  29. 29. Final HR Leave Application product Demonstration
  30. 30. Testing • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  31. 31. Testing ChronoForms• Use a good IDE and copy/paste code to/from CF elements and actions; helps to get syntax right• Have a test plan and a suite of unit tests• Test in pieces; test incrementally; test as you go• Test boundary conditions• Use the Debugger action freely• Use Firebug to debug HTML, CSS, JavaScript• PHP debuggers like Xdebug, Zend Debugger are useful but it’s not easy to drill down to deep code in Joomla!• Use Selenium to automate unit test suite
  32. 32. Deployment • Introduction • Requirements • Analysis and modelling • Design • Development • Testing • Deployment
  33. 33. Deploying ChronoFormsExporting an application:• Survey your forms and list any custom actions used• Identify any related groups and access levels• Backup CF and CC forms from CF / CC managers• Export database tables with phpMyAdmin or other MySQL clientDeploying an application:• Install custom actions required for your app• Create required groups and access levels• Import database tables with phpMyAdmin / MySQL client• Change table prefixes of imported tables• Restore CF and CC forms in CF / CC Managers• Work through all forms and connections and update database table names• Check any static email addresses and embedded URLs• Recreate menus and menu items
  34. 34. References • ChronoForms product site: • http://www.chronoengine.com/ • Bob Janes’ support site: • http://greyhead.net/ • My CFDemo case study site: • http://cfdemo.psicom.com.au/ • Bob Janes’ ChronoForms 3.1 Cookbook: • http://www.packtpub.com/chronoforms-31-joomla-site- cookbook/book • MooTools: • http://mootools.net/ • FormCheck class: • http://mootools.floor.ch/docs/formcheck/files/formcheck-js.html

×