Welcome Guest, Not a member yet? Register   Sign In
Turning MCV into MVCL: the solution to a mega project?
#1

[eluser]Narkboy[/eluser]
I'm looking at developing a very large project on CI, and in a nutshell I'm considering doing most of the classic 'controller' work within libraries, and using the controllers to access those libraries.

I'm looking for reasons why this is a bad idea, and how I might achieve the same effect in controllers.

Application Outline:

The goal accross the entire app is to make new versions, updates and tweaks fast, simple and able to be selectively applied.

The single CI app will serve requests made to any number of TLDs. Effectively, each country in Europe will have it's own tld - .fr, .co.uk, .es, .it etc - and visitors from each country will be directed to their version. This bit is done and worked out quite easily.

There will be 3 levels of user;

- me, able to access and edit everything
- country admins, able to edit the config and language for their country
- users, able to make use of the feature set on the site.

Here's the big thing. Each (and every) section needs to be available to different countries in different versions at the same time. This is because the countries have to do translation / localisation for each version, and coordinate marketing efforts.

So - while Ireland might be using public_site version 1.0, France might be using 2.0. Country admins will be able to change their version usage on-the-fly through their CPs.

Each section will include libraries, models and views and will not share these with previous versions (at least, not in a physical file sense - I may copy / paste if there are no changes).

Using controllers is out, because you can't have "controllers/public_site/1.0/public_site.php" and in any case, that would make URL routing a potential nightmare.

The solution that I have worked out is to use the same controller for each section, regardless of version. The controllers only function is to call the library that holds the logic for that section and that version. Version details are held in config files that can be updated by country admins. The controller determines which version to load, and calls a 'handler' function within the library with does everything else.

The library uses the $ci super-object to access all of CI's functions and vars, and reads both the HTTP_HOST and QUERY_STRING to understand what the user wants. Views, models etc are called directly from the helper using $ci.

This allows me to leave the controller (and therefore the URL) the same, regardless of the version a specific country is using. Simply adding a new file under "libraries/public_site/2.0/" will let me add a new version of a section, and updating the config file will allow a specific country to use the new version, while other countries continue with the old one.

Views and models will also be versioned in this way, but they, like libraries, do not suffer from the restrictions on subfolders that controllers do. Substantial bits will be held in databases - such as localised / translated language for the views. New versions will not ba available until the translation has been done by each country - some countries will need more than one language (e.g. Austria - French and German), and all counrties will have access to the English master version.

We are looking at around 30 sections immediatly, and new ones added regulaly.

The site will replace an existing one built on a _very_ different basis that currently suffers from major issues with developer involvement in updates and changes, which is one of the key goals of the rebuild. In terms of usage, the current sites (which will all become one) currently enjoy over 50k views / day, and this is expected to reach 250k by the end of the year (as new countries are added).

Does this make sense? I know it will work, but are there any issues you can see down the line?

Thoughts?


Messages In This Thread
Turning MCV into MVCL: the solution to a mega project? - by El Forum - 04-14-2010, 12:02 PM
Turning MCV into MVCL: the solution to a mega project? - by El Forum - 04-14-2010, 12:22 PM
Turning MCV into MVCL: the solution to a mega project? - by El Forum - 04-14-2010, 01:29 PM
Turning MCV into MVCL: the solution to a mega project? - by El Forum - 04-14-2010, 01:54 PM
Turning MCV into MVCL: the solution to a mega project? - by El Forum - 04-15-2010, 02:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB