Skip to main content

Exercises in Design Patterns

I had a really eloquent version of this post all worked out, but for some reason it choked when I submitted it, so this will be a less eloquent, abbreviated version.


Apologies that I've been in a cave lately. I've had the typical end-of-the-year project pileup to dig out from under, but in the course of working feverishly on some of these projects, I've taken the opportunity to take a much closer look at some design patterns, specifically in my case DAOs and how to use them better and more effectively.


 


I've been using DAOs in Mach-II projects for quite some time now, and although it's been working great I realized I've been using them a bit prescriptively without *really* digging down deep and understanding all the surrounding issues, gotchas, and possibilities. So I've been reading, researching, and reading some more over the past few weeks and I'm starting to have some revelatory insights on some things.


The purpose of this post isn't to share any insights--they're far too half-baked at this point, but you better believe I'll be sharing in the very near future. I'll be thinking out loud and talking to myself a lot over the coming weeks, so please don't be alarmed. I'm not insane, I'm just obsessed. :-) I do think it's appropriate for me to make a few general comments at this point, largely brought on by the introspective season we're in.


First, always be challenging yourself. I'm at the point now with a lot of more advanced OO concepts that I feel like I'm at least starting to "know what I don't know," and it's really inspiring me to go nuts with learning this stuff. I've already looked back and stuff I've written over the last year and seen how much better I could have done things had I known then what I know now.


Second, I'm a bit surprised at the lack of comprehensive CF-specific code samples and literature about OOP and design patterns. It's starting to emerge on some really great blogs (I'll post links later--it's late and I'm beat), but I'm going to do what I can in the coming year to contribute to this area, which I feel is pretty lacking. Since I have a Java background I've been getting a lot out of reading the Java materials, but if we as CFers are going to take our craft to the next level and bring others along with us (kicking and screaming if necessary!), then I think we need our own set of knowledge and literature.


Finally, I'm in the process of rebuilding the Dallas/Fort Worth ColdFusion User Group web site, and I'm going to apply as many of these concepts as I can to this project. For the purposes of the site a lot of it may be overkill, but these sorts of projects are perfect for applying theories I may not have put into practice yet. Once I get the site in a better state of completion I'll share the code so others can learn from it (or rip it to shreds as the case may be!).


Happy Holidays CFers, and if you haven't made the commitment to start doing OOP yet, make 2005 the year in which you do it. Seriously. Not only is it a necessity from a career standpoint, it will make your development life easier and more fun, I guarantee it.


Comments


Can't wait to see your interpretation on the patterns with CFMX ( I mean that in a good way). I also think the reason you don't see OOP Patterns discussed in the context of CFMX, is because its regarded as a "Nice Object approach to procedure code". Thats what a lot of the purists have worded to me about anyway, saying its not even *REAL* OO - debatable. So yeah, J2EE seems to be a main source of mirrored conceptulizations which sux as you kind of need to know Java in many ways to understand it. I think we should all (blogs I mean) finalize one big uber blog-fest for 2005 on the subject, and PDF for the future CF'ers heeheheh...


Thanks Scott--I've certainly gotten a lot out of your conversations in Sean's Breeze room as well as from your blog. I definitely agree with the notion that we need to ban together and blog the heck out of this stuff, and I've already thought about a series of articles (instead of just blog posts) for distribution as PDF (or FlashPaper! go MM!) so it's a bit more easy for folks to take it along, print, etc. Once we all reach a consensus on everything (or even have 2-3 "best practices" for each of these areas) I think it will prove to be a great resource for CFers. Blog posts and subsequent comments (great place for us to hash out the details) can serve as great fodder for more formalized documents, tutorials, etc. (And let's not forget those who are OO newbies, because these are numerous with CF; OO-101 stuff would be extremely valuable in addition to more advanced topics.) On that point, the other thing I think CF literature does a poor job of is indocrinating people into OO from the start. Yes, CF is intended to be easy to learn, etc. and I don't think CF should lose that strength, but I think a lot of CFers don't get into OO because it's presented as "advanced" or "that weird other thing that a handful of people do." Once people get their feet wet with CF syntax, etc., OO should be presented as "the way you should be building things." In my opinion it's not gaining traction because it's seen as unnecessary or esoteric. Opening people's eyes to the huge advantages and presenting it as how you do CF will help in this regard. As for whether or not CF is "real OO," you're right, that's debatable. I don't typically engage in that debate because there's no denying CF is missing some hallmark features of true OO, but in my mind nitpicking kind of misses the point. (Not saying you do this, but some folks do.) Let's push things and do as much as we can with what we've got rather than not doing OO at all because this or that can't be accomplished in CF.

Comments

Popular posts from this blog

Installing and Configuring NextPVR as a Replacement for Windows Media Center

If you follow me on Google+ you'll know I had a recent rant about Windows Media Center, which after running fine for about a year suddenly decided as of January 29 it was done downloading the program guide and by extension was therefore done recording any TV shows.

I'll spare you more ranting and simply say that none of the suggestions I got (which I appreciate!) worked, and rather than spending more time figuring out why, I decided to try something different.

NextPVR is an awesome free (as in beer, not as in freedom unfortunately ...) PVR application for Windows that with a little bit of tweaking handily replaced Windows Media Center. It can even download guide data, which is apparently something WMC no longer feels like doing.

Background I wound up going down this road in a rather circuitous way. My initial goal for the weekend project was to get Raspbmc running on one of my Raspberry Pis. The latest version of XBMC has PVR functionality so I was anxious to try that out as a …

Setting Up Django On a Raspberry Pi

This past weekend I finally got a chance to set up one of my two Raspberry Pis to use as a Django server so I thought I'd share the steps I went through both to save someone else attempting to do this some time as well as get any feedback in case there are different/better ways to do any of this.

I'm running this from my house (URL forthcoming once I get the real Django app finalized and put on the Raspberry Pi) using dyndns.org. I don't cover that aspect of things in this post but I'm happy to write that up as well if people are interested.

General Comments and Assumptions

Using latest Raspbian “wheezy” distro as of 1/19/2013 (http://www.raspberrypi.org/downloads)We’lll be using Nginx (http://nginx.org) as the web server/proxy and Gunicorn (http://gunicorn.org) as the WSGI serverI used http://www.apreche.net/complete-single-server-django-stack-tutorial/ heavily as I was creating this, so many thanks to the author of that tutorial. If you’re looking for more details on …

The Definitive Guide to CouchDB Authentication and Security

With a bold title like that I suppose I should clarify a bit. I finally got frustrated enough with all the disparate and seemingly incomplete information on this topic to want to gather everything I know about this topic into a single place, both so I have it for my own reference but also in the hopes that it will help others.Since CouchDB is just an HTTP resource and can be secured at that level along the same lines as you'd secure any HTTP resource, I should also point out that I will not be covering things like putting a proxy in front of CouchDB, using SSL with CouchDB, or anything along those lines. This post is strictly limited to how authentication and security work within CouchDB itself.CouchDB security is powerful and granular but frankly it's also a bit quirky and counterintuitive. What I'm outlining here is my understanding of all of this after taking several runs at it, reading everything I could find on the Internet (yes, the whole Internet!), and a great deal…