roman has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
has anyone ever dealt with the following problem?
We have quite a few DBIC "business" classes installed in different environments - webserver, application server, ...
In some of these environments (webserver) we would like to strip the classes of the code which is never called in the environment.
The reason is security, we don't want application logic to be exposed on webserver.
My first (and so far the only) idea is to add some type of smart comments into the modules and preprocess them when they are installed. Since we use Module::Build subclass for the installation, this approach is usable although a bit cumbersome.
package MyApp::Schema::Request; .... #%% if IN_APP_SERVER then use MyApp::SOAPClient::SAP; #%% end if #%% if IN_APP_SERVER then sub send_to_sap { } sub workflow { ... } #%% end if
Does anyone know a better solution or the whole idea is somehow distorted?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to strip off parts of the code according to environment
by cdarke (Prior) on Sep 12, 2008 at 15:41 UTC | |
|
Re: How to strip off parts of the code according to environment
by jhourcle (Prior) on Sep 12, 2008 at 14:40 UTC | |
|
Re: How to strip off parts of the code according to environment
by Anonymous Monk on Sep 13, 2008 at 07:06 UTC |