The Importance of Refactoring Your Database Schema

Programming an application is a pretty daunting task.  There are similarities between all applications but significant differences that require a programmers to work together.  The more I work on “rescue” style projects or help out in the open source world, the more I think that programmers need to sit down and think through the database design.

When it comes to designing a good schema you need to know most of the requirements.  I say most because trying to know all will lead you astray, this is software development after all.  For my Trail Status project I kept the schema small, but when the project starts to grow it can easily adapt into a more well rounded schema design.  Here are the project requirements for data to be stored:

  • Trail state (open/closed)
  • Coordinates to trail
  • Name
  • Translation (if translated from phone call)
  • URL slug

If the table grew to more trails without adapting or refactoring the schema you would be setting yourself up for failure.  What happens when there are more states like permanently closed, open soon, or under maintenance? If I let the data just grow without refactoring the schema I would be adding unnecessary code to try and manage my mistake.

Here is your challenge…

The next time you work on anything: pick a table and try to find a way that the schema design can be refactored.  Kudos if your schema is up to snuff! I know most out there need a good cleansing.

How to Separate Concerns with Legacy PHP Apps and Composer

logo-composer-transparent3Legacy PHP applications get a bad reputation.  They are constantly ridiculed for being hard to work on, lots of repetition, no unit testing, etc.  There is a straight-forward way to approach code when you come across it.  I’ll show you how you can start separating classes using Composer in this entry.

Continue reading “How to Separate Concerns with Legacy PHP Apps and Composer”

Using Silex to Refactor a Legacy PHP Application

We have a legacy application here where I work, MRS.  In my last post I talked about putting in place a front controller as the next logical step.  I started to take a different, more thoughtful, approach after discussing with my co-workers.  I used Silex.

Continue reading “Using Silex to Refactor a Legacy PHP Application”