This week I would like to talk about the design patterns. I would like to give a little intro to design pattern. As you have probably experienced by now, writing correct computer programs can sometimes be quite a challenge. Design patterns are not language specific either. Good design patterns are implementable in most programming languages, depending on the capabilities of the language of course. They also speed up the development process by providing tested and proven development paradigms.
Effective software design requires considering issues that may not become visible until later in the implementation process. Reusing design patterns helps to prevent subtle issues that can cause major problems later. It also improves code readability for programmers and architects familiar with the patterns. In addition, patterns allow developers to communicate using well-known, well understood names for software interactions.
Correctly using a design pattern is very important. Implement it in the wrong way and it can create more problems than it solves.
In my CS-343 class we worked a little with design patterns and how they work. It is uncommon to introduce design patterns and not explain who the Gang of Four are. The Gang of Four are the authors of the book, “Design Patterns: Elements of Reusable Object-Oriented Software”: Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. The Gang of four design patterns are divided into 3 fundamental groups:
Creational Patterns provide ways to instantiate single objects or groups of related objects.
Structural Patterns provide a manner to define relationships between classes or objects.
Behavioral Patterns define manners of communication between classes and objects.
My favorite book about design principles is “Head First Design Patterns” by Kathy Sierra; Elisabeth Robson; Bert Bates; Eric Freeman. It is one the best for the introduction to this topic. I suggest the first chapter which gives you an understanding of the design patterns. In this chapter, you will learn why (and how) you can exploit the wisdom and lessons learned by other developers who have been down the same design problem road and survived the trip. Before we are done, we will look at the use and benefits of design patterns, look at some key OO design principles, and walk through an example of how one pattern works. The best way to use patterns is to load your brain with them and then recognize places in your designs and existing applications where you can apply them. Instead of code reuse, with patterns you get experience reuse.
From the blog CS@Worcester – Tech, Guaranteed by mshkurti and used with permission of the author. All other rights reserved by the author.