Re: [CFCDev] placement of integration layer

2003-12-08 Thread Sean A Corfield
On Dec 8, 2003, at 7:17 AM, Justin Balog wrote: I like to break things up, so I have a DAO, GATEWAY, and SCHEMA folder where their respective cfcs live. I also organize my closetso take it with a grain of salt. *grin* Yes, I'd definitely say it's more about preference than anything else. If

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Nando
Yes ... the point they were making, and i think its a very good one, is not to try and mimic the real world in the object world and create manager objects to handle actions like these. Otherwise you wind up trying to encapsulate the knife and the person spreading and the silverware drawer in a man

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Barney Boisvert
I'm not sure the ingredient object is the quite right one. Given this: Ingredient pb = new PeanutButter(); Ingredient j = new Jelly(); Slice top = new Slice(); Slice bottom = new Slice(); This makes the most sense to me: top.add(pb); top.respread(); // calls spread() on all ad

[CFCDev] Question on CFPROPERTY

2003-12-08 Thread Stacy Young
I've built an web service to interact with in ordering system...I've got all the required fields in cfproperty tags...now, perhaps this is an obvious question but should I also be declaring response parameters in cfprop tags as well? Thanks! Stace AVIS IMPORTANT: -

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Nando
I've been reading Streamlined Object Modeling as of late, and they would say to put functions like these in whatever object had the (most) information to perform the calculation. I especially like the quote on page 99 where they are talking about how to model a peanut butter and jelly sandwich. The

RE: [CFCDev] Wanted: OOP Best Practice for CFC's with database interaction

2003-12-08 Thread Kairoh!
Thanks for all input Vinny -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sean Sent: maandag 8 december 2003 16:22 To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Wanted: OOP Best Practice for CFC's with database interaction Vinny, On one of my bigger app

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Brian Kotek
For me, thinking as "subclass" and "superclass" helps me keep things a bit more straight. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Brendan O'Hara > Sent: Monday, December 08, 2003 1:41 PM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] Diffi

RE: [CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
>What is it exactly you are trying to do? >Brendan It's a CMS system where the user is able to determine the contentType for a particular contentItem A Text or an Image is-a ContentItem - that makes sense - so i started out assuming that the content subtypes would inherit from ContentItem. From

Re: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Gabriel Roffman
I totally agree now and see your points. It just took me some working through it for it to personally make sense. Doesn't it always... - Original Message - From: "Barney Boisvert" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:40 PM Subject: RE: [CFCDev] W

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Brendan O'Hara
Also as I tried tp point out in my recent post in the side thread: "A basic concept of Composition is that Parents may know bout Children ... but Children do not know about Parents" Parent Child probably shouldnt be used in talking about inheritance anyway as it just isn't the right term. Brend

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Barney Boisvert
This is how I initially set everything up, but the way Sean outlines is much better. If your BO knows about the DAO, then your BO knows something about persistance, and that's definitly a bad thing. Your DAO should simply create the instance data memento for a BO, and then pass it to a BO. The B

RE: [CFCDev] cftransaction with CFC's

2003-12-08 Thread Barney Boisvert
Dave, I'd be quite interested as to how you implement transactions entirely in the database. How do you determine what comprises a transaction at that level? Not arguing, just curious. Cheers, barneyb > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
Oops, i left where i instantiated the parent out of the code ... but in any case ... Yes, it does help to have it spelled out in this way ... ;-) I didn't really *know* this when i started out: "A basic concept of inheritence is that Children may know about Parents ... but Parents do not know abo

Re: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Gabriel Roffman
Also, if we were to go with Sean's get/setMemento pattern, would this make a good case for inheritence from AbstractBO which implements getMemento and setMemento? -- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTE

