Found a Great Design Patterns Book!

August 28, 2007

First off for those of you who know me at all, you know I’m a huge advocate of learning. I consistently have a bare minimum of 3 books stacked on my nightstand (sometimes gathering dust, but they’re there). A book always in my car. Also usually 2-3 books when a travel. With my one goal of doing a little more research to try and pick up just one good idea that’s going to help my php coding, php architecture, marketing copy, negotiations skills, sales skills, motivation, etc etc etc and the list goes on. There’s a very famous quote that says

“If you’re not growing, You’re dying.”

And I seriously believe this with all my heart. That’s one of my passions about this business is there’s always something else to learn. Whether to do with computers, marketing, sales, business, economics, etc. There’s always something to learn sometimes to my detriment. 🙂

Just a small background on myself. Back in August of2005 I knew nothing about computers, for the most part. I could muttle my way around Google and check my email. I even understood what a server was but really had no idea much beyond that. About this same time the company I was working for was about to go into bankruptcy so I got laid off and decided I was going to make a go at another off-line business I was already working part time. Now though the plan was to promote it on the internet full steam.

So after messing around with some SEO, buying a few scripts and reading a couple ebooks I decided I really NEEDED to learn to code. It always seemed like the scripts I bought just needed a few more peices for automation. Or the tracking scripts weren’t quite right. Once I decided that I was going to take the leap and teach myself to speak computer I tried to figure out what language would be the best. Because I had an Excel spreadsheet course in college that delved a tad bit into the VB side I decided to jump into that first. WELL VB sucked for what I wanted to do so I shifted over to PHP. [sidenote – you ever feel like you’re on a tangent? that’s what I feel like right now].

So lets fast forward to the end of last year. I’d been working this business full time for about a year and had picked up some PHP skills through books, trial and error and about 14 hours a day of time. Keep in mind I knew NO ONE in this business at all that could help me forthe most part. I got a little help from the guys in #RSSGM on freenode but not much. By the end of the year I could hack a script together pretty well and could understand most other peoples code. Most of the stuff I wrote really looked like spaghetti was a nightmare to alter, update or maintain. You know what I’m talking about right? Where there’s a couple functions at best! And the rest of the code is like 300-500 lines of all procedural… Have you ever tried to change or maintain something like that?

As you know things in in the Internet Marketing business can change rather quickly. Let’s say you have a Squidoo lense builder. Today it could work tomorrow they could change the whole thing. Or maybe you built the system around a niche and then you found out another niche was very profitable as well. How hard is it to change your scripts that involve building, research, tracking, interaction with the providers, etc etc. It’s a pain isn’t it if all your code is procedural.

The other thing I was beginning to notice at this time was that I was writing the same code again and again. Think about this for a second. What are some common themes to building an account on something like Blogger or Squidoo. Is there commonalities among those? You betcha! So rather the rewriting your code over and over again I figured there must be some way to make my code reusable or at least build a basic framework for things that I was doing repetitively. Because I’ll be honest with you I really enjoy making the interaction classes. Doing things like tracing headers and figuring out nuances of how to reverse engineer a website or web service. That part is fun to me. However once you have all your interaction classes built, making the management side is usually pretty boring in comparison.

Code architecture… what the fuck is that? That’s what I was asking myself when I first started looking into it. Now keep in mind I’m just a businessman that’s decided to learn how to code out of seeing a great profit potential. I’m as far from a coder as one could possibly get. Or at least was. I think I’m getting closer and closer to being a real coder everyday ( not sure if that’s good or bad ). But that strictly comes out of necessity for building bigger and bigger systems. Now keep in mind this isn’t Windows XP we’re talking about. But the systems I’m building do seem to get larger and more elaborate all the time. Because of this I’ve forced myself to switch to Object Oriented Programming which I knew nothing about 6 months ago.

So back to those books I was talking about in the beginning. I buy at least 2 books a month if not a lot more. Was wasting some time today and went to Borders Bookstore. knowing I really want to learn code architecture basics I’ve been snapping up quite a few books about object oriented coding, design patterns, UML, and Use Cases in order to find one that might help me get one more good idea and put the puzzle pieces into place just a touch more. Typically I’ve been having to buy books that revolve around Java as most architecture stuff is written for Java or C/C#. Java really isn’t hard to understand once you have a firm understanding of how the OOP basics work in PHP.

So at the bookstore I made a couple of purchases today but there’s one I’m really stoked about. and that’s (drum roll please)

“Design Patterns for Dummies” – Steve Holzne, PhD.

Now, laugh all you want and talk shit all you want but I’ll be straight forward with yah. I’m not the smartest tool in the shed and a lot of times I need things broken down into Engrish ( for you DigitalPoint guys ), especially tech stuff, as that’s not how I think usually. I’m a huge advocate of the for Dummies series yes some of them really do suck. But I’ve bought every non-Dummies book I could get my hands on about design patterns ( probably about 5 – 9 books ) and just haven’t been able to wrap my head around things. Some people just get it, some people don’t. I think I’m one of the ones that don’t. Persistence is the one attribute I do have though, if I really want to do or learn something there’s not much that’s going to stop me. I know some of you have looked at my suggestions for learning PHP and really the for Dummies books are excellent if you just don’t get it or need things broken down and simplified just a little more. Design patterns are a fairly hard concept in my opinion, especially real composition. However there’s some really cool stuff you can do with them that will save you a TON of time in the long run.

On that note I’ve been looking for a good pattern for sometime that I could use to interface a lot of sites that all do similar things. Lets take making blog posts for example. We all know not all public hosted blog sources support XMLRPC. Therefore we might need to do XMLRPC posts to some, form posts to others and maybe email posts to other still. Now just for fun lets say we had 50 different hosts, all places we could host blogs for free.

How could we go about designing a system in such a way that we could treat them all the same and handle them all the same way from a management side?

And really encapsulate the specific functionality of each to be maintained separately?

What are some of the things that might be in common between them? Login(), Post(), UpdateBlogroll()?

Wouldn’t it be cool to be able to treat all these different hosts the same from the prospective of the management layer? Well check out the Factory pattern it might be what you’re looking for…

newsletter

Want More? The more people listening the more I’ll write.
Subscribe to get business insights in your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.