I do a little of both. If I find fabric I love, I'll buy it. Sometimes I have a pattern and will buy the fabric to go with it, in which case I copy the pattern from the book and include it with fabric so I don't forget what I bought it for. Not that I couldn't use it for whatever ;-)
Back when I used to sew my own clothes I used to do the same thing - buy fabric and then figure out what to do with it.