A component we have has an audit log component that is associated by
reference...
<cfproperty name="myAuditLogProp" type="string" typeArray="true"
referenced="true" displayName="my Audit Log" hint="Log entries for a
components Instance" required="no" />
AuditLog Component...
<cfcomponent name="directoryname.myAuditlog" table="myAuditlog" output="no"
displayName="My Audit Log" hint="This component tracks actions against the
other components" extends="myPersistentservice">
Other cfproperties....
</cfcomponent>
The <cfproperty> above is within the parent object and it is referenced by
adding the attribute of referenced="true". I changed the names of the
properties and component, but you can get a sense of whats happening
here....
HTH
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Schreck, Tom
Sent: Tuesday, September 24, 2002 12:55 PM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question
Do you have some examples of "by Reference"? Any links to reference
material?
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: Dan Blackman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 11:08 AM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question
Just clear up what I was prescribing, MM did not include persistence for
CFC's out-of-the-box, meaning that Sir Isaac is right, you have to build
your own custom persistence....Which ever model you choose.
Modeling using an objectstore is certainly a more straightforward (in my
opinion) when using components and cuts our having to worry about
building a
Add, Update, Delete SQL calls for each table since they are built into
your
persistence layer. You simply create an instance using a "Create"
method
that is the persistence layer. Once you extend the persistence layer to
other objects, they automatically inherit the methods and can be used to
maintain instances. With the relational model you have to map the table
to
your objects, but if you more familiar with that then that may suit
you...
To answer your original question, you may want to show a relationship
"by
reference" where you simply create a property in the parent
object/component
with the "type" equal to the child component(<cfproperty
name="orderDetail"
type="store.orderdetail") and set referenced="true". If you want to
embed
the child then set referenced="false". The components are presented as
arrays of structures in CFMX
HTH
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of S. Isaac Dealey
Sent: Tuesday, September 24, 2002 10:30 AM
To: [EMAIL PROTECTED]
Subject: RE: CFC Question
Because of the comments of one of the other list members -- I'm not on
my
home machine at the moment and I deleted it unfortunately so I don't
remember the name, but he was commenting about MM deciding not to
include
persistence when they implemented CFC's indicating that you would have
to
create your own system for persistence ...
Which in the long run may mean that the implementation of CFC's for
Tapestry
remains closer to what I'm using now, since my existing model stores my
class and object information in the application scope, and thus remains
a
datasource agnostic solution as compared to the described solution which
required Oracle.
> Why do you say you are wrong about persistence? I appreciate your
> feedback.
> 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: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 24, 2002 9:51 AM
> To: [EMAIL PROTECTED]
> Subject: RE: CFC Question
> Hmmm... I guess I was wrong about persistence... That's going to make
my
> movement to MX interresting...
>> 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
> S. Isaac Dealey
> Certified Advanced ColdFusion 5 Developer
> www.turnkey.to
> 954-776-0046
>
------------------------------------------------------------------------
> -
> This email server is running an evaluation copy of the MailShield
anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info:
> www.mailshield.com
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
>
------------------------------------------------------------------------
-
> This email server is running an evaluation copy of the MailShield
anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info:
www.mailshield.com
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer
www.turnkey.to
954-776-0046
------------------------------------------------------------------------
-
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info:
www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
------------------------------------------------------------------------
-
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info:
www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org