JustRosters - Rapid development through the use of a company code library
JustRosters is an internal project for us here at Marvel Internet Group. It is a side project that is commercially unproven and therefore a risky investment for the company. With that in mind it is crucial for us to be able to complete the project as quickly as possible in terms of both man hours and actual calendar days. To help us achieve this we decided to comb through our previous work and build a reusable PHP library of our most commonly used functions. This collection of loosely coupled functions allows us to easily enhance any code base; belonging to either a client or Marvel Internet Group.
Our code library is split into three parts. One library contains global functions that are included in Cake PHP’s bootstrap file, which is loaded right after the configuration file and before everything else. We currently place debugging and some custom date/time manipulation functions in here so that it does not have to be duplicated elsewhere. Another part of the library is converted into a Cake PHP component. The custom component allows us to reuse convenience functions that are needed inside our controllers, such as permissions management, emailing with PHPMailer, PDF generation, etc. The remaining parts of our library are turned into a custom helper that performs view related formatting.
In total we have reused about 700 lines of code with the three files combined. Using the general rule of thumb that a programmer will produce about 100 lines of quality code per day we practically shaved seven days off our development time before we even started. The cycle of library building will continue and expand with JustRosters. Being one of our most Javascript heavy projects we are also writing a substantial amount of reusable Javascript code that can be combined into another library, or into jQuery plugins, that can be used by the development community as well as our future clients.
Tags: api, cakephp, jquery, justrosters.com, libraries, programming

