Want to learn OOP?
July 06, 2009
I saw a post from someone wanting to learn Object Orientated Programming over on the Drewcorp Coding blog. I started posting a comment but it got a bit long and I figured it deserved it's own post. So here are my thoughts on learning OO.
A couple of people had commented on the blog that Andrew should download Coldbox and check out the CodexWiki. Whist I think ColdBox and the CodexWiki are great examples of good code, I also think they are bad place to start. CodexWiki use ColdBox, Transfer and ColdSpring so it's a lot to learn in one go and will probably scare you off never to return.
First off, good luck to anyone who embarks on the OO path. It's a never ending journey (you just keep learning) and it gets tough in places but is worth the effort. I'm relatively new to OO and so I know the pain of getting started, when it just seems to be a blur of jargon.
Can I suggest that you start simple and look at some really simple examples to get the concepts in your brain before you even look at what frameworks can do for you.
Some framework agnostic things to check out:
Blog Posts
Doug Boude's OO Terms In a ColdFusion Context
http://www.dougboude.com/documents/dougboudeslexicon.cfm
Matt Woodward's CFC-101: An Introduction to OOP in CFMX
http://www.mattwoodward.com/blog/index.cfm?event=showEntry&entryId=0192EF43-AD5D-07AE-533106DEB4F48B37
Nando's mini OOP series
http://aria-media.com/blog/index.cfm/oo-in-cf
Online Presentations on UGTV
Michael Dinowitz's OO Programming with CFCs:
http://adobechats.adobe.acrobat.com/p90923191/
Bob Silverberg's Building An Object Oriented Model:
https://admin.na3.acrobat.com/_a204547676/p21244086/
Once you've got a handle on those things, then I recommend look at an ORM like Transfer or Reactor. The Transfer sample blog doesn't use any frameworks so is great for learning how to use objects, as there is nothing to distract you. After that you will probably have a pretty good idea of how OOP works so you'll have a good idea what you want to learn next, but an MVC framework like ColdBox would be a good choice as it has some great sample apps.
Whilst I'm not as clever as the guys listed above, I have written a few posts a while back on OO terminology which may help as knowing the lingo definitely helps when you read other material. The posts are here. I've also done a couple of presentations which you can see here
Of course, the most important thing of all is to write some code. Yes you're going to make mistakes (I make loads), but there is no better way of learning. You can always ask some really smart people what you're doing wrong on the via the CFCDev mailing list.
If anyone else has any recommendations please let me (and others) know!
- Posted in:
- ColdFusion
- OOP
10 comments
Leave a comment
If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)





I really appreciate the post.
I was starting to wonder if I should put off frameworks until I've mastered ColdFusion a bit more thoroughly. Perhaps with the articles you noted I could figure a place to start.
I especially liked Doug Boude's OO Terms article - it really puts it in perspective.
I'm still wondering, though, how people learn this stuff? Do self-taught programmers usually structue their own code for a few years before recognizing a problem that frameworks solve? Or would it be best to start learing CFML and a framework simultaneously?
Thanks again for your great response.
Comment by amclean – July 06, 2009
www.iknowkungfoo.com/blog/index.cfm/2007/8/22/Object-Oriented-Coldfusion--1--Intro-to-Objectcfc
Comment by Dutch Rapley – July 06, 2009
I also agree that OO is an ongoing-ever-evolving-journey. Before embarking on that journey, I highly recommend "Fundamentals of Object-Oriented Design in UML" by Meilir Page-Jones. I wrote a brief review of it back in January (www.stephenwithington.com/blog/index.cfm/2009/1/5/Quick-Review-of-Fundamentals-of-ObjectOriented-Design-in-UML), but in summary, the first 50 pages alone are worth buying the whole book for.
Cheers!
Comment by Steve Withington – July 06, 2009
www.cfoop.org/
Comment by Simon Bingham – July 07, 2009
@amclean, I started out writing websites in ColdFusion "spaghetti code", using includes for headers and footers and putting everything else in one script. After that I started writing ASP.net which promotes separating your code into presentation (views) and model (the bit that does all the work). When I came back to doing ColdFusion, I choose the Fusebox framework as it allows your write OO or procedural code and split it up into layouts/views and queries/actions (model) and controllers (MVC).
The recent Fusebox version uses cfcs as controllers and is quite similar in syntax to ColdBox, so if XML puts you off try one of these.
@Dutch, yeah I was very tempted to add Adrian's series of posts. I didn't because I think if you read it before you understand objects, relationships and responsibilities you can end up writing code that is just procedural code wrapped up in a CFC. It is definitely worth reading, just read some other stuff first :)
@Steve, glad you agree! I read another of Meilir Page-Jones' books, Object Orientated Technology: A manager's guide, which is also an excellent introduction to the concepts of OO. As developers we all just want to dive in and write code, but sometimes it is best to step back and take to time to understand the concepts behind what we want to achieve.
Comment by John Whish – July 07, 2009
Comment by John Whish – July 07, 2009
Is it only intended to make things easier?
Comment by amclean – July 07, 2009
Frameworks are born out of repetitive code and solving the same problems. They do a lot of the "heavy lifting" for you, but you can do it yourself. A lot of people use frameworks because they are proven, standardised and simply save you time - why reinvent the wheel? Having said that it is always good to try to do it yourself as you'll learn a lot and also find out the problems that frameworks have already solved.
Comment by John Whish – July 07, 2009
Comment by Doug Boude – July 11, 2009
I totally agree that the best way to become skillful with a tool is to practice. I don't think that anyone disagrees with that (I hope I didn't give that impression).
My experience of starting out on the OO path (and I've a long way to go!) is that it would have been a lot easier with a mentor. As you say, the cf community have been great at answering any questions I've asked, however, sometimes you need to have a little knowledge to even ask the right question!
Comment by John Whish – July 12, 2009