An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

How do you find your classes?

January 15, 2009 · 2 Comments

Thinking in objects can be really hard and one of the biggest stumbling blocks for many who are new to OO design is identifying what are the right things in the problem domain to model as classes. This topic came up in a recent thread on the excellent cfcdev mailing list and Alan Livie shared his recommendation for Robert C. Martin's book "Agile Principles, Patterns, and Practices in C#". In particular, he pointed list members to chapter 20 which discusses the design of objects to represent a coffee maker. That particular chapter is available as a PDF and it's a really good read. It starts off explaining the problem to be solved and then presents the "obvious" object model that most new OO students come up with. Then he takes it apart, explaining why it's a poor design, and goes on to construct a much better model (with fewer objects) that is very elegant and easy to understand. If you're struggling with the OO design process, you need to read this PDF and absorb the lessons laid out within it. Even if you think you're an OO 'guru' you'll probably learn something from it!

Tags: architecture · coldfusion

2 responses so far ↓

  • 1 Paul Houle // Jan 16, 2009 at 7:11 AM

    It takes six months or two years of intensive work to make a bad OO designer. A few more years of experience will make you fair.

    Java is a good language for learning OO because it forces you to do everything in an OO style. Sure, you can write a program that's nothing but a collection of static methods on a single class, but you need to think hard about how to abuse the system in order to do that. Since CF runs in the Java environment, I'd say that CFers wouldn't be wasting their time learning some Java.

    That said, I've become a C# programmer lately and I've come to absolutely love C#. Microsoft has made a large effort to push good design practices on the designers of the .NET framework and also on the users. C# and the ecosystem around it is by no means perfect, but it's a serious effort to make something good.
  • 2 Adrian Lynch // Feb 3, 2009 at 6:40 AM

    Cheers for that, just having a read of it now...

    It's also worth noting that anyone yet to delve into the old OO world shouldn't hold off because you can't work out what the right objects should be, instead, just get stuck in!

Leave a Comment

Leave this field empty