>> How did you deal with persistence?
Hate to plug Helms again since the auld scrooge charges an extra $10 for his
workbook after you pay for his book "Discovering cfc`s", or does that make
me one for compalining about it :) You'll have to consult his book for more
on it, but here is an intro. Persistance is based upon the principle of
inheritance in such object oriented languages such as c++ and java. He has
an example, Employee.cfc that extends another cfc, Person.cfc
Say Person.cfc is
<cfcomponent>
<cfset this.gender = "null">
<cfset this.firstname = "null">
<cfset this.lastname = "null">
<cfset this.dateOFBirth = "null">
<cffunction name="getFirstName">
<cfreturn this.firstname">
</cffunction>
</cfcomponent>
And another cfc, Employee.cfc that extends Person.cfc
<cfcomponent
hint="I am an Employee"
extends="net.cbweb.CFCs.Person">
</cfcomponent>
The really cool thing about cfcs and persistance and inheritance is that
once you have the employee blueprint created above, through inheritance you
get access to all the variables, functions of its parent, Person.cfc you can
set up
a test file in the same cfc's directory as follows,
<cfset missWorld = CreatObject('component','Employee')>
<cfoutput>
My first name is #missWorld.getFirstName()#
</cfoutput>
and cause Employee extends Person through inheritance it has its variables
and methods and supertypes borrowed from Person and can output this as
My first name is null
so Employee has made getFirstName() function as part of its own scope also
the variables available to that scope, its OOPS(object oriented processing
of variables,methods)
rgds
Colm
http://www.cbweb.net
-----Original Message-----
From: Justin MacCarthy [mailto:[EMAIL PROTECTED]]
Sent: 20 January 2003 11:26
To: Cfuk
Subject: [ cf-dev ] Collection object (cfc)
Hi all,
Has anyone written a generic collection component (cfc)? One that can
contain other cfcs etc.
Share the code? How did you deal with persistence?
Thanks J
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.441 / Virus Database: 247 - Release Date: 1/9/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.441 / Virus Database: 247 - Release Date: 1/9/2003
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]