separation of concerns

Separation of Concerns is like the Single Responsibility Principle, but in a larger context. You basically split different parts of your application into different parts in your code. If you build a RSS reader you can divide you code into the following sections:

  • download the RSS feed from a URL
  • parse the feed, and extract the relevant data
  • display the feed to the user

This has following advantages:

  • extensibility & maintainability
  • multiple developers can work at the same project at the same time, each one has its own clear defined task
  • you may be able to reuse large parts of your code for other projects, for example the download part in a weather application

This is maybe one of the most important principles there is, and probably every developer uses this to some degree instinctively, even without knowing its fancy name. The better you divide your logic, the easier development is.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *