Recently I've been hard at work trying to understand the core principles of OO programming in ColdFusion. Last week Ben Nadel shared his experiences at a week-long course devoted to OOP with Hal Helms (the summary, which can be found here, also has links to his daily briefs). His posts opened my eyes to a couple of concepts that are now new to me, and since I'm on a new project I thought it'd be a great opportunity to try them out. As you know from my previous posts, I'm also trying to implement IoC (Coldspring) and ORM (Transfer-ORM) frameworks into my project, so figuring out where these two stand in relation to what I think I now know about OOP is my next challenge.
-
Calendar
Subscribe
Enter your email address to subscribe to this blog.Recent Comments
Subversion And TortoiseSVN Issue: Expected FS Format '2'; Found Format '3'
Alex said: I realize that sometime has past, but someone might still be looking for an answer. In SVN 1.6 repo... [More]Lock the window with Javascript
Hamdan said: hey, im trying to open popup window with locking for the screen... i guess u can imaging wt im talki... [More]Enabling Line Numbers In CFEclipse 1.3.1.6 (On Eclipse Ganymede 3.4)
Ryan Stille said: I had to create the org.cfeclipse.cfml.prefs file myself, but once I did that and inserted the line ... [More]The "Behind-the-scenes" of SQUASH's Authentication
said: [More]cfExcelProxy Launched
Francois Levesque said: Hey Vaixe, cfExcelProxy does not support .xlsx files. MS decided to completely change the way their... [More]Recent Entries
Archives by Subject
Beginner's Guide (6) [RSS]
Coldbox (12) [RSS]
Coldfusion (47) [RSS]
Coldspring (6) [RSS]
Cool Stuff (2) [RSS]
Critical-Web news (14) [RSS]
CSS (2) [RSS]
Design (1) [RSS]
Games (2) [RSS]
HTML (3) [RSS]
JavaScript (4) [RSS]
jQuery (1) [RSS]
Linux (1) [RSS]
Montreal CFUG (1) [RSS]
Object-Oriented (2) [RSS]
Photoshop (1) [RSS]
Projects (27) [RSS]
Random Ravings (10) [RSS]
SQL (2) [RSS]
Transfer (1) [RSS]
XML (1) [RSS]
XSLT (1) [RSS]
#1 by Henry Ho on 10/29/08 - 9:23 PM
2.) Why don't you use decorator to add Register behavior to User?
#2 by Francois Levesque on 10/30/08 - 6:40 AM
Thanks for the comments. I'm pretty new to all of this, so any insight is welcome :).
1) I understand the reasoning behind this. However, where does i18n happen? In the controller? I feel like this and parsing values before passing them to the service layer will only bloat my controller. Any ideas on this?
2) That's a really good idea. Like I said, I'm pretty new to all this so I hadn't considered that option yet. In this case, then, is there even a need for a service layer? How will I enforce stricter validation (the user name doesn't already exist, etc.). Can the domain object (through Transfer and the decorators) know about all of this?
Again, thanks for your insight on this ;).
#3 by Shawn Holmes on 10/30/08 - 5:36 PM
Have a set of CFC "Managers" that take your service upon init(). Build your managers to provide functionality to your application and which take 'event' as a parameter. This keeps your interface consistent from your app framework and coldspring, allows you to clean up any "dirty" data within the Manager that would otherwise bloat your controller, and keeps the service layer framework independent.
#4 by Francois Levesque on 10/30/08 - 8:48 PM
So if I understand you correctly, my controller should send the event to the manager, which would clean it up and ping the service layer. The service layer would then ask the domain object for it's data/properties?
controller > manager >service object > domain object?
By domain object, I mean using Transfer to retrieve, set and save data.