Hal Helms On Object Oriented Programming - Day One

Posted October 20, 2008 at 11:07 PM by Ben Nadel

Tags: ColdFusion, Work

Yesterday afternoon, I arrived in Sarasota, Florida to attend Hal Helms' one week seminar on Object Oriented Programming. I don't know if the planets where in the right alignment or what, but I got wind of this class last minute and just my luck, there was an opening. This is ultra exciting for me. As you saw last week, I have been looking for a ColdFusion Object Oriented Programming class to help organize all the information flying around in my head, so this is like a dream come true (please excuse the fanboy, throwing my bra on stage mentality, but let's face it, Hal is the guy you wanna be learning this stuff from).

So here I am sitting down at the end of the first day and I am exhausted. I feel both mentally and physically drained. There is so much lose knowledge saturating my brain. I can't wait to go to sleep just to start letting is marinate like a fine steak. The first day was great. I know that I missed the classroom setting, but I forgot just how great it really is; the whole day was all about sharing ideas and working through "scenarios" with our collective problem solving abilities. It was like an 8 hour in-depth conversation about object oriented programming.

During the class, I think I had a really good mental breakthrough in regards to the Service layer of an application. We kept throwing around terms like domain object, service object, business object, model, controller, etc.; so, we decided to take a minute to define some of these objects to ensure that we were all on the same page. I recommended that the Service layer be thought of as the "Controller" to the model in very much the same way that the Controller is the "Controller" for the View half of the application. So, for example, in the same way that the Controller translates the request, "user.login", into a View, the Service layer translates simple requests like AuthorizeUser() into a whole series of model-based events (think: log user-login to database, update user permissions, trigger any alerts necessary). In their own way, both the Controller and the Service layer act as a Facade to the implementation of each request.

Another great conversation we had was about the layers of specificity of an application and the rules about cross-layer relationships. This concept was based on the Fundamentals Of Object-Oriented Design In UML By Meilir Page-Jones. In his book, Page-Jones describes the "horizontals" of the code based being divided into four groups. I don't remember what they were exactly, but it was something like this:

  1. Interface
  2. Application
  3. Domain
  4. Foundation

The idea here is that the farther you go down the list, the less application-specific classes become and therefore more reusable. So, for example, the foundation horizontal would contain things like String, Money, Angle, and Float; these are the most basic, most reusable components. Then, as you get into Domain, and Application, you get classes that are increasingly more specific to your application and therefore less reusable.

The reason this is important is because keeping a class reusable requires that the dependency of classes only go from high to low. For example, you can have a class in the Domain horizontal require a class in the Foundation horizontal, but you would never want a Foundation class requiring a Domain class (think: Money having a reference to a Product class).

That being said, this conversation really got me to question some of what I do in my application. Well, not the beginning of the conversation, but the latter half. After lunch, Hal gave us a modified Horizontal breakdown (he did not author this, but found it online):

  1. User Interface View
  2. User Interface Control
  3. Domain Process
  4. Domain Entities
  5. Data Access
  6. Data Storage

The part that really got me thinking was this concept that the "Process" objects where more specific than the "Entity" objects. If you think about it, there is some good sense to this. An object is less specific that the actions which get applied to it. In my OOPhoto application, one rule that I came up with is that a business object (Entity) should know how to leverage its data. Often times, it can do this by passing the message up to its parent Service (or related service). For example, a PhotoGallery object might have the following method:

  • function GetPhotos(){
  • VARIABLES.PhotoService.GetPhotosForGallery( THIS.Get( "ID" ) )
  • }

I have been enjoying this, but you can see that it violates this rule about specificity. In my solution, the Entity object (PhotoGallery) needs a reference to a Process object (PhotoService) which is more application specific. This hurts the reusability of the domain entity (ie. PhotoGallery) as it couples itself strongly to an object that is more tightly bound to the given application.

At the end of the conversation, we actually got rid of the 6-tier horizontal model because the "Data Access" objects (think DAO) almost always have references to the "Domain Entities" (think Business Object being persisted). The 4-tier list that Meilir Page-Jones suggests seems to make more sense since it leaves several of these layers in the same horizontal which allows some relationships to stay horizontal rather than cross verticals in a violation of direction.

Now, you may be asking yourself why this was a useful conversation if we eventually ditched part of the idea? The point is really that we are flexing our thinking muscles; we're examining new ideas and keeping an open mind and we're all helping each other make progress. The magic of it all is really hard to put into words, but I have no doubt that the next 4 days of idea-cross-pollination will lead to many more breakthroughs.

I'm so jazzed, but I need to crawl into bed now and let my subconscious tackle all of this stuff.

Note: Another thing I wanted to talk about is how bad it is to program before you understand the use cases. This could have easily and logically been tied back into the concept of prototyping... but I am too tired to get into that.




Reader Comments

Oct 21, 2008 at 7:16 AM // reply »
319 Comments

This may be a dumb question, but I don't think you listed the _official_ class name, and Hal's site seems to be a bit behind. Was the class: Designing and Developing OO Applications with CFCs?


Oct 21, 2008 at 7:51 AM // reply »
153 Comments

Welcome to sunny Florida! Hasn't the weather been awesome for the last few days?


Oct 21, 2008 at 8:55 AM // reply »
38 Comments

Thanks for giving us a summary of your day. Interesting reading. Totally agree with your last para "how bad it is to program before you understand the use cases." It can be a fatal mistake, we're all code junkies and just want to code, but it really is worth taking some time out first :)


Oct 21, 2008 at 9:09 AM // reply »
3 Comments

You really should only marinate cheap steaks :>

Good luck.


Oct 21, 2008 at 10:02 AM // reply »
11,238 Comments

@Ray,

I just learned about the class last minute. I don't actually know what the name of the class is. I think its the upper level OO class (I think he teaches a beginner class as well, which I am skipping ;)).

@Rick,

The weather is beautiful! And the lizards are too cute.

@John,

Yeah, we ran into that problem very fast at the end of the day working with Accounting (and none of us really know accounting workflow).


Oct 21, 2008 at 11:05 AM // reply »
153 Comments

If you think the lizards are cute, you should see some of our more exotic fauna.

In Sarasota, you are less than a half-hour from the Lemur Reserve in Myakka:

http://www.lemurreserve.org/

You are also about an hour from the chimpanzee and orangutan sanctuary my wife used to work at:

http://www.centerforgreatapes.org/


Oct 21, 2008 at 12:29 PM // reply »
131 Comments

@Ben,

Love the insight about specificity you shared. When you first blogged about your bottom-side up object -> service calls (VARIABLES.PhotoService.GetPhotosForGallery), it really bothered me, but I couldn't defend what was wrong with it, so I didn't comment on it. You've nailed it, though: it's upside down, in terms of architecture, reading 'back up' to get a function call, instead of only laterally or 'down'. Brilliant encapsulation of the concept.


Oct 21, 2008 at 2:14 PM // reply »
11,238 Comments

@Rick,

That looks really awesome. I am a huge fan of all things monkey / ape related. That's way cool that your wife used to work there. I don't think I'll have enough time to make it over (the classes goes kind of late), but definitely if I come back down here for more relaxation.

@Jason,

Yeah, I think it makes sense that you don't want to reference up the chain. It's interesting - I'm really trying to change the way I think about this stuff.


Oct 21, 2008 at 2:21 PM // reply »
132 Comments

@Ben

So if your PhotoGallery isn't supposed to have a reference to the PhotoService how are you supposed to implement that?


Oct 21, 2008 at 3:13 PM // reply »
11,238 Comments

@Elliott,

I am learning..... slowly :) Day Two round-up should be good.


