php - Moving a system from sort of a class system to an MVC format -


I am working on a large system developed by another programmer which no longer works here.

And since I'm a frantic serial killer who keeps it up and knows where he lives.

But fun things aside, the system is developed as a class system and not a little bit, I'm already setting up a developer version and can deploy new versions very quickly. I am

  1. Do you have a suggestion about partial tricks of a new model (I can not make a complete transition, get time)
  2. I recommend the names of those which I can leave in the system (without feeling like a hack) but will not fight with names of current class (user, data, logging, etc.)
< P> Thank you.

tip # 0) Does the actual current code really be really bad, or is it your personal preferences Is not it? If it is pre-existing then continue reading this list. If this is the latter, take some deep breaths, and before spending at least a month or two, decide to know things that you have to do it again.

Tip # 1) When you coding, if you see something that is not correct then fix it, it will take longer, but ultimately you will get productivity benefits because the system gets more 'fixed' If in fact you do not have time to fix it then do yourself a favor and add a comment like this: / / TODO: Talk again, after X, when you have time, just " TODO: Find your code for "A list of stuff for you" You can also level them, such as "Todd-High", "Todo-Medium", "Tod-Lo" if you use Ellepsy as an editor for your Eclasses or Zend studio as your editor / IDE You can set it to find it automatically & amp; Priority-> Work. Flag these for you in

Tip # 2) If you anticipate (ultimately) infection for MVC, one important thing is to separate the HTML from logic, this means using templates. This task is a long time It can take, but once this happens, the rest of your infection will be very easy.

Tip # 3) Try to establish conventions. Examples: Controller & amp; Look up the name should correspond to the URL, and remain in the same directory for the URL. 1234: / places / edit / 1234 Controller file to replace URL: /htdocs/sitename/controllers/placesController.php Template file: /htdocs/sitename/views/places/edit.tpl

Tip # 4) Read 'Getting Started' tutorial for major frameworks: Zend, KPPHP, Code Igniter / Koha, Symphony. See if you look better than others ask yourself why you like it, whether it will work for you, or you need to roll your own structure (suspicious). If possible, then an existing structure Use it already has been bug-tested by hundreds or thousands of people, and you will save at this time! I like the Zend Framework myself, and this is particularly good for you "transit projects" because you can take it or leave a piece at a time. I mean, you can choose to use Zend's object only, or only use it DbTable object, you are free to leave it as much as you want, that means you can gradually increase your speed in a Zend-World Can transition. Ezip-organism works in the same way.

Tip # 5) Wrap the sections you use to raise them. For example, I use Zend_Acl, but actually uses my own ACL class which extends Zend_Akcll. It has two main effects: a) I can swap some more Zend AAdds without changing my code, because this all refers to the plain old 'ACL' B) I can modify that Z.A.Akl is my specific needs. How to work, because I can override the methods I like in my 'ACL' class.

Tip # 6) Try shopping from management, explain to them that refactoring will actually save them money, because this will increase stability; Understanding of code, which helps in reducing the number of defects and makes it easier to find & amp; Okay. Try reading books on the subject, such as "Refactoring: Improving the design of existing code" by Martin Fowler


Comments