MVC confusion
Posted: Tue Nov 06, 2007 7:18 pm
I'm trying to develop my first Joomla component, and am developing for 1.5. I've been thru the tutorials on the 1.5 MVC model, and am getting confused trying to understand other existing components in relation to the tuturials, and how my own should be structured.
The tutorials demonstrate using models, but many of the existing components have Tables rather than models. When should I be using a model versus a table? The tutorials don't mention anything about tables, so I thought maybe it was the old way, but I don't know if the JTable functions like check-in/out, publish, etc. work without a table reference... can someone point me in the right direction there?
Also there seems to be a number of ways to define views. Some use &view=xx in the url, like the tutorial, others use a controller id in the url and let the controller choose the view based on the task (ie. admin.../com_banners)... is any one way 'right' or should I just use the one I like the best?
I also see a number of Helper files... how do these fit in?
I guess I'd just like to know the 'proper' way from the start(as much as I can), and I'm not sure if these things are needed and just not documented yet, or if they're old and I should ignore them.
The tutorials demonstrate using models, but many of the existing components have Tables rather than models. When should I be using a model versus a table? The tutorials don't mention anything about tables, so I thought maybe it was the old way, but I don't know if the JTable functions like check-in/out, publish, etc. work without a table reference... can someone point me in the right direction there?
Also there seems to be a number of ways to define views. Some use &view=xx in the url, like the tutorial, others use a controller id in the url and let the controller choose the view based on the task (ie. admin.../com_banners)... is any one way 'right' or should I just use the one I like the best?
I also see a number of Helper files... how do these fit in?
I guess I'd just like to know the 'proper' way from the start(as much as I can), and I'm not sure if these things are needed and just not documented yet, or if they're old and I should ignore them.