Oct 21, 2008 at 6:43 PM // reply »
110 Comments

@Rick O,
Those places look great! I've lived in Tampa Bay for ~18 years and never knew about them. I'll have to take my son there. I'm sure he'll get as much of a kick out of it as I will.


Oct 21, 2008 at 8:25 PM // reply »
5 Comments

Ray, the class is "Real World OO". Tonight we have everyone over to our house for dinner. This is a great bunch of developers.


Oct 21, 2008 at 9:39 PM // reply »
319 Comments

Thanks for the ID Hal. Where is the best place to see your list of upcoming classes? Your site seems to be a bit out of date. (Or am I looking in the wrong place?)


Oct 23, 2008 at 12:35 AM // reply »
25 Comments

+1 ray.

i'd like to know more about the course as well :)

thanks!


Oct 23, 2008 at 10:22 AM // reply »
66 Comments

Thought others might find links to Hal Helms CFCommunity page and his blog post about the course Ben is taking useful:

http://www.coldfusioncommunity.org/profile/HalHelms

http://www.coldfusioncommunity.org/profiles/blog/show?id=1439641%3ABlogPost%3A23526



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 17, 2013 at 7:42 PM
HashKeyCopier - An AngularJS Utility Class For Merging Cached And Live Data
Ben - thanks so much for posting these Angular articles and findings, they've been a huge help towards learning one of the more 'complex' JavaScript frameworks out there (IMO). I have been using Angu ... read »
May 16, 2013 at 5:01 PM
UPDATE: Parsing CSV Data Files In ColdFusion With csvToArray()
Your code was the closest thing I've found to obtaining some direction for converting ISO fields to values that CF can translate properly. Thank you for posting! ... read »
May 15, 2013 at 10:37 PM
Very Simple Pusher And ColdFusion Powered Chat
hi id making plz easy ... read »
May 15, 2013 at 6:07 PM
Making SOAP Web Service Requests With ColdFusion And CFHTTP
Ben, you once again saved my bacon at work. Thank you, thank you, thank you! ... read »
May 15, 2013 at 4:15 PM
What If All User Interface (UI) Data Came In Reports?
@Josh, Thanks! @Ben, I definitely recommend the David West book "Object Thinking" I've been quoting from. It goes deeply into the philosophy and history of OO programming. His breadth ... read »
May 15, 2013 at 11:36 AM
Ask Ben: Print Part Of A Web Page With jQuery
I found this helpfull when you need to keep (refresh) the original parent page after closing the iframe child print dialog (Hoping you're not using a form at this time so it won't submit again): On ... read »
May 14, 2013 at 7:13 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, If there's any books you'd recommend on the subject of domain modelling, I'd love to hear it. I just downloaded the free PDF of "Domain Driven Design Quickly". Figured I'd give it ... read »
May 14, 2013 at 6:57 PM
The UX Of Prototyping: Low-Fidelity Is The New High-Fidelity
@Phillip, I'm not sure I follow what you mean? Are you saying that you looked at the list of widgets provided by the jQuery UI and let that be your style guide? ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools