This is a subject I raised at ApacheCon in my (sparsely-attended) BOF, and also the morning after when Aaron Bannert discussed apr_reslist in his talk.
(1) APR[1] provides a useful though limited library of reusable code. (2) Through apr_reslist it provides the basis for a module to reuse resources such as a connection pool. (3) Individual modules can, on an ad-hoc basis, export resources for use by other modules. However, what we lack is (4) Any kind of systematic approach to or infrastructure for sharing resources between independent modules. Example: My Site Valet application uses PostgreSQL in my custom code. The site also uses a third-party module, mod_auth_pgsql, that uses PostgreSQL. Mod_auth_pgsql does the work of maintaining the connection pool, but without using APR. So the only way I can reuse the mod_auth_pgsql connection is by hacking straight into the code. What I'd like to see, perhaps as a medium-term goal, is a framework whereby modules are encouraged to export functions and resources that could usefully be shared. For example, if mod_auth_pgsql exported a PgSQL connection pool, I could use it directly. Better still, if the APR exported a generic SQL connection pool with a PgSQL implementation, I could build on that to make my application portable across different SQL engines (as the Enterprise Edition is). As a module developer, I am happy to contribute to such an effort. My modules currently export a small number of functions and data where appropriate - that would be more likely to benefit other developers if it were documented at apache.org. Maybe if we (say) formally defined a contrib namespace (like apc_**) with published guidelines (like returning APR_STATUS_T), that could help module developers start making reusable resources available? BTW, on a related note, I anticipate using an apx_*** namespace to export fuctions from mod_xmlns in the reasonably near future. [1] or, more pedantically, apr-util -- Nick Kew