RE: [CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Brendan O'Hara
OK sorry if this seems simplistic but here goes: A CFC is a Type of something. An Instance of that CFC is a something of that Type. A CFC Base Class is NOT compositionally related to its Children classes. The relationship is through inheritence. A CFC that contains several other CFC instances a

Re: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Mike Collins
Here is an big picture diagram of a DAO architecture I have been inching my way thru. I'd imagine you could take this approach for BO as well. It has gone thru several iterations and more will undoubtedly be made but I thought It was worth sharing none the less. Improvements are always welcome

RE: [CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
Hmmm... well, with that exact suggestion, i get an infinite loop, but in any case i think i get what you're saying and have worked that out in my code awhile back - that i would need to pass an instance of parent into child if i'm employing composition. I don't know if it ever would be useful to mi

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Justin Balog
I haven't thought of a cart yet, but my gut says that the cart wouldn't necessarily be a strict BO, it would be more of a manager, having functions like addItem(), calcTax(), removeItem(). I would have the cart composed of multiple items (which would be BOs in the sense I am suggesting). Then wh

RE: [CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nathan Dintenfass
Actually, scratch that -- I made a stupid mistake in not realizing that you'd set up an infinite loop. Brendan's answer is probably more appropriate -- which is to talk you out of having this construct in the first place. - Nathan > -Original Message- > From: [EMAIL PROTECTED] [mailto:

Re: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Gabriel Roffman
Yes, but if BOs are just a package of instance data, then where would you put functions on that instance data. For example, if you have a shopping cart and you want the cart to have a calculateTax() function, would calculateTaxbe part of the BO or part of a manager of the BO? > Hmm, lets say you

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Brendan O'Hara
Nando, You can combine lots of design patterns but you need to understand the basic principles of OOP otherwise you will get yourself lost pretty quickly. I do not see in your code where create a reference to OR "instantiate" the parent object or create a reference to OR "instantiate" the child o

RE: [CFCDev] Why not have DAO in BO?

2003-12-08 Thread Justin Balog
Hmm, lets say you wanted to initialize the objects instance data from a form, or some other mechanism other than the dB? I have gone with the idea that the BOs are fairly light weight, they simply package instance data, and perform very limited validation on themselves. That way they can be popu

[CFCDev] Why not have DAO in BO?

2003-12-08 Thread Gabriel Roffman
I've read and reread Sean's Mach II article example and am trying to implement it now. However, my natural inclination is to have the DAO object be part of the business object? In the init method of the BO, I would call the read method of the DAO. So my init method of the BO would look something

RE: [CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread sean
Another way to get parent data into a child component is to add this line in the child init statement Super.init() That way you get your instantiated parent data available to the child. Sean Scott -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nathan D

[CFCDev] Inheritance and Instance Data, WAS: Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nathan Dintenfass
I'm not sure what is meant by the original statement "The instance data isn't inherited", but in the example shown below you need to run the init method on the child in order for the instance variables to be created in it because they are only created in the init method of the parent. Since you ar

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
Jon, indeed you are correct with that example. I see i've been trying to do something slightly different, following, or maybe misfollowing, the Template Method pattern article in CFDJ - and that created part of the impression. This gives

RE: [CFCDev] placement of integration layer

2003-12-08 Thread Justin Balog
I like to break things up, so I have a DAO, GATEWAY, and SCHEMA folder where their respective cfcs live. I also organize my closetso take it with a grain of salt. Thanks, Justin -Original Message- From: Gabriel Roffman [mailto:[EMAIL PROTECTED] Sent: Sunday, December 07, 2003 8:48

RE: [CFCDev] Wanted: OOP Best Practice for CFC's with database interaction

2003-12-08 Thread sean
Vinny, On one of my bigger applications I took a cue from Java and implemented a database access object like structure. Basically in plain English is you create a CFC or CFCs strictly to talk to your db. So if you have an Employee Class I would built a corresponding Employe_Store cfc. Within th

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Jon Gunnip
>>> [EMAIL PROTECTED] 12/08/03 03:04AM >>> > Another is that i'm beginning to see that inheritance is "nearly useless" in CF - > well, that's a broad statement, but for the most part it's kinda true, because all > that is inherited is the methods. The instance data isn't inherited, because it's

RE: [CFCDev] Wanted: OOP Best Practice for CFC's with database interaction

2003-12-08 Thread Andy Ousterhout
To handle this, I've created two classes: One for the object itself and another for reporting. For example, with employees, you will want a list, perhaps adding hours worked, salary, pay, etc Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Kairoh

RE: [CFCDev] Wanted: OOP Best Practice for CFC's with database interaction

2003-12-08 Thread Nando
Have you checked out the MachII develoment guide? http://livedocs.macromedia.com/wtg/public/machiidevguide/models.html scan down the page to Database Access Objects and see if you can make any sense of that. I think what you'd be looking for is what's termed a gateway object in the article.

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
I found Scott Ambler's "The Object Primer" somewhat "better" because of the simple grounded approach that it takes to object modeling. But I have them both sitting here next to me. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Stacy Young Sent: Monday, Dece

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Stacy Young
Ya that's a great primer! Stace -Original Message- From: John Beynon [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 7:37 AM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Difficulty in getting the light bulb to turn on... One of the books Hal suggested I read to get my head round

[CFCDev] performance / composition

2003-12-08 Thread Nando
Speaking of composition, i've been wondering lately if there is any appreciable performance difference if you create an object and hold it in the variables scope of it's parent, and simply reinitialize it each time you need to use it during the course of a request (assuming you would need it multip

[CFCDev] Wanted: OOP Best Practice for CFC's with database interaction

2003-12-08 Thread Kairoh!
Hi everyone, I have build a simple employee CFC - shown below - that interacts with a database. This CFC uses a utilities CFC for handling zero-length strings and preparing datefields for a database insert or update. The CFC does the job as expected. So far so good. But there are two questions bo

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread John Beynon
One of the books Hal suggested I read to get my head round OO was Object Technology:A Managers Guide, David Taylor, ISBN 020130994-7. It's obviously aimed at manager level so it's written to a fairly low level but I found it pretty helpful, plus it's not going into any specific language...and it ai

RE: [CFCDev] Difficulty in getting the light bulb to turn on...

2003-12-08 Thread Nando
Andrew, All i can say is that i can totally understand you ... and for the most part, the only thing that has really helped me was to dive in and try to build something of medium complexity using OO style CFC's. And i started with just a few CFC's and tried to get them in place and working and the