WPCubed Calculus: Application Architecture

The application uses SQLight and the FireDAC components included in Delphi XE7. WPTools must be Version 7.20 or later and also include the WPReporter add-on. If you are a customer who has purchased WPTools 7 Bundle, WPTools 7 PRO Bundle or WPTools 7 Premium you can request a ZIP with the source for this application from support@wptools.de.

WPCubed Calculus (see introduction) was designed using a rather basic application architecture. There is a mail form with a menu to launch the data forms for some of the datasets, such as ‘Products’ or ‘Customers’. Orders are created directly on the main form –it displays a grid with the orders and the items linked to the order.

The window to edit and use templates to create reports and invoices is implemented as a modal dialog (i.e. the application is locked until this specific dialog is closed). Data logic is implemented in a data module. This also includes WPTools elements so that they are only required at one location in the source code.

I simplified the logic by only processing one order at a time – this means the data module contains the order dataset and the cursor in this dataset also indicates the current order.  However, reporting works independently, so it is still possible to generate a list of orders without changing the main order data cursor.

The data cursor in the customer table is also used to select the current customer.  When creating a new invoice the information for the customer currently selected is used.

Also see: Multidemo – WPCubed Calculus