As part of this thread, Sam Moffatt proposed a way forward that allows for a high degree of backward compatibility (b/c) but still allows the platform to use the preferred names. After discussing this in the Production Leadership Team, we believe that this proposal is a reasonable way forward. The purpose of this post is to clarify the details of the proposal and get feedback from the community before making a final decision.
Here is an outline of how this would work.
Starting with version 2.5.5 or 2.5.6, three new classes would be created in the libraries/joomla/application folder called JModelLegacy, JViewLegacy and JControllerLegacy. For version 2.5.x, these would be empty classes that simply extend JModel, JView, and JController. In addition, any core classes that currently extend JModel, JView, and JController would be changed to extend the new legacy classes. Bear in mind that this change to core is a very simple search/replace of two words in each file (the jimport line and the extends line). All 2.5 extensions will continue to work in 2.5 without any changes.
In Version 3.x, this would continue unchanged (except that all of the cms-related files will likely move to the libraries/cms folder). However, the new platform will add JModel, JView, and JController implemented as interfaces. So, for example, we will have 2 files that define JModel, one in the cms folder that defines the old (2.5) class and one in the platform that defines the new interface. How would this affect existing extensions?
- Any extension using the new legacy classes would be totally unaffected.
- Any extension using classes that extend the old JModel, JView, and JController would continue to work as long as (a) they continue to explicitly load the parent class files (which they are doing already) and (b) they are not mixing the use of the old class names and the new interface names in the same request cycle. (In other words, there would only be a problem if somehow both the old and new MVC styles were being mixed in the same page. In any case, the simple fix would be to modify the classes to extend the new legacy versions of the MVC base classes.)
Hi all
To me, the sticky point appears to be:
"(b) they are not mixing the use of the old class names and the new
interface names in the same request cycle."
gue
Hey
I read the long posts, the cons & pros. I really like the new
MVC which take us forward, but I don't understand why we push this
b/c issue, if we can avoid it easily by another name convention.
It's easy to say 3rd party developer have enough time to migrate,
but why to make them work, if we can make their life easier.
Remind for our
developer strategy for backward compatibility - it doesn't
look like we treat it as important, and more critical - we can't
use both implementations at the same request.
So the simple (technical) question that I could not find answer
in the long posts - why we don't use JXXXXInterface? I know
another frameworks use this name convention (Zend, Java).
Of course, I don't want to be the party pooper, but just want to
clarify this issue.
Ofer Cohen TP2 - The new way to manage your modules
On 10/05/12 19:48, Mark Dexter wrote:
In a recent thread in the Platform list (http://groups.google.com/group/joomla-dev-platform/browse_thread/thread/422903a9385f14de) there was a long discussion about an important pull request in the platform. The thrust of this pull request is to make significant changes to the MVC implementation in the platform.
A major point of concern in this discussion was the proposal to use the names JModel, JView, and JController for the names of the new interfaces. The concern expressed was that re-using these names would cause unnecessary backward-compatibility (b/c) issues with existing third-party extensions.
As part of this thread, Sam Moffatt proposed a way forward that allows for a high degree of backward compatibility (b/c) but still allows the platform to use the preferred names. After discussing this in the Production Leadership Team, we believe that this proposal is a reasonable way forward. The purpose of this post is to clarify the details of the proposal and get feedback from the community before making a final decision.
Here is an outline of how this would work.
Starting with version 2.5.5 or 2.5.6, three new classes would be created in the libraries/joomla/application folder called JModelLegacy, JViewLegacy and JControllerLegacy. For version 2.5.x, these would be empty classes that simply extend JModel, JView, and JController. In addition, any core classes that currently extend JModel, JView, and JController would be changed to extend the new legacy classes. Bear in mind that this change to core is a very simple search/replace of two words in each file (the jimport line and the extends line). All 2.5 extensions will continue to work in 2.5 without any changes.
It is important to understand that these changes will not affect any third-party extensions for 2.5. Extensions that use JModel, JView, and JController will continue to work without any modifications. These changes just provide 3pd�s the option to make changes in 2.5.x to prepare for 3.0. The purpose of this change in 2.5 is to allow extension developers to modify their extensions now so that they will be unaffected by platform changes introduced in version 3.0.
b/ or in effect prevent developers to use new MVC, for fear of
conflicts: development based on new MVC starts only for 4.0, a couple
of years from now
On 14 May 2012 17:17, shumisha <shum...@gmail.com> wrote:
I think you are worried about a different problem. Can you give me a
> So the discussion is relevant and the conflict will happen a lot.
code example of the conflict you perceive?
In a recent thread in the Platform list (http://groups.google.com/group/joomla-dev-platform/browse_thread/thread/422903a9385f14de) there was a long discussion about an important pull request in the platform. The thrust of this pull request is to make significant changes to the MVC implementation in the platform.
A major point of concern in this discussion was the proposal to use the names JModel, JView, and JController for the names of the new interfaces. The concern expressed was that re-using these names would cause unnecessary backward-compatibility (b/c) issues with existing third-party extensions.
As part of this thread, Sam Moffatt proposed a way forward that allows for a high degree of backward compatibility (b/c) but still allows the platform to use the preferred names. After discussing this in the Production Leadership Team, we believe that this proposal is a reasonable way forward. The purpose of this post is to clarify the details of the proposal and get feedback from the community before making a final decision.
Here is an outline of how this would work.
Starting with version 2.5.5 or 2.5.6, three new classes would be created in the libraries/joomla/application folder called JModelLegacy, JViewLegacy and JControllerLegacy. For version 2.5.x, these would be empty classes that simply extend JModel, JView, and JController. In addition, any core classes that currently extend JModel, JView, and JController would be changed to extend the new legacy classes. Bear in mind that this change to core is a very simple search/replace of two words in each file (the jimport line and the extends line). All 2.5 extensions will continue to work in 2.5 without any changes.
It is important to understand that these changes will not affect any third-party extensions for 2.5. Extensions that use JModel, JView, and JController will continue to work without any modifications. These changes just provide 3pd’s the option to make changes in 2.5.x to prepare for 3.0. The purpose of this change in 2.5 is to allow extension developers to modify their extensions now so that they will be unaffected by platform changes introduced in version 3.0.
In Version 3.x, this would continue unchanged (except that all of the cms-related files will likely move to the libraries/cms folder). However, the new platform will add JModel, JView, and JController implemented as interfaces. So, for example, we will have 2 files that define JModel, one in the cms folder that defines the old (2.5) class and one in the platform that defines the new interface. How would this affect existing extensions?
- Any extension using the new legacy classes would be totally unaffected.
- Any extension using classes that extend the old JModel, JView, and JController would continue to work as long as (a) they continue to explicitly load the parent class files (which they are doing already) and (b) they are not mixing the use of the old class names and the new interface names in the same request cycle. (In other words, there would only be a problem if somehow both the old and new MVC styles were being mixed in the same page. In any case, the simple fix would be to modify the classes to extend the new legacy versions of the MVC base classes.)
- Note also that any classes that extend child classes (such as JModelAdmin or JModelList) would be entirely unaffected (since these will now be extending the legacy classes).
In version 4.x, the old JModel, JView, and JController class files would be removed and the code would be moved to the legacy versions. At that point, any extensions using the legacy MVC classes would have to change their classes to extend the legacy classes (the same simple change that was done in core for 2.5.5 or 2.5.6). At some point in the future, support for the legacy MVC might be dropped, but that decision will not need to be made until after 3.5 is released.
To the PLT, this approach seems to be a reasonable compromise between allowing a high degree of backward compatibility and still allowing the project to move forward with optimal file naming conventions. Extension developers can make a very simple change now to provide for forward compatibility. Even without these simple changes, 2.5 extensions will likely work in the great majority of situations for 3.x.
Please let us know what you think and whether we have missed some important aspect of this. Thanks!
In a recent thread in the Platform list (http://groups.google.com/group/joomla-dev-platform/browse_thread/thread/422903a9385f14de) there was a long discussion about an important pull request in the platform. The thrust of this pull request is to make significant changes to the MVC implementation in the platform.
A major point of concern in this discussion was the proposal to use the names JModel, JView, and JController for the names of the new interfaces. The concern expressed was that re-using these names would cause unnecessary backward-compatibility (b/c) issues with existing third-party extensions.
As part of this thread, Sam Moffatt proposed a way forward that allows for a high degree of backward compatibility (b/c) but still allows the platform to use the preferred names. After discussing this in the Production Leadership Team, we believe that this proposal is a reasonable way forward. The purpose of this post is to clarify the details of the proposal and get feedback from the community before making a final decision.
Here is an outline of how this would work.
Starting with version 2.5.5 or 2.5.6, three new classes would be created in the libraries/joomla/application folder called JModelLegacy, JViewLegacy and JControllerLegacy. For version 2.5.x, these would be empty classes that simply extend JModel, JView, and JController. In addition, any core classes that currently extend JModel, JView, and JController would be changed to extend the new legacy classes. Bear in mind that this change to core is a very simple search/replace of two words in each file (the jimport line and the extends line). All 2.5 extensions will continue to work in 2.5 without any changes.
It is important to understand that these changes will not affect any third-party extensions for 2.5. Extensions that use JModel, JView, and JController will continue to work without any modifications. These changes just provide 3pd’s the option to make changes in 2.5.x to prepare for 3.0. The purpose of this change in 2.5 is to allow extension developers to modify their extensions now so that they will be unaffected by platform changes introduced in version 3.0.
Hi Amy,
I won't have time any more for this discussion, as I am heading for
Jab.
I still think this is the place to talk about this, as the requested
change is for the platform, not the cms.
Andrew is not entirely correct on the two points you sort of quoted
him:
- conflicts with 2.5 modules (and plugins): indeed there is no risk of
conflict...if you don't use them! That's one way of looking at it. Not
mine. I'd rather be able to use existing components, modules and
plugins and still have no conflict. Especially if the estimated work
to achieve time is a few hours.
- cannot use both versions on the platform: that's only true
currently. With my proposed prefix change in 12.1, it becomes fine to
use both version of platform on the same page, on the same component,
module or whatever.
I just did that yesterday night, replaced J with JPrefix in 12.1
(about half of it actually), stuck it in /libraries/joomla/jx, changed
a couple of lines in loader.php of a vanilla Joomla! 2.5.4 instance,
and off you go, you can use classes from 11.1 and 12.1 together - in
Joomla! 2.5 actually, you don't even need Joomla! 3.0.
Took about an hour, replacing J with Jx is a bit tedious!
Now you can use code like below anywhere in your component, modules,
plugins. And when the opposite is done (adding 11.1 to CMS 3.0), it
means existing extensions will work unchanged in CMS 3.0 (not
withstanding changes in the CMS itself ofc).
// Platform 12.1
class ModelDummy extends JxModelDatabase {
}
$model121 = new ModelDummy();
var_dump( $model);
// platform 11.1
jimport('joomla.application.component.modelitem');
class ContentModelArticle extends JModelItem {
}
$model111 = new ContentModelArticle();
var_dump( $model);
No change required to anything, if you want to use 12.1, just start
using it.
This is barely a proof of concept, and unfortunately we have spend a
lot of time trying to argue about irrevelant things, while the basic
idea has not at been examined, so maybe there are bumps down the road
that'll prevent this idea to work
"...The CMS might decide to not accept his PR, and just hold off until
4.0, orthat they can be used in parallel fashion...."
take it in and use an approach like you have outlined, renaming
classes so
Understand that. What a waste though. The CMS creating its own fork of
the platform?
Cheers
On Wed, May 16, 2012 at 3:17 AM, shumisha <shum...@gmail.com> wrote:Hi Amy,
I won't have time any more for this discussion, as I am heading for
Jab.
Hopefully, you'll find some clarity when you speak with the PLT and folks like Louis. It's kind of hard to see where things are going. Sitting down and talking this next week will help a great deal.
So in 2.5.x, the legacy files are added extending the existing classes
(simple). In 3.x we flip it so that the files are left in place so the
jimport() statements work, add a deprecated usage notice in the old
file name (e.g. /libraries/joomla/application/component/model.php) and
update the file to be JModel extends JModelLegacy where JModelLegacy
has all of the code. As legacy extensions will explicitly jimport the
file at the top (because those classes are not currently autoloadable)
they remain unaffected in the 3.x series and have until 4.x to update
(not that updating is hard but it is time consuming).
The autoloader will kick in if you haven't explicitly jimport'd the
class however since all extension developers now have to jimport these
classes we shouldn't have a problem. Going forwards we can autoload
everything however in this case we can provide a transition pathway
for those who haven't renamed things in the 3.x series with forwards
compatibility in 2.5 for all of the changes. The only issue remaining
is mixing the two in the same request but in the short term that
shouldn't be a problem as most won't be using the new classes and in
the long run the solution is to update old code by renaming a class.
Good point, but a different issue. Holding off new Joomla CMS development with the new content strategy and MVC changes until 4.0 is, in my opinion, appropriate.
That was my initial point. I didn't believe these classes were going to be used in 3.0, which to me is appropriate at this point. If the classes are made available too soon to the CMS (before the bigger picture of the Content Model, etc., is clear) then developers will have to make a number of assumptions on even the most basic CRUD operations. That kind of sets them up for having to change, again, when things are ready.
Initially, I also had this reaction but it seems to me the only way to enable the platform team to move forward and to protect the CMS from too frequent and large of change is for the CMS to take a release and stick with it for that series. That buys the platform team time to work and it gives CMS developers a period of time that they know the API is going to stay stable. It's not really a fork, but a version. It all syncs up then with each new series (3.0, 4.0, etc.)
Best regardsRouven
If we don't add these new APIs to STS releases the .0 releases will cause even more trouble.