Re: Structures in Java?
Thanks Guys, that is some excellent info to keep in mind. (and that I sometimes forget to think about (e.g. worked fine in dev mode, how come it's all squirrly now?!?! ;)). Yet I went with the "thread safe" ajax stuff at first... just cuz... how haphazard of me. =P I vow to become a more aware coder. Vow it I say! :Denny On 10/2/06, Barney Boisvert <[EMAIL PROTECTED]> wrote: > > The container takes care of the majority of threading issues for you; > only when multiple requests access the same data (i.e. session or > application scope) does threading matter to the application developer. > If you have request-level data, concurrency isn't be a concern unless > you're explicitly multithreading your request. > > Note that instance variables of shared-scope CFC's count as > cross-request data, but local variables inside CFC methods (including > arguments) do not. > > cheers, > barneyb > > On 10/1/06, Mark Mandel <[EMAIL PROTECTED]> wrote: > > Your probably better off with a java.util.Hashtable, as it is already > > syncronised (thread safe), and more often than not, where are using > > Hashtables in a web environment, they need to be thread safe. > > > > That being said, java.util.Collections gives you some easy to use > > utilities to create synchronised Maps very easily. > > > > HTH > > > > Mark > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255097 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures in Java?
The container takes care of the majority of threading issues for you; only when multiple requests access the same data (i.e. session or application scope) does threading matter to the application developer. If you have request-level data, concurrency isn't be a concern unless you're explicitly multithreading your request. Note that instance variables of shared-scope CFC's count as cross-request data, but local variables inside CFC methods (including arguments) do not. cheers, barneyb On 10/1/06, Mark Mandel <[EMAIL PROTECTED]> wrote: > Your probably better off with a java.util.Hashtable, as it is already > syncronised (thread safe), and more often than not, where are using > Hashtables in a web environment, they need to be thread safe. > > That being said, java.util.Collections gives you some easy to use > utilities to create synchronised Maps very easily. > > HTH > > Mark -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255015 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures in Java?
Your probably better off with a java.util.Hashtable, as it is already syncronised (thread safe), and more often than not, where are using Hashtables in a web environment, they need to be thread safe. That being said, java.util.Collections gives you some easy to use utilities to create synchronised Maps very easily. HTH Mark On 10/2/06, Dave Carabetta <[EMAIL PROTECTED]> wrote: > On 10/1/06, D F <[EMAIL PROTECTED]> wrote: > > Thanks Dave, so presumably this HashMap object can be passed around through > > various methods etc? > > > > If I'm understanding what you're trying to to do, then yes, you can > pass Java objects just like you can pass CF objects around. The big > difference is that, if you pass it as an argument to a cffunction > call, then the cfargument tag should expect a type of "any" to use the > Java object correctly. > > Regards, > Dave. > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254942 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures in Java?
On 10/1/06, D F <[EMAIL PROTECTED]> wrote: > > Thanks Dave, so presumably this HashMap object can be passed around > through various methods etc? Pretty much. I think the one thing you need to keep in your head is that in java, everything starts at 0, and CF starts with 1. There is a word that I should replace "everything" with.. maybe indices? Eh. ** On a side note, I can't decide whether I'm dealing with a open loop, or a black hole, on another issue... anyone know how to tell the difference? Is it just taking a "long time" to get back to me? /me blows the dust off of some Hawking books Stupid jokes award!?! Sign me up! -Den ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254933 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
On 10/1/06, D F <[EMAIL PROTECTED]> wrote: > Thanks Dave, so presumably this HashMap object can be passed around through > various methods etc? > If I'm understanding what you're trying to to do, then yes, you can pass Java objects just like you can pass CF objects around. The big difference is that, if you pass it as an argument to a cffunction call, then the cfargument tag should expect a type of "any" to use the Java object correctly. Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254931 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
Thanks Dave, so presumably this HashMap object can be passed around through various methods etc? >On 10/1/06, D F <[EMAIL PROTECTED]> wrote: >> Is there anything in Java similar to Coldfusions Structures? >> > >Remember that ColdFusion is compiled to Java, so there's always going >to be a related data type between the two languages. In this case, you >want a HashMap, which is what a CF structure is under the hood: > >http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html > >Regards, >Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254930 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
On 10/1/06, D F <[EMAIL PROTECTED]> wrote: > Is there anything in Java similar to Coldfusions Structures? > Remember that ColdFusion is compiled to Java, so there's always going to be a related data type between the two languages. In this case, you want a HashMap, which is what a CF structure is under the hood: http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254929 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Structures in Java?
Is there anything in Java similar to Coldfusions Structures? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254928 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4