Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Separation of Concerns

The observer pattern also provides good support for separation of concerns—the observers wait around for changes, but they can still do useful work in the meantime.

Likewise, the observable entity is pretty much functionally decoupled from the observers—it shares just an interface with the observers. The separation of concerns allows for changes to be made to class X without having too much impact on class Y.

In the particular case we looked at, the main issue is not changing the interface between the two classes ObserverGui and ObserverEntity. If changes are made without modifying this interface, the good separation of concerns should help avoid unexpected (and often unpleasant!) side effects.

Readers interested in getting into patterns a little more deeply can find much on this topic in reference [1] (see the References section at the end of the article) and in some of my earlier articles.

There is also a lot of work going on in the area of patterns, so this is an active field worthy of study. As I’ve often remarked, programmers should use every means available to move up the value chain.

Patterns are a particularly rich source of information and knowledge of this key area repays the investment in time required to get a basic understanding. I cover the topic of moving up the value chain in much more detail in references [3] and [4].

  • + Share This
  • 🔖 Save To Your Account