About Chapter 1. Great Software begins here.

At the beginning of our education, we are taught how to program and we start coding program to accomplish some tasks. When the task becomes bigger or the requirements suddenly change, we need to start developing a plan on how to write really good code.

Chapter 1 of the book «Head First Object-Oriented Design and Analysis» focuses in this issue in a way that is easy to understand to unexperienced programmers.

For a client, a great software is the one that does exactly what he wants and doesn’t broke or do weird stuff, so it is the cornerstone in software development: do what the client asked for.

In the book example, we reviewed a software to manage client searches in a guitar store. To accomplish with this, the book showed a solution that used ENUMS instead of strings for the comparison (in order to avoid issues with misspellings, and it works!)

Later, we must think about using the benefits of object oriented programming to simplify things and make the code looks better. As the book says: «there’s not a bunch of duplicate code and each object pretty much controls its own behavior». OOP allows all this and more and a good programmer should use this kind of thinking at the moment of designing a solution.

In the book, they proposed some encapsulations to avoid code duplicated and make the code robust. The general rule is that we should encapsulate all things that may vary. Also, this part of the chapter gave us a little insight about Test Driven Development, because for every new functionality, they created a unit test to verify that the behavior is as expected.

Finally, when you have this vision about possible incoming new features, you need your program to be scalable and deal with any new requirement. Here is when design patterns enter the game.

In our example, the task was to anticipate a new feature (guitars with 12 chords) and make the search engine capable of deal with this kind o queries. The key topic here was encapsulation of certain properties to make it easy to search for complex products with different specs.

Although the design patterns weren’t so present during the chapter, at least it gave us a little taste of all the potential they have. Summarizing, it is fundamental to have in mind these three steps at the moment of write some code to solve a real problem.

Bibliography:

Head First Object-Oriented Analysis and Design: A Brain Friendly Guide to OOA&D. A McLaughlin, B, A Pollice, G, A West, D. 2007. O’Reilly Media, Incorporated.

Deja un comentario