I'm about to improve my skills in all that is related to designing applications from scratch using proper OOD principles, involving MVC pattern and using TDD approach to do it.

I have a project for that. I also finished reading a book by Matt Zandstra: PHP Objects, Patterns and Practice

And my question is still left unanswered...

How do I start designing from scratch? Should I start using TDD immediately? It doesn't feels comfortable when u have nothing implemented yet. Should I use code spaghetti just to build working prototype first, understand the scope and needs and only then rewrite all using proper OOD and TDD?

I'd love to get any advice, how to work towards something considered "RIGHT TO DO", or any book that will actually lay down things of how to build the applications form scratch, or design an architecture and dependencies, rather than just throwing lifeless implementation sample codes of Design patterns like Zandstra did.


UPD: Basically, my question is: Is it a good idea to immediately start new project from using TDD and proper OOD, or first write something that works using the most horrible and fastest ways and then refactor everything or rewrite from scratch after you got some idea of how you want your application to look like?

  • There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.
    – gnat
    Aug 1, 2013 at 12:54

1 Answer 1


There's a Lynda.com course called Foundations of Programming: Object-Oriented Design out there where the person giving the course says "when you sit in the front of a code editor, look at the blinking cursor and think now what do I do? the answer always is step away from the code and pick paper and pencil". He says that for a good reason: you can't develop something without understanding first what do you need to develop and how you are going to implement things.

In your question it seems that what you are doing is exactly go straight to the code editor and trying to use OOP without doing first what is called object oriented analysis and design (I've said it seems because I don't really know if you did this process before or not). The idea is that before trying to code something you must know what to code.

So there's a five steps approach that you can follow:

  • Gather the requirements
  • Describe the application
  • Identify the main objects
  • Describe the interactions
  • Create a class diagram

Once you did this, in the end you'll have a good class diagram that will point to you what to develop. Look that this will give you a notion of what the application looks like without having to develop a prototype first in another programing paradigm. Now, when developing each method, I recommend that you use TDD.

So, programming first in another paradigm and then changing later to OOP will be much more painful than starting the right way with OOP. There are good books on object oriented analysis and design out there and there's also this Lynda.com course. Obviously the books and the course are paid but it's worth to purchase this kind of material, since can help a lot in cases like that.

  • Thanks a lot. Could you just give me the name of that course? I can't find it.
    – deb0rian
    Aug 1, 2013 at 15:28
  • 1
    Sorry, I forgot to tell you. The course is called "Foundations of Programming: Object Oriented Design". See if you can find it now. Aug 1, 2013 at 17:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.