OOPhoto - Almost An Object Oriented ColdFusion Application

<cffunction
	name="GetPhotos"
	access="private"
	returntype="array"
	output="false"
	hint="I return the array of photos. If the array has not been loaded yet, then I load it first.">
 
	<!---
		Check to see if the photos array has been populated
		yet. If not, then, we need to load it. This property
		will always be an array, so if it is a simple object
		then we know that it has not been loaded.
	--->
	<cfif IsSimpleValue( VARIABLES.Instance.Photos )>
 
		<!---
			Use the photo service (injected) to load photos
			array and cached it in our instance variables.
		--->
		<cfset VARIABLES.Instance.Photos =
			VARIABLES.PhotoService.GetPhotosForGallery(
				THIS.Get( "ID" )
			) />
 
	</cfif>
 
	<!--- Return populated array. --->
	<cfreturn VARIABLES.Instance.Photos />
</cffunction>

For Cut-and-Paste