Ledger SMB - 1.3 Architecture

1.3 Architecture

The original codebase of the project had a number of shortcomings. The Perl code generated both database queries and web pages by concatenating or printing portions of the text so that it came out as a distinct page. While this functioned reasonably well, it made the interface very difficult to modify, and interoperability with projects written in other languages was particularly difficult.

Faced with these challenges, the LedgerSMB team developed a new architecture which addresses these issues by adding support for templates in the user interface, and moving all database calls into stored procedures. Although closely resembling model-view-controller (MVC) in structure, it is not broken down in precisely the same way as other MVC implementations.

The overall design considerations included a desire to ensure that multiple programming languages could be used cross-platform to access LedgerSMB logic and that security would be consistently enforced across these applications. Thus the LedgerSMB team envisioned a "one database, many applications" environment typical of PostgreSQL. The overall approach heavily leverages PostgreSQL roles (application users are database users, and are assigned roles). Access to the database logic for new code (added in 1.3 or later) goes through stored procedures which act like named queries. Permissions are sometimes granted on underlying relations or on the stored procedures. The stored procedures have semantic argument names, allowing for automatic mapping in of object properties. These are then exposed to the Perl code through fairly light-weight wrappers. User interface code wrapped around Template Toolkit, which is also used for generating PDF's via LaTeX, CSV files, Excel, Open Document etc. Workflow is handled through relatively light-weight Perl scripting.

Read more about this topic:  Ledger SMB

Famous quotes containing the word architecture:

    And when his hours are numbered, and the world
    Is all his own, retiring, as he were not,
    Leaves, when the sun appears, astonished Art
    To mimic in slow structures, stone by stone,
    Built in an age, the mad wind’s night-work,
    The frolic architecture of the snow.
    Ralph Waldo Emerson (1803–1882)