Note that there are some explanatory texts on larger screens.

plurals
  1. POIs this code insane?
    primarykey
    data
    text
    <p>I'm following a tutorial which I think is written by someone who doesn't know what he's doing (already caught 2 obvious mistakes and the rest of code is messy). But I don't want to discredit the guy completely, so I'm asking here about something else that I don't understand.</p> <blockquote> <p><em>First of all, I will send 100 brownie points, my 2 pets, and a box of chocolate to whoever can explain to me what is going on with this code.</em></p> </blockquote> <p>He's using module-based architecture. Module name is <code>frontmodule</code>. Module has MVC. And module has an internal <code>library</code> of its own.</p> <pre><code> /modules/ /frontmodule/ /models/ /views/ /controllers/ -- the /module controller is here (undestandable) /library/ /Controller/ -- the /module/library controller is here (why?!) /Action/ </code></pre> <p>First comes the <strong>confusing</strong> part. Why each module has an internal library, and why that intenal library has its own <code>controllers</code> and <code>actions</code>. Is this a best practice? I'm thinking this library could be moved to a plugin that the module can use. Not sure..</p> <p>Now comes the <strong>interesting</strong> part.... in addition to each module having its own internal library, there's also a Common library shared by all modules (see it below at the same folder level as <code>/modules</code>) and that Common library also has its own controllers and actions (just like each internal libraries have their own controllers and actions)</p> <pre><code> /modules /library/ /Common/ /Controller/ -- the /common/library controller is here (why?!) /Action/ /Helper/ /Plugin/ </code></pre> <p><strong>So we have 3 controllers:</strong></p> <ul> <li><strong>the module controller</strong> </li> <li><strong>the module internal library's controller</strong></li> <li><strong>the common library's controller</strong></li> </ul> <p>Now here's the <strong>insane</strong> part that I think is over-complicating life</p> <blockquote> <p><strong>He says: A module controller extends the module’s library parent controller which also extends the Common library controller.</strong></p> </blockquote> <pre><code>class IndexController extends Frontoffice_Library_Controller_Action_Abstract { ... } abstract class Frontoffice_Library_Controller_Action_Abstract extends Custom_Controller_Action_Abstract { ... } </code></pre> <p><strong>So I guess:</strong></p> <ul> <li><strong>the module controller = <code>IndexController</code></strong> </li> <li><strong>the module internal library's controller = <code>Frontoffice_Library_Controller_Action_Abstract</code></strong></li> <li><strong>the common library's controller = <code>Custom_Controller_Action_Abstract</code></strong></li> </ul> <p>where <code>module controller</code> extends <code>module internal library's controller</code></p> <p>and <code>module internal library's controller</code> extends <code>common library's controller</code></p> <p>Has anyone seen anything like this before? My guess is that this code won't be easy to maintain, but maybe those more experienced with zend can tell me what this guy is trying to achieve. The app structure is a little too messy. I think he's abusing MVC instead of using it to simplifying the app and its maintainability. </p>
    singulars
    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