This isn’t what you think. I have not been drawing way cool software design patterns in the snow.
I have a design pattern question, although it would be so much more clever today to say that I have had a design ephiphany (yes, today is ephiphay for all you reprobates). I am looking for patterns for designing user interface pages. In particular, I’m curious about the pros and cons of using inheritance compared to other approaches of reuse. Sure I should know some of this by now, but this is the first time I’m working with web pages generated from an OO framework on the server-side, in case that cuts me any slack. I simply have never studied any UI-specific design patterns before. My CICS background really can come in handy with browser-based thinking, but it doesn’t get me into an OO frame of mind.
We have two pages that do “pretty much” the same thing, with some differences. One feature set is almost a superset of the features of the other, but they address different audiences. In this case, one is related to people and the other to organizations.
Using the Cache’ OO framework with these web pages, we could have a single base page with the shared functionality and extend it for each of these pages. We could otherwise make shared features into reusable code that is used by each page, so that each page is completely separate without this shared superclass. I have this feeling that someone reading this will think this is a really dumb thing for me to think more than two seconds about. Ah well, I was simply going to google a bit and move forward.
I likely didn’t invest enough time googling, perhaps because I already know I’m going the super plus two subclasses route (it seems to be working nicely, I’ll interject a couple of hours later), but what I was finding when searching for /”Design Patterns” UI OR User Interface/ and variations on that were patterns for what the user sees.
The answer to my question might not be in there, and maybe I should get off my arse and see if anything in the Head First Design Patterns book would be helpful, but instead I will again lament that fateful day in winter, roughly a decade ago, when I paid the bucks to buy the Gamma, Helm, Johnson, Vlissides Design Patterns: Elements of Reusable Object-Oriented Software book. I was pleased as punch, eager to read it.
I left the bookstore and headed to my hair appointment. Bookstore and hair appointment in one day? you might ask. Ah, yes, I do know how to live. So, I brought my new book into the salon with me, in spite of having to give up reading the latest theory about Princess Diana in People magazine while I wated. When I got back to the car, it took me two hands to find my keys, so I put the book in its bag on top of the car (you know the rest, right?), and, arghhh, drove off with it still up there. When I got home without the book, I went out immediately and did not find the book anywhere. Perhaps it stayed on the car for a while and got thrown into a snowbank as I rounded a corner or so.
I searched again three weeks later after the snow melted. No luck. Maybe someone else was delighted to find Design Patterns in the snow. That’s probably for the best. I don’t need theory getting in the way of progress anyway. There’s too much to do to do it right, right? (Yes, I’m smilin’). By the way, our project officially kicks off the new year this Saturday, so this week everyone is on their own, free to make their own design patterns in the snow.