Tom,
 
I meant components on the frontend and a relational db on the backend...I guess I should have reread before I posted...:-)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Dan Blackman
Sent: Tuesday, September 24, 2002 9:26 AM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question

Ah, the question of persistence.....I just finished a project with macromedia and since MM decided not to add persistence into CFMX we(Our team and MM) had to build a custom persistence layer for retrieving and sotring the objects.  The custom peristence layer was built with a mix of CFMX and Java interacting with an OO objectstore on the backend(ORACLE).  Now, you don't have to build a OO objectstore to persist your data though....You can build a realtional database on the backend with your business logic separated...Now it's a bit more of a finesse game trying to work in Components on the front end and objects on the backend....
 
Ben Elmore (CTO, Remotesite Technologies ) in collaboration with a few other authors has written a book called "Dynamic Publishing with ColdFusion MX"  It's due out by October(I believe)....It covers a wide range of topics from building content management solutions to using the new CFMX features to Flash Remoting...It's a book geared towards business users, advanced technical developers, and technical managers....
 
I will get a book summary out soon...It's a great book with a lot of great topics coming to a book store near you!
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Schreck, Tom
Sent: Tuesday, September 24, 2002 9:12 AM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question

I’m modeling my Objects after my database structure.  Each object represents a table.  Whenever I instantiate the object I pull all the information about the object together.  I think this is a little overkill; I’m just playing around to see what I can do with it. 

 

What rules of thumb/guidelines do you go by when modeling your objects?  Do you base it upon a table structure, or perhaps how the objects interact with each other?  My initial guidelines are something Hal Helms mentioned about objects.  He said to the effect that an object should contain everything it knows about itself.  For instance, a person knows his/her name, age, birth date, sex, etc.  So, I instantiate an object by passing its unique ID into a method.  I then go through the database structure and pull the data I can “find” for that ID into the object.  This seems like a lot of overhead because I have to pull all of this data together for each instantiation.  I may only use part of the data available to me at any one point in my application.  How does CF manage the data pulled together for an object?  Is it stored in memory?

 

Is there a better way to model your objects?  It seems like a natural fit to model it against your database structure, but it seems like too much overhead: why not just query against the table when you need the data?  Anyways, if anyone has any advice on better ways to model I would appreciate their advice.

 

Thanks -

 

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

 

I have not failed.  I've found 10,000 ways that won't work.

 

- Thomas Edison

 

-----Original Message-----
From: Billy Cravens [mailto:[EMAIL PROTECTED]]
Sent:
Monday, September 23, 2002 8:09 PM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question

 

From a technical standpoint, there’s nothing wrong with what you’re doing (perhaps each instance of an object has a performance hit, but I doubt it’s significant).

 

However, I would focus on your objects from an abstract view.  Are your 2 objects working on different “items”?

 

For example:

 

1)       I have an “orders” object.  I want to look at a particular order, and return a recordset containing all items in that order.  In this instance, I would only have a single object, “orders”, since everything is so closely related.

2)       I want to pull a recordset containing all orders placed by a certain customer.  In this situation, you might have a customers object, that interacts with an orders object. 

 

I think we will see many different approaches for interfacing with CFCs: the most basic encapsulation, replacements for custom tags, etc.  However, I think the true power of CFC’s come when you use them to model the real world.

 

**************************

Billy Cravens

Web and Software consulting

www.Architechx.com

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Schreck, Tom
Sent:
Monday, September 23, 2002 11:57 AM
To: [EMAIL PROTECTED]
Subject: CFC Question

 

I’ve been experimenting with CFCs and am excited about the potential.  I see how it’s a switch in perspective of how you model your application.  I’ve created an object, Object A, which has a 1-to-many relationship with another object, Object B.  I created a function of Object A which returns a recordset of all records from Object B related to Object A.  So, whenever I instantiate Object A, I have available to me all records related to Object A that belong to Object B.  This is stored in Object A as this.ListObjectB.  Is this good practice?  Where does all of the information about an object get stored when you instantiate it?  Should you “store” a recordset of data in an object, or just call a function to return the recordset whenever you need it?  Does anyone have guidelines/best practices for working with CFC?

 

Thanks -

 

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

 

I have not failed.  I've found 10,000 ways that won't work.

 

- Thomas Edison

 

Reply via email to