From: Gregory Brown Date: 2006-01-26T17:10:03+09:00 Subject: Re: Design problems (beginner) On 1/26/06, Michael Judge wrote: > > I'm working on a medium-sized project and feel like I either: > > A. Still don't understand object-oriented programming > > -or- > > B. Am duplicating Ruby syntax which I'm not familiar with > > First, a little background, (kept mercifully short,) I'm working on a > survey interviewing program. I'm having having trouble with hammering > classes into a structure: > > Interview > Questions > Question > Answers > Contents > RHTML > Control > Answers Can you give a bit more information as to what your program actually does? I think that you may be over classing this system I would say you have something like: Interview: contains collections of questions and answers Question: constitutes a single question and associative rules such as validation Answer: constitutes a single response to a question, and rules such as what could be considered valid. Control and Formatting tools seperate.... Consider a Question#to_rhtml method or something like that maybe? This still might be overkill. If your questions always map to the questions one to one, you probably don't need a class for Answers. I guess what I'd need to know to help is what you'd want these classes to do. There is almost certainly no need for Answers and Questions (the collection classes) as an array or hash will most likely hold them perfectly well in interview.