Building a native Joomla 3.x component
Asked Answered
A

2

7

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?

Anticipatory answered 24/3, 2013 at 9:9 Comment(4)
did you look at the new installer in 3.1? it should be written using the new mvc architecture. slightly offtopic: why you didn't tag this with joomla too? i think many joomla questions would have more visibility if they had that tag. and what do you think if we create tag synonym between joomla and joomla2.5 joomla3.1 etc?Holms
Thanks for reminding me, I will check it (completly forgot about it!). OFFTOPIC: Added Joomla! tag. Thanks for bringing this up, I had a similar thought yesterday. I would create a synonim between Joomla1.6, 1.7, 2.5) and for 3.1, 3.2, 3.5 series. But I am open for discussing this, maybe on meta?Anticipatory
I am writing the question there nowHolms
here it is: tag synonyms for joomlaHolms
I
4

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.

Irrawaddy answered 24/3, 2013 at 18:26 Comment(2)
Thanks for your input. I had a close look at JModelTracker, most of the code is identical with the legacy classes (from what I've analyzed so far).Anticipatory
One more thing worth checking out might be the use of content tables in Tags componentIrrawaddy
C
5

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.

Corncrib answered 24/3, 2013 at 21:12 Comment(0)
I
4

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.

Irrawaddy answered 24/3, 2013 at 18:26 Comment(2)
Thanks for your input. I had a close look at JModelTracker, most of the code is identical with the legacy classes (from what I've analyzed so far).Anticipatory
One more thing worth checking out might be the use of content tables in Tags componentIrrawaddy

© 2022 - 2024 — McMap. All rights reserved.