From: Daniel Waite Date: 2007-10-13T08:15:33+09:00 Subject: Re: I don't like my code -- what can I do? John Joyce wrote: > It's just a matter of getting the the right data relationships. > SQL isn't inherently bad just how it's used can be bad. > You just need to create objects and let SQL do the storage and > retrieval and use it to get some of the freebies you get from it, > like cheap fast indexing and datamining, but those things should come > after the fundamental design. > Your situation is simple and should be pretty easy to develop if the > models are right. Agreed. I'm looking at it now through fresh eyes -- not thinking at all about the spec set forth, and I'm amazed at what I'm finding. First off, a huge amount of dependency is coming from the fact that when created, a BidRequest generates an access key of sorts (a SHA1 hash of some attributes) that acts as a "key" to get to the bidding screen. This key is unique per vendor, which automatically means there can only be one bid request per vendor, and that the bid request is literally tied to the vendor. I just had a meeting where I found out that the company sometimes does promotions (or packages, more accurately, I think) whereby they request bids on a collection of parts. Well hello! In my mind, whenever you have more than one of something, no matter how rare, you have a collection. Period. Forget trying to code for those exceptions, just make it a collection. I'm also beginning to see a behavior... the ability to be bid on -- or biddable. Biddable things share similar attributes and behavior regardless of what they are. Sweet! Thanks again, John. Sometimes I need to be reminded that just because "the boss" says do it this way doesn't mean it's the best way to be done. (Actually, I rarely need to be reminded of that; I've been fired from so many jobs for being not only the FIRST but the LOUDEST to say that the proposed method of doing things is a poor choice. I think I crawled into a shell and fell into the trap of "going along to get along" after being unemployed for so long.) -- Posted via http://www.ruby-forum.com/.