On 23/12/2004, at 1:40 PM, Andrew Mercer wrote:
Does anyone know of a way to group a collection of custom types?

Not sure exactly why you'd want to do the above, but a related guideline is that if you have custom types that belong together then a sensible naming convention should be used.


For example, a myMusic module could have custom type names as such:
myMusicArtist
myMusicTrack
myMusicAlbum

I would like to be able to say give me all the types that belong to
group A - which would return a list of object names, eg myTypeA1,
myTypeA2, myTypeA3. I could then then loop through the list and work
with all the objects.

This information is pretty darn static, so why not have a myMusicUtils.cfc which has a function that returns the names of all the types in the myMusic module?


<cffunction name="myMusicTypeNames" returntype="list" hint="Returns the custom type names belonging to the myMusic module">
<cfreturn "myMusicArtist,myMusicTrack,myMusicAlbum" />
</cffunction>


And if you find you are instantiating these things around the place you could put this into a function too:

<cffunction name="myMusicTypeInstances" returntype="array" hint="Returns an instance of every type belonging to the myMusic module">
<!--- call myMusicTypeNames() and create an instance of each --->
...


Or maybe I cold have a naming convestion such that the group name is
in the object name.

See above.

HTH

- tim lucas

http://www.toolmantim.com


--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to