The perl code listed below is taken from COSAS which is a custom web-based inventory control/asset management application
that was written and maintained by Tim Turnquist for Common Hope.
|
This code demonstrates:
|
Style
- Strict adherence to perl style standards and self-imposed guidelines to increase readability --
which improves maintainability -- as demonstrated by:
- Concise in-line documentation
- Use of STRICT pragma and all variables declared
- Beginning of functions easy to find with comment headers
- No line over 80 characters long
- Uses easy to understand variable naming convention with an underscore is used for internal variables.
Function
- Use of Object Orientation
- Interaction with other objects and modules
- Interaction with the system and files stored on disk
- Use of code wrappers for multi-use code or objects
- Use of complex data structures such as hashes
- Use of references
- Use of DBI and database interaction
- Use of CGI and Common Gateway Interface interaction
- Complete separation of Business logic from Interface logic (and wrappers for all database functions) to further encapsulate the application layers.
Using this system it is easy to change one part of the system -- for example one could change the entire user interface by only changing the user interface package(s)
or changing the database by changing the DB wrapper(s).
|
More code samples available upon request
|