I am giving a presentation on components tonight and I have a quick
question. I understand that the following code will serialize / deserialize
my component. Takes it and wraps up into a nice binary format (very compact)
and then at a later time I can unpack it. My question is outside of moving
info across clusters can anyone give me an example of where you would
actually use this? I have never had the need to use it so I would love to
hear from those who have! Thanks...

    <cfset person = CreateObject("component", "Person")>
    <cfset person.setFirstName("Dan")>
    <cfset person.setLastName("Vega")>

    <cfset fileOut = CreateObject("Java", "java.io.FileOutputStream")>
    <cfset fileOut.init(ExpandPath("serialized_cfc.txt"))>
    <cfset objOut = CreateObject("Java", "java.io.ObjectOutputStream")>

    <cfset objOut.init(fileOut)>
    <cfset objOut.writeObject(person)>
    <cfset objOut.close()>

    <!---
    <cfset fileIn = CreateObject("java", "java.io.FileInputStream")>
    <cfset fileIn.init(ExpandPath("serialized_cfc.txt"))>
    <cfset objIn = CreateObject("java", "java.io.ObjectInputStream")>
    <cfset objIn.init(fileIn)>
    <cfset newCFCInstance = objIn.readObject()>
    <cfset objIn.close()>

    <cfoutput>#newCFCInstance.getFullName()#</cfoutput>
    --->


Thank You
Dan Vega
[EMAIL PROTECTED]
http://www.danvega.org


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315196
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to