|
Mailing Lists
|
Home /
Groups /
Object Oriented Programming with ColdFusion
Simulating Enumerated Types in ColdFusion
Hi, all.bayo 04/16/07 05:35 P What if you use a ColdFusion struct to create the name/value pairs....Ben Nadel 04/16/07 05:44 P Is a CF struct implemented as a Hashtable in Java?julian abiodun 04/17/07 04:37 A I think the ColdFusion struct extends the fast hash table. But don'tBen Nadel 04/17/07 08:49 A Hi, all. Any ideas on how to simulate enumerated types in CF? Is it even worth it? Maybe there's some other way to get the same benefits? Thanks. J. What if you use a ColdFusion struct to create the name/value pairs.... Then you might be able to call ".elements()" on to get the Enumertion as defined in: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Hashtable.html What are you doing to do with it that a struct itself won't accomplish? ..................... Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ Hi, all. Any ideas on how to simulate enumerated types in CF? Is it even worth it? Maybe there's some other way to get the same benefits? Thanks. J. Is a CF struct implemented as a Hashtable in Java? To be honest, I'm not doing anything specific right now that would require such a thing, but I'm always wondering how one might bend CF to simulate features in other programming languages. I was looking through some Java code that used enumerated types and was struck by the elegance of the language construct. I work mostly in CF but spend a lot of time reading Java code because there are so many great texts on OOAD with examples in Java. ----- Excess quoted text cut - see Original Post for more ----- I think the ColdFusion struct extends the fast hash table. But don't quite remember off hand. Not all methods are available. ..................... Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ Is a CF struct implemented as a Hashtable in Java? To be honest, I'm not doing anything specific right now that would require such a thing, but I'm always wondering how one might bend CF to simulate features in other programming languages. I was looking through some Java code that used enumerated types and was struck by the elegance of the language construct. I work mostly in CF but spend a lot of time reading Java code because there are so many great texts on OOAD with examples in Java. I think struct could be too generic here. Depending on the goal usage List could be used. Functions like listgetat and listfind use and assign integer values to list elements. -aP >Hi, all. >Any ideas on how to simulate enumerated types in CF? >Is it even worth it? Maybe there's some other way to >get the same benefits? >Thanks. >J.
|
May 24, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||