I am new to rails but have read a book and created small features before. I'm now about to create a big new开发者_StackOverflow中文版 feature for an application (it really just involves a lot of forms and relationships) and I was wondering if anyone has a good/consistent strategy for pre-coding.
Here is how I do it:
Divide the task into a bunch of small ones. (outline on a whiteboard/piece of paper)
Make each part work. (implementation)
Keep in mind how other parts of the component will access it. (whiteboard)
Integrate. (whiteboard, implementation)
Every time you do, rewrite both of the APIs improving things you didn't think about in part #2.
Make it all look nice. (whiteboard, implementation)
Think about speed. (whiteboard, implementation)
NB: Do not break the order
If you try to design everything on paper, and a simple whiteboard / a sheet of paper is not enough, then you might be over-engineering. Be careful with that.
If you follow this pattern, then you are very likely to avoid both over-engineering and bad design decisions.
精彩评论