Welcome Guest, Not a member yet? Register   Sign In
HMVC VS Modular Separation VS Matchbox
#1

[eluser]john36122340[/eluser]
Hi everyone,

Sorry if this has been posted before but after going through the forum posts I'm more confused than before :-S

Do all of these components do the same thing and what one is best or the most popular...

I'd appreciate any insight/experience or recommendations...

Thanks for the help...
#2

[eluser]Phil Sturgeon[/eluser]
Modular Separation

- Actively maintained
- Supports CodeIgniter 1.7.2 and 2.0-dev
- Supports language fallback (if no other lang file, uses English)
- Supports $route['404'] = 'some_controller' which is massively useful.
- Does not support HMVC cross-loading of module controllers.
- Written for PHP 5 only (quicker, smaller code).

Matchbox

- No longer actively maintained. All of its features have been implemented into Modular Separation (but for a while this was the KING).
- Only supports CodeIgniter 1.7.2.
- Does not support HMVC cross-loading of module controllers.
- Supports PHP 4 and 5 so its a little slower.
- Fun fact: Previously called Modular Separation ~2 years ago, but these projects are NOT RELATED AT ALL.

Modular Extensions (HMVC)

- No longer actively maintained.
- Supports HMVC cross-loading of modules.
- Supports PHP 4 and 5 so its a little slower.

I use Modular Separation for any project that needs modules, which is why I keep it maintained and supported.
#3

[eluser]pickupman[/eluser]
+1 for Modular Separation, and thanks Phil for your work on modules.
#4

[eluser]WanWizard[/eluser]
Another option we're currently working on:

Extending the new Packages system in CI 2.0 with support for controllers and views (it already supports libraries, helpers and models).

Combine that with an option to add a module path to the packages path, call your module file, and pop the path again, and you have modular separation built into the loader class...
#5

[eluser]Phil Sturgeon[/eluser]
[quote author="WanWizard" date="1278017905"]Another option we're currently working on:

Extending the new Packages system in CI 2.0 with support for controllers and views (it already supports libraries, helpers and models).

Combine that with an option to add a module path to the packages path, call your module file, and pop the path again, and you have modular separation built into the loader class...[/quote]

I've been thinking about this but not had the time to find a clean solution. I feel that if you could hack it enough to be a rudimentary modular MVC system but you'd have to create a MY_Loader and a MY_Router anyway and the code for Modular Separation is already so smooth I just can't be bothered.

Bring it along to CICON2010, I'd love to see what you have done so far. :-)
#6

[eluser]WanWizard[/eluser]
I don't need a router class extension, because I use dynamic routing. In the classic modular sense you still have a one to one mapping of the URI segments and the actual controller method.

I need full cross-module support, I have controllers calling other controllers, loading libraries and models from other modules, etc. I have 'theme overriding' for views, a theme can include a different layout for a specific view defined in a module, so I have to look for files in multiple places.

I also need model and library access transparency. If one controller loads a model, that model is available in all controllers and libraries previously loaded, and new controllers or libraries loaded after that will automatically have access that model. This allows me to drop $this->CI completely (except in constructors, due to the PHP4 compatibility we still maintain).

Back to packages, I just need a controller to be able to do
Code:
$this->load->controller('class', 'method', 'module', 'options');

My current MY_Loader is very complex because the CI 1.7.2 loader wasn't built to support multiple locations, which was introduced in 2.0 for the new packages. Which means that for models, libraries and helpers I don't have to do anything, I only have to override the view method, and add a controller method, and create a generic way to push and pop paths on the packages stack.

Shouldn't be too big of a job.

If I look at the feature list a few posts back, what would be still missing other than routing support? I might build that in, free of charge (might cost you a pint at CICON2010 ) :lol:
#7

[eluser]WanWizard[/eluser]
Going to take a bit more work.

The code is far from complete. For example, there is packages support for config files, but it isn't used anywhere in the loader class, it still uses the hardcoded APPPATH.'config/' value. Going to end up extending the entire loader class...
#8

[eluser]john36122340[/eluser]
Thanks for the replies guys, really appreciate it.

And thank you Phil for the great work with Modular Separation, looks like this is the one I'll go for...

You guys saved me hours of testing each one...

Do you have any other advice/recommendations?
#9

[eluser]Mark Croxton[/eluser]
Do you really need modularity? MVC + libraries are enough for me most of the time, but then most of my applications share common functionality.

I've found the widget concept ("intelligent view partials") to provide a useful halfway house:
http://ellislab.com/forums/viewthread/109584

Great for things that need to be displayed in multiple places.
#10

[eluser]WanWizard[/eluser]
Some people do, some don't.

We're developing an application framework, where complete modularity is a must. In essence, every module is (or can be) a mini CI application, with its own models, libraries, controllers, and views.

I can also imagine that if you're a professional web developer, reuse is at the top of your wish list, because you can either work cheaper than your competitors, or you can charge for work not done (for this client)... ;-)

If you're developing a 'simple' standalone website, then maybe not. YMMV.




Theme © iAndrew 2016 - Forum software by © MyBB