Forums / Cotonti / Core Labs / Archive / CMF for Cotonti

Analysis, synthesis, discussion

Trustmaster
#23748 2010-03-24 19:46
Intro

Cotonti is constantly growing. Siena will be more modular and it will provide various APIs for different aims which were previously achieved by hand-scripting, hard-coding or not achieved at all. These are still mostly core-related, so we like to keep them short and clean.

Meanwhile the web industry has changed a lot and pure CMS are quickly loosing their positions in the developer world. Custom applications should be built rapidly, more reusable components are required.

The question is not if Cotonti needs a CMF, the question is what CMF it needs and how tight they should be integrated.

CMF synthesis

Well, Cotonti comes with some CMF features:
  • clear structure
  • database abstraction layer (not such a good one)
  • template engine
  • internationalization
  • authorization management
  • configuration
  • cache
  • debugging tools
  • URL rewriting
  • form generators
  • pagination
  • validation (could be more verbose)
  • AJAX helpers
  • security tools
  • and more.

What it misses as a CMF is:
  • controllers
  • CRUD (create/retrieve/update/delete behavior for basic entities)
  • ORM
  • routing (rather than just URL rewriting)
  • putting it all together in pure OOP

Existing CMF

There are loads of CMF systems, but keeping Cotonti principles in mind, the choice is very simple because it must be
  • Fast (bye-bye CakePHP, Symfony)
  • Lightweight (bye-bye ZendFramework)
  • PHP5 (bye-bye CodeIgniter)
  • BSD/MIT/Artistic license (bye-bye Doctrine ORM)
  • Stable and large community support (bye-bye Doo)

This is how I have come up to Kohana and Yii. But Yii uses components and widgets much like Prado, so it very far from what we are used to with XTemplate. Kohana appears to be more flexible.

Own CMF

I've been working on reusable OO components for Cotonti for year by now, it's mostly CRUD/ORM and some behavior common to many Cotonti modules and plugins. I've completed several projects using these libraries, but I can't get rid of the feeling that it's still a lot of work to do which is just reinventing the wheel.

The only true reason of continuing work on an own CMF is that Cotonti really has its own spirit and its own code practices, which will be broken if building on top of some other framework.

Rebuilding everything with some CMF

Thinking it over realistically, it's nonsense. Why? It will take 6-12 months just rebuilding without any new features being added and a lot of new bugs introduced. Which is suicide.

Using Kohana (or something) for module development

I'm experimenting with it these days. To be exact, it's Kohana3 I'm experimenting with because I like HMVC and some other things in v3. The problems I have encountered are:
  • Routing is hell when trying to get Kohana work on a Cotonti site
  • Directory structure is very different too
  • Probably Views should be completely different (XTemplate) from what Kohana comes with, but it's not a big problem because Kohana is flexible at this point

Considering Kohana integration, there are 3 different ways of doing it:
  1. Each module as a separate Kohana application
  2. All Kohana modules as a Kohana appilcation
  3. Built-in Kohana components in the core

These are my thoughts for now, share yours.
May the Source be with you!