ColdFusion Iterating Business Objects (IBOs) From The Ground-Up

<cfcomponent
	displayname="GirlIBO"
	extends="AbstractIBO"
	output="false"
	hint="Extends the abstract IBO interface, specialized for girls.">
 
 
	<!--- Run the pseudo constructor to set up default data structures. --->
	<cfscript>
 
		// These are the list of keys that can be "get"ed and "set"ed in some
		// way. We are not going to define how they are accessed at this moment.
		// That will be done once the underlying data structure is set. These will
		// populate the Get/Set structures (that follow).
		// VARIABLES.Instance.GetAttributesList = "id,name,sexyness_factor";
		// VARIABLES.Instance.SetAttributesList = "";
 
	</cfscript>
 
 
	<cffunction name="GetFullName" access="private" returntype="string" output="false"
		mapto="full_name"
		hint="Gets the full name of the girl based on the name and sexyness.">
 
		<!--- Check to see what the sexyness factor is when we determine the girl's full name. --->
		<cfif (VARIABLES.Instance.RecordSet[ "sexyness_factor" ][ VARIABLES.Instance.IterationIndex ] GTE 9)>
 
			<!--- This a really hot girl. --->
			<cfreturn (
				"Crazy Hot " &
				VARIABLES.Instance.RecordSet[ "name" ][ VARIABLES.Instance.IterationIndex ]
				) />
 
		<cfelseif (VARIABLES.Instance.RecordSet[ "sexyness_factor" ][ VARIABLES.Instance.IterationIndex ] GTE 8)>
 
			<!--- This a sexy girl. --->
			<cfreturn (
				"Sexy " &
				VARIABLES.Instance.RecordSet[ "name" ][ VARIABLES.Instance.IterationIndex ]
				) />
 
		<cfelse>
 
			<!--- This a really an average girl. --->
			<cfreturn VARIABLES.Instance.RecordSet[ "name" ][ VARIABLES.Instance.IterationIndex ] />
 
		</cfif>
	</cffunction>
 
 
	<cffunction name="GetSexynessFactor" access="private" returntype="numeric" output="false"
		mapto="sexyness_factor"
		hint="Gets the sexyness as an integer (fixes the value).">
 
		<cfreturn Fix( VARIABLES.Instance.RecordSet[ "sexyness_factor" ][ VARIABLES.Instance.IterationIndex ] ) />
	</cffunction>
 
 
	<cffunction name="SetName" access="public" returntype="void" output="false"
		mapto="name"
		hint="Sets the name as all upper case.">
 
		<!--- Define arguments. --->
		<cfargument name="Value" type="string" required="true" />
 
		<!--- Set the value and convert to upper case. --->
		<cfset VARIABLES.Instance.RecordSet[ "name" ][ VARIABLES.Instance.IterationIndex ] = JavaCast( "string", ARGUMENTS.Value.ToUpperCase() ) />
 
		<!--- Return out. --->
		<cfreturn />
	</cffunction>
 
</cfcomponent>

For Cut-and-Paste