No 1 Design Principle in software development

Head First Design Patterns

There are always changes in software development. No 1 Design Principle is to identify the aspects of your application that vary and separate them from what stays the same. As simple as this concept is, it forms the basis for almost every design pattern. All patterns provide a way to let some part of a system vary independently of all other parts.

Take what varies and “encapsulate” it so it won’t affect the rest of your app. And later you can alter or extend the parts that vary without affecting those that don’t. This will result in fewer unintended consequences from code changes and more flexibility. If you've got some aspect of your code that is changing, say with every new requirement, then you know you've got a behavior that needs to be pulled out and separated from all the stuff that doesn't change.

Other principles:

  • Favor composition over inheritance.
  • Program to interfaces, not implementations.
Other points:
  • Patterns provide a shared language that can maximize the value of your communication with other developers.
  • Knowing the OO basics does not make you a good OO designer.
  • Patterns aren't invented, they are discovered.
  • Good OO designs are reusable, extensible and maintainable.
  • Patterns don’t give you code, they give you general solutions to design problems. You apply them to your specific application.

Popular posts from this blog

How to get Active Transactions and Locks from MySQL

Example of a PAC file