Sam, It's hard to say anything in general. Every situation is unique. And it will most likely develop uniquely as you continue to work with it. What i do know, by now, is that using object oriented programming is really cool. It can be a very effective way to find simple solutions to complex application problems. But the only way i've been able to learn is to do it. And i'm still learning, every day.
So it really depends on what this application is supposed to do, beyond the financial calculations. I stared at my first attempt at a model for weeks. Asked lots of questions, understood and didn't understand the answers, built it all back-assed a few times over. And now ... i think i have something pretty cool. You can do what you know how to do today just fine procedurally. So it may look like a bit of an unneeded luxury to start using cfc's and try to work out a model that you can begin with. Why bother? But chances are 6 or 8 months from now if you jump in and keep working with it, you'll be doing things with OO without breaking a sweat that you'd stare at for hours or days and not come up with a solution using a procedural approach. And yes, even in ColdFusion. :) Nando -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Sam Clement Sent: Tuesday, November 09, 2004 5:47 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] CFC Cohesion So the component would have an init() function that would process all calculations that have other calculations depend on them? Since the real app has around 30 calculations (and growing!) with some fairly complex relationships, this might create some unnecessary(?) overhead. Anyway, from what you say, it sounds like it's okay practice to dump them all in one CFC and then just have the component call its own methods as needed for each calculation - I think... :) Cheers, Sam -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nando Sent: Tuesday, November 09, 2004 10:18 AM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] CFC Cohesion I'm pretty much a beginner myself, but as a general plan, i would do calculation A on the init, store it in the variables scope, and then access result A for functions B, C, D and E, if that makes sense. Store result B in variables scope and use it for C, etc. >From what you describe, it seems you just need to make sure that the >obj is initialized to the point where it can handle any of those functions. It doesn't seem to me like you'd need to make separate objects, necessarily, to have this FinancialObj be cohesive, it does financial calculations. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Sam Clement Sent: Tuesday, November 09, 2004 4:55 PM To: [EMAIL PROTECTED] Subject: [CFCDev] CFC Cohesion I'm working on a small financial site that uses a lot of financial formulae (duh). I'm also an OO newbie and trying to get up to speed on the methodology with this project (using machii). Since a lot of the financial formulae are dependent upon each other, one of the troubles I'm having is with the separation of the business logic into small, 'do one thing well' type pieces. For example, if there are 5 calculations that need to be made: A, B, C, D and E: A is a simple calculation on values stored in the db B uses A values to make its calculation C uses A and B values, and the previous date's value of C for its calculation Etc. With this set up I'm having difficulty creating cohesive objects. There seems too much dependency between each calculation to really separate them. Separating them into individual components just seems to create a string of dependent objects. Perhaps I should be creating "parent" objects that tie these smaller calculation objects together? Any advice appreciated. Cheers, Sam ________________________________ Sam Clement ABOVE Studios Boutique Design Solutions <http://www.abovestudios.com/> 32 Clifford St - Belmont Trinidad + Tobago - West Indies T: (868) 621 5159 W: abovestudios.com <http://www.abovestudios.com/> ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED]
