Active
Project:
Tagging
Version:
6.x-2.5
Component:
Backend
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2011 at 21:16 UTC
Updated:
1 Aug 2011 at 16:11 UTC
@EugenMayer suggested that I create a new issue how this module should be rewritten to support D6 & D7, so there not 2 separate code bases.
As the maintainer can you fill us in how you would like this module be rewritten
Comments
Comment #1
eugenmayer commentedThank you for taking this chance to combine the effort!
Well you are the one already created a port so you are about to know what will change. By my knowledge we have
1. New signature of FAPI calls
2. New API for FAPI element definition
3. New signature of some theme methodes + theme definitions (hook_theme)
4. New type of how to store the vocabularies
.?
So for this and maybe missing changes we need a clean approach. Lets start with the easy ones:
Basically, tagging itself will become a class for the basic implementation (maybe not generic, but rather directly D6, depends on what we encounter).
1. All calls to the FAP api should be abstracted by the main tagging-class so they can easily be overridden by the D7 implementation
4. The injection of the element, the save / load procedure should be encapsulated into the class in small atomar methods so we can not only override them, but share the maximum amount of code.
2. 3. As the hook names are the same, stuff those into the class, ending up having something like this
Its not yet 100% clear to me if we should use a singleton "Tagging" class or an initiated class in init (or a simple static class). I rather tend to the singleton with a wrapper .
There are 2 approaches how to handle the D6 / D7 port during runtime:
a) Strategy pattern ( chose D6 or D7). So the main implementations for the major releases are Tagging_D6 and Tagging_D7 extends D7, which then get loaded by Tagging as strategy depending on the current drupal version.
b). Hardcode different "init" methods into include files
Approach a) is flexible, but has an slighly overhead for both, D6 and D7 as on each call, we decide which major version we have ( sure we should cache that, but still).
Approach b) has less overhead and is less flexiby, but still has an overhead
--
This is my first proposal on this, so it should tend to be incomplete. Iam open to discussions ofc.
Comment #2
eugenmayer commentedThanks to Compress and Lukow, 2 german companies, we have the funds to start the work on the port. The work will start today and we hope to be done with it this week.
Comment #3
eugenmayer commentedAh yes, i hope you allow us to include your implementations in the port, as explained just encapsulated behind the OOP structure. If you dont like us to do this, please just veto here.
Comment #4
istryker commentedI'm looking forward to the rewrite and how you are going to incorporate encapsulated behind OOP. This module might set the example of how other module should be rewritten across multiple Drupal versions.
Comment #5
capnjav commentedThanks @EugenMayer and @iStriker, looking forward to the d7 port :)
Comment #6
eugenmayer commentedSmall update, we have a running version now. As expected we included a lot work done by you istriker: https://github.com/EugenMayer/tagging/blob/master/tagging.field.inc
We need to fix the info file for proper installation and then we need some testers :)
Comment #7
eugenmayer commentedjust check https://github.com/EugenMayer/tagging/tree/d7_infofile_patch