About ready-made frameworks.

Submitted by Anonymous on Sun, 10/16/2011 - 15:01
Written by

Yes, I know I'm a bit late on asking such a question, but what made you to decide against a framework like Symfony or CodeIgniter?


It was common practice a few years back to write everything from scratch, but lately it's considered a better alternative to not re-invent the wheel.

Frameworks provide a steady code-base which is mature, as much as possible bug-free (a lot of projects rely on them = more and more people test them), secure, etc. If you had chosen to develop UseBB 2 based on a framework you'd have more time available to create the script itself, rather than coding all the base functions (like database drivers, caching, template system, etc.).

The main reason is simply because I wanted to build one myself. I was trained as a software engineer (in the past years, after I built UseBB 1) and so I think it is a fun (but long) work to build the framework from scratch.

Next to this, I think it will be a lot easier to integrate various things into the system. Such as the modules system.

I did not investigate all the frameworks, in fact I only have experience with a number in other languages (Java, Smalltalk, etc), but I checked Doctrine ORM for use with UseBB. Turns out that it would be troublesome to build a sort of modules system without the requirement of having to generate proxy classes for every additional module's models. It would even be required to regenerate proxy classes for the system's models whenever a module adds columns to an existing database table.

You see, it should be possible to just throw something in (a module, translation, theme, etc) without having to let the system generate stuff (and require some directories to be writable). This was pretty much how UseBB 1 worked, albeit a lot less flexible.

Of course, I am not saying some frameworks wouldn't allow this. But I did not go through all the available ones but just went on the current route.

Currently, the base framework for UseBB 2 is about 50% done. Note I only restarted just some time ago (not since the initial plans), so I hope to have alpha 1 ready within a number of months.

Also, the framework does not need rebuilding all the time. Likely it will simply evolve for future major versions.

So, if anyone wants to start a new project, he/she is ofcourse free to use an existing framework, but UseBB chose the path of a system of its own, considering all the requirements and ideas (available on GitHub) and the experience with UseBB 1.

A (quite important) update on this: since I recently had a lot of other stuff on my mind and as a result less time to continue the work, I am currently revising the ideas for v2 (yes, again :)).

Without wanting to copy other project's visions and ideas, I noticed many existing forum software projects also plan to use existing frameworks. Also I started working with Ruby on Rails at work and noticed it indeed saves a lot of manual work (as a framework is ought to) but also contains many features that are not strictly necessary but will come in handy and might at some point simply be unavoidable and required. Building this in a custom framework will indeed require a lot of time, which I currently don't have. Even when I already planned to use existing libraries (such as Doctrine DBAL).

So, I am currently leaning towards using one of the existing PHP 5.3 frameworks for UseBB 2, eventually adding stuff required for v2. Some issues mentioned above still apply, but I will see how to fix those. In particular I am not sure (e.g. using Symfony and Doctrine ORM) how a module can add a column to an existing model. (About the code generating, I guess we will have to live with that.)

Many questions still to be answered, but I think this will be the best option for the future of UseBB. The project has been in the intermediate state for too long (1.0 released in 2006), and plans for v2 have existed for too many years.

The code that is already written will be kept in (moved to) a separate Git repository but will probably remain unused, unless anybody decides to still develop this further.

I went through a few potential choices and - given that I would like to use PHP 5.3 and namespaces - my current preference is using Symfony 2 ("full" framework or components). I noticed phpBB 4 is going to use it, same with Drupal 8 which will use some of their components. It also seems the bundles system is pretty much what I want the (partially implemented) modules system of v2 to be.

More investigation and learning is needed, so to be continued... :)

Seems Doctrine ORM does not support columns to be added dynamically. It requires the property to be defined on the entity itself. Extending classes does not help e.g. when multiple modules/bundles want to add a column to the same entity.

I will be checking Propel ORM. It seems it is slightly more dynamic with columns.