tags:

views:

152

answers:

1

I am currently trying to refactor my codebase for an app I am making, I have an existing setup but it is not even close to being flexible and everything is dependent on everything else (aggregated to each class for example).

So, after reading PHP Design Patterns and countless articles on patterns and how they relate to scalable applications, I have come up with a UML diagram for my new codebase.

Since I haven't ever made an application using these techniques, I was wondering if I could get some feedback on my proposed layout, in an attempt to weed out any issues before I start coding.

Code Refactor

Basically I want to be able to support the use of multiple databases (not at the same time, but on a per install basis), I also want to have the option to set a custom session handler, if preferred a DB (or filesystem, cookies etc., if preferred), and support a preferred auth method for secured areas (open id or database accounts etc.).

In summary, feedback would be appreciated in regards to alternative patterns and how they would better suit, or if I am totally on the wrong track, I would prefer to know now :).

A: 

It looks fine to me. Just be careful that you have your interfaces setup correctly if you don't want to end up refactoring in the end.

Think long and hard about what really needs to be in an interface and also don't forget that you can extend your interfaces to create more complex scenarios. If you find yourself writing empty functions to meet your interface you've designed the interface incorrectly.

Syntax
I'll definitely keep an eye on it, thanks.
Asciant