Restful design

So, the root of my question is, how do I go about designing the
controllers? Should I build a controller for drugs, domains, categories

and trade_names?

Domains, categories and trade_names are really just a different way of
display a drug. Would it be better to work on some map.resources
tomfoolery to handle the cases and create some new actions in the drug

controller?

Any advice would be most appreciated.

You are worrying too much. You don’t have to do any upfront design. Rails is very agile. I would put one of the model online and slowly start adding new features. Run autotest as you develop. This will help you to refactor your code mercilessly and change your design as you learn more about your system.

Huh? It's a bad idea not to do ANY upfront design. Just because
Rails is "very agile" doesn't mean you should sit at a blank screen
and get going. Generally thinking about the problem some will do
wonders.

Anyway, that response doesn't even have anything to do with his
question. He's asking how he should structure the controllers, not
how to design his domain model. Sounds like he's got it pretty much
taken care of.

Actually, he proposed the best solution himself, I think. The desired
structure would be handled quite simple with map.resources.

Pat

Huh? It’s a bad idea not to do ANY upfront design. Just because
Rails is “very agile” doesn’t mean you should sit at a blank screen

and get going. Generally thinking about the problem some will do
wonders.

Anyway, that response doesn’t even have anything to do with his
question. He’s asking how he should structure the controllers, not

how to design his domain model. Sounds like he’s got it pretty much
taken care of.

Actually, he proposed the best solution himself, I think. The desired
structure would be handled quite simple with map.resources
.

Pat

I did not imply doing upfront design is a bad idea. Just avoid analysis paralysis. Do an initial design that is good enough to get you going. Don’t worry about getting it right the first time. If you are able to change your code easily without breaking the functionality then there is no penalty in modifying your existing code.

All the doubts about structuring the code will become clear when you get the feedback from your own code. RESTful design already provides you with some structure. So you begin with that, right?

If I came to you and said ‘I’m using Ruby. What do you think is the
best method for implementing an AbstractFactory given xxx’. You

probably wouldn’t say ‘You thinking too much, let the code solve it’,
but rather provide me with some ideas on code, heirarchy, etc.

I used to think just like you when I was programming in Java. After watching DHH’s screencast several times (especially the one that shows brablog example) and reading the AWDWR book several times. I have totally changed my approach to development. I don’t know about the experience of others who might have made the same kind of shift in their approach.