[eluser]AndyBC[/eluser]
Another question related to HMVC pattern (I'm using Modular Extensions):
In my database I have a 'categories' table which I need to interact with from different modules (MVC triads), eg.
* Module A: Returns a 'search widget' where user can check which categories to be included in a search.
* Module B: A navigational tab with links to each category.
* Module C: Admin interface for creating/deleting categories
The question - should I:
a)
implement the database interaction with the 'category' table in each module's model?
This would mean duplicate code: modules A to C would all need to have a model method like 'get_categories()' doing the pretty much the same query in the db.
b)
Put the interaction with the categories table in it's own module - 'Categories Module' - and have the other modules call 'Categories Module' whenever categories data is needed. This seems like the right way from a maintenance point of view, but I'm not sure if this would break the HMVC philosophy of complete compartmentalizing / modularing.
c)
Something else?
(I have read different introductions to HMVC on the net, but I can't really grasp what I'm supposed to do here)
Thanks,
Anders