13

I've decided to completely rewrite a PHP framework (Using MVC) that I've been working on, on and off, for years. My problem up until now was that I would just come up with ideas, throw them into Trac as tickets, and add them later - without worrying about the design of the framework itself. Over time this has caused some problems and I think a rewrite would be helpful, however I'm not sure where to begin with the planning of it - I know I don't want to use Trac, and I know I need more than just tickets and milestones - but what else would I need?

I really want to thoroughly plan this rewrite out, I want to detail every feature I want, where it will go, and how it will connect to every other part - but I have no experience with this level of planning. Any advice? Any programs that will help? I'm getting tired of Trac, I've never really liked it.

I know I'll need a design document, but is there any certain layout I should follow? I'll also need bug tracking, tickets, milestones, etc., but beyond Trac I don't know what's good for that either. I'm sure there's more I'll need but I have no idea what, so any help would be appreciated.

Jon
  • 232
  • 1
  • 6

6 Answers6

11

I would suggest to refactor heavily instead

The Problem you anticipate here:

I really want to thoroughly plan this rewrite out, I want to detail every feature I want, where it will go, and how it will connect to every other part - but I have no experience with this level of planning. Any advice? Any programs that will help? I'm getting tired of Trac, I've never really liked it.

is a real tough one. It is basically the Waterfall model with all its uglyness. Here's some anecdotical evidence for the problems with the 'great rewrite' approach, that comes to the conclusion: you will probably not anticipate the problems correctly, and end up with another mess you want to rewrite from scratch. Not because you're bad, but because it's impossible to get something big right in one shot.

When you instead start to refactor, you can write individual tickets and you can continue using the project. The trick here is to identify smaller changes that lead to an overall better design.

For example: you mention, you have no MVC, but you want to. As a first step, you could take a single PHP-file, and, assuming the usual mixup, sort it, so that in the top you have all db-access, calculation, etc, in the bottom you have the "templating" (first tickets, for each file). As a second step, you could encapsulate all these templating parts into functions, that get their parameters passed. (a lot of more tickets). Done? Congrats, you finished your V in MVC.

keppla
  • 5,210
  • 26
  • 32
10

If you are going for a complete rewrite, why not also consider if you should be using php at all? A change/upgrade of technology might be the catalyst you want to improve your design/scalability/maintainability etc...

TheLQ
  • 13,650
  • 7
  • 56
  • 88
7

See below some things I do when developing a big project:

1 - I use a planning tool like OpenProj and add all the features I want to include as a task. For example, right now I am working on a feature to allow my users to automatically log on after they register in my site. I have a task in my plan like "feature-autologin".

2 - I am a one-man development shop so I usually move from one feature to the next. My plan is created in a way that all features are sequential. I don't invest too much time estimating how much time I will need for each feature. I usually consider that each one will take me a day to develop. If one takes more, I simply update the plan and all the future tasks move accordingly.

3 - I use git extensively. Each feature is a branch. Once I complete each feature, I merge it back to the development branch and create a new branch for the next feature.

4 - If I find a bug in the software I create a small git branch to fix it and merge it back once it is resolved. I make sure I update both the development branch and my current feature branch I am working on. By the way the bug becomes another task in my OpenProj plan. Something like "bug-wrong-address". And when I insert it, all the other features get moved back in the timeline.

5 - While I am developing, if I think about a new feature, I simply include it in the plan where I think it will best fit and adjust the timeline again.

I hope this helps. It sounds like you have an exciting project ahead of you. Good luck!

jdias
  • 186
3

Consider using an existing framework. CakePHP, Zend Framework, CodeIgniter and Symfony are the known ones for PHP. If they cater the needs of hundreds or thousands of users, I'm sure they can cater yours.

If you're willing to learn/use something other than PHP - Django (Python) and Rails (Ruby) are pretty much the leading frameworks for conventional web applications.

That's, of course, unless you want experience creating frameworks - which, I might add, is of much less value in the market (rather than knowing how to use existing, supported frameworks well).

Yam Marcovic
  • 9,390
1

What I enjoy using is Redmine as a schedule tracker. IT handles each of those items very well, along with being so much more user friendly (in my opinion) than trac.

Regarding your re-write, it's important to first understand you will never anticipate every feature / new extension that can come up, so to try and write your application as flexible as possible. Using many of the MVC frameworks which PHP has can help leverage this; however some of these frameworks also pidgin hole you if your DB architecture isn't flexible from the start (Cake). I would really focus on making things as abstract as you can, and whenever you see something hard coded ask yourself what it's for and why can't it be stored in a DB.

Really DB design helps answer so many questions and issues, and is where I see the main importance of how your application interacts; so I would recommend spending a good majority of time analyzing how the data is stored, and how your DB is structured.

Petrogad
  • 111
1

As a issue tracking software, JIRA is great, but it's very expensive. Another good tool that i'm using is Eventum. It's free.

But the most important part is to have a good idea of what you need. First you have to gather the requirements for your application, to have an overall feeling about what you want and as complete as possible.

Based on that you will create software requirements, that is a more technical approach in which you'll describe the modules that will be part of your application, their functions and sub-functions, objects, classes, their interfaces, just about everything.

By know you'll have a good understanding of the complexity of the application and the lines of code needed, so you can make an estimate and create a schedule. It's important to have a schedule and deadline, or else you may end up never finishing it.

Hope it helps