Note that there are some explanatory texts on larger screens.

plurals
  1. POBest practices for managing several specialized versions of one app
    primarykey
    data
    text
    <p>I have a web application that has many faces and so far I've implemented this through creating themes. A theme is a set of html, css and images to be used with the common back end.</p> <p>Things are laid out like so:</p> <pre><code>code/ themes/theme1 themes/theme2 </code></pre> <p>And each instance of the web application has a configuration file that states which theme should be used. Example:</p> <pre><code>theme="theme1" </code></pre> <p>Now new business rules are asking me to make changes to certain themes that can't be achieved through simply change the html/css/images and require changing the backend. In some cases these changes need to be applied to a group of themes.</p> <p>I'm wondering how to best lay this out on disk, and also how to handle it in code. I'm sure someone else must have come up against this.</p> <p>One idea is to have:</p> <pre><code>code/common code/theme1 code/theme2 themes/theme1 themes/theme2 </code></pre> <p>Then have my common code set the <code>include_path</code> such that <code>code/theme1</code> is searched first, then <code>code/common</code>.</p> <p>Then if I want to specialize say the <code>LogoutPage</code> class for <code>theme2</code>, I can simply copy the page from <code>code/common</code> to the same path under <code>code/theme2</code> and it will pick up the specialized version.</p> <p>One problem with this idea is that there'll be multiple classes with the same name. Although in theory they would never be included in the same execution, I wouldn't be able to extend the original base class.</p> <p>So what if I was to make a unique name for the base class? e.g. <code>Theme1LogoutPage extends LogoutPage</code>. One problem I can foresee with that is when some common code (say the Dispatcher) references <code>LogoutPage</code>. I can add conditions to the dispatcher, but I wonder if there's a more transparent way to handle this?</p> <p>Another option I can think of is to maintain separate branches for each theme, but I think this could be a lot of work.</p> <p>One final thing to consider is that features might originate in one theme and then require merging into the common codebase.</p> <p>Any input greatly appreciated. If it makes any difference, it's a LAMP environment.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload