Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a native Joomla 3.x component

So I decided to see what the new Joomla! MVC brings. Because I am a learning by doing kind of guy I started building a native Joomla! 3.x component, I mean without using the legacy classes in a real world project, not just hello world stuff.

As learning material point I've used the Lendr tutorial and I've also inspected a bit the new Joomla! jissues code.

One of the things that I miss from the legacy classes is JModelList. So I basically stated copy - pasting methods from there to my component.

Now everything is so light and flexible, but basically to achive the same functionality as with the legacy classes, I actually have to write and maintain more code. One of the functionalityes that I "love" writing are basic CRUD functionality.

So my question is: are there any good examples on using the new MVC from Joomla?

like image 564
Valentin Despa Avatar asked Mar 24 '13 09:03

Valentin Despa


2 Answers

The new MVC classes really aren't suited for out-of-the-box use with the CMS. They're usable, if you're willing to maintain the extra code to do it.

The 3.1 installer uses the new MVC, otherwise, the best examples I know using the newer MVC are the tracker application (which is the only large scale web application I've seen publicly use it) and the Platform Pull Tester.

David Hurley is running a series in the Joomla! Magazine (latest article) on using the new MVC, but it isn't very far along just yet.

like image 54
Michael Avatar answered Nov 11 '22 18:11

Michael


As far as I know JIssues is the only public example of using new MVC in Joomla CMS.

While I find new MVC minimalism very convenient for Platform/ Framework applications, I'm reluctant to use it for new component for the reasons as you've written - it's missing some CMS-specific stuff.

I think we (community) should develop these classes (available later in /libraries/cms/) taking into account new things in Joomla (MVC, Router, ApplicationWeb) as well as in PHP 5.

JModelTracker might be a good thing to review

Edit:

There's an application built on Joomla Platform: Cobalt CRM.

While it's not a CMS component, some design patterns are similar to how new MVC would be used in CMS: There's a base model CobaltModelDefault that other models extend (ie. CobaltModelDocuments).

For me it makes sense to prepare some classes for common use in CMS (that will probably be quite similar to legacy ones), but with RAD techniques in mind like Framework-on-Framework, namespacing and so on.

like image 21
piotr_cz Avatar answered Nov 11 '22 16:11

piotr_cz