Reputation: 28572
I have little real Rails experiences. I want to know what's the best way to start to write a complex Rails application. For example, you just create all models first, then controllers, views last? Or something else?
Thanks.
Upvotes: 0
Views: 223
Reputation: 2161
I have a tendency to take some scale in to account. If you're just working within Rails and you don't have to think of anything beyond that, such as if you want to use NoSQL versus Relational databases, or whether a service oriented design is right for you, then personally I tend to do functional "feature driven" design. Some people call it 'whole stack' design. So you constantly have something that is deliverable, and you can clearly see the application coming together as you build.
The general process I follow for each feature really mirrors the style espoused by 37signal's book "Getting Real" which pushes Brainstorming -> Sketch -> Mockup -> Code. Which is more of a view->controller->model approach. There's a lot of other good details in that book as well, which I would highly recommend if you're trying to figure out a design method that works best for you.
Upvotes: 1
Reputation: 1325
I usually start with a pencil and paper, draw up the models (tables) you need or think you need and then refine from there before even starting the app.
Upvotes: 1
Reputation: 445
I would tend to work vertically and top down - ie. you're probably going to need a way to authenticate a user, so figure out the requirements for that and then start with the view, then the controller, and then the model.
Once you can authenticate someone, start adding the other features in. I like to work top down (view -> controller -> model) as I find that avoids speculative over engineering and keeps me focused on what the user is trying to accomplish.
It's not a particularly Rails specific way of working for me - I do the same in Java projects.
Upvotes: 2