Well, that's a good question, because I just recently upgraded my computer's RAM... and graphics card.
Technically, I don't have a "spending money" category in my budget. So, when "gadget fever" hits me, I have to squeeze it out of existing budget items. I don't always recommend this approach for everybody, but at least for me, it makes me think twice about my every purchase.
When I get the buying itch, I would stop and ask myself #1, if this is even a meaningful purchase, and then #2, check my budget to see if I can actually afford it right now.
If both conditions are met, that's when I start to really agonize, because that's when I know my idle flights of fancy turns into a serious purchase decision. This is usually when I'll go out and take forever staring at things like the product, then my budget, then go home and research it some more, and come back the next day and do it all over again.

It used to drive my ex crazy. She could never understand why I don't just buy something if I want it that badly. But that's just the way I am, and I'm glad that I can be my own gatekeeper I guess.
As for my computer upgrades, I upgraded my RAM to 1gig, which makes XP run smoothly all round, and my graphics card is a cheapo that set me back $50. Yeah, it's money, but it's affordable enough and does exactly what I'm looking for. So, overall, I am fine with my purchases.