Design Patterns Study Group
Wednesday March 8, 2006 ·
17 views ·
0 comments
Last week we had our first Design Patterns study group meeting, we have centered our learning around the book
"Head First: Design Patterns" published by O'Reily. We chose this book over
Design Patterns: Elements of Reusable Object-Oriented Software written by the Gang of Four (GoF) because we felt the Head First book did just as good of a job of explaining the patterns and object-oriented principles, but is a much easier and more interesting read. I highly recommended this book to anyone (or corporate group) that would like to begin learning Design Patterns or needs a refresher on Object oriented design.
The first meeting we had was on the Strategy Pattern, I volunteered to lead the discussion on the topic since I recently incorporated the design into the project I've been working on. I first started off with a discussion of Design Patterns in general, I think that we all understood the benefits of knowing and implementing these practices in our projects. My favorite, being the bridge of communication and intent that the patterns deliver. All members of the development team (project managers, architects, developers, ect..) who understand the pattern, also understand the problems that application faces and how the team intends to solve them. Making sure everyone in large development groups are on the same page is important.
I moved the discussion into the example given by the book, the SimUDuck app (Head First provides great motivation problems to solve). We stepped through the initial difficulties and requirements of the example, drawing out the class diagrams and talking about the downfalls of their early solutions. I then mocked up how the problem was solved using the Stragety Pattern and we talked about how it made most sense to implement that design. The discussion was then followed by a class diagram and overview of the implementation that I had used for my project. At times it felt like I was in another code review, but that was expected and encouraged. I was interested to see what the opinion of my fellow developers was in my implementation of the patter, I'm not an expert in OOD so the extra criticism and questions were meaningful. The session was closed up by me asking the group two questions, 1. how can you combat the over use of the strategy pattern, are there better ways to manage the 'strategies'? and 2, what are the different ways to delegate information from client and context to strategy and back if necessary.
Overall the session went great and I'm really looking forward to our next meeting which will be about the Observer Pattern. In anticipation, I have created a simple 'Subject' class for JavaScript to implement the pattern.