devxlogo

What Are Design Patterns?

What Are Design Patterns?

A design pattern is a design solution to a software problem that occurs within a specific, recurring set of situations.

Let’s say you are making software for a problem situation that involves a heat sensor, and an overheat alarm. And let’s say that whenever the sensor senses temperature above a certain threshold, you’d like the alarm to go off. One way of dealing with this is to have the alarm trigger part constantly poll the sensor. this works, but is a bit wasteful. A more intuitive way is to treat the alarm trigger on a need-to-know basis, that is, have a mechanism that would enable the sensor to send a message to the alarm trigger whenever the heat threshold would exceed.

Now, expand this situation so that it can apply to problem domains other that heat sensor: You’ve got mail notification, account balance negative notification, delivery failed notification, etc.

Here, we are dealing with a problem that shows a pattern of occurrence in a similar problem context with different problem specificities. A solution for the this kind of recurring problems that concerns the context, and not the specificities of the problem is a design pattern.

For example, for the problem above, pattern practitioners have devised the “Observer Pattern”, whereby a party interested in a certain event expresses its interest to another party watches for that event, the latter notifies the former if such event happens.

You can also think of design patterns as recipes for design, or reusable design works that are devised to solve a specific, recurring problem.

There are many design patterns published in a variety of books, or journals, or on a variety of web sites.

See also  The Art of AI-Generated Meeting Minutes

A good place to start is “Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley, 1995)” by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. These guys were pioneers in design patterns, and most, if not all, of the patterns presented by them are widely used by software designers.

Another good book is “Patterns in Java (John Wiley & Sons, 1998)” by Mark Grand. This one runs over three volumes, and uses Java to code its patterns.

You can also check:

http://hillside.net/patterns/patterns.html http://www.objenv.com/cetus/oo_patterns.html http://rampages.onramp.net/~huston/dp/patterns.html

The true power of Java lies in its Object Oriented facilities. Familiarity with design patterns will enable you to identify recurring design situations, and let you reuse other object practitioner’s design works.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist