Here is my question: how do you design your RoR web application?
Someone asked: “how do you design your RoR web application?”
To be honest, there’s no right or wrong way to create a new app. Some
people starts from DB tables, some starts with html, and others starts
with user cases. Whatever works for you is the best way. Here are some
* keep your design modular. If things can be broken into small
pieces, do so. make them into plugin, gems. because doing so those
building blocks can be reused later. if everything is big and chunky,
less likely they’ll be reused.
* tests is the other half of the code, code without test is not
complete. you should always write code with test code side by side.
Some people even advocate write test first.
If you just keep in mind of 2 principles above, you’ll be doing very
===Development lifecycle - Iterative
Break big apps into iterations, each iteration with requirements from
most critical down to nice to have. People call this agile
development. In my example, my final goal for groups.wuyaSea.com is to
create a full featured social network site. First release only have
most essential features, user can discuss in forum, and write
articles, and make friends. that’s it. No search (outsourced to google
search), no photo sharing, no private messaging, not even tagging (now
does). With capistrano, it’s easy to keeps on pushing out releases, I
often push out new builds like 5 times a day.
Major reasons for doing iteration is to minimize risk, cuz bean
counters like that.
* each release requires shorter timeline, less coding effort, and
more predictable in time and money.
* after you give each release to user acceptance testing, you’ll
find out what features users use most of time, and what features users
rarely touch. It’s known that in any app, 20% of code does 80% of
work, so why write 80% of code nobody uses? In my case, the web is my
user acceptance test.
* so release early, release often. In venture capital world, it’s
called startup fast, fail fast. Think your startup will be the next
facebook or youtube? think again, for every successful startup,
there’re dozens failed ones you never heard of, so why waste 1 year to
learn the truth if you can do it in 3 months?
* one side effect by releasing early is you get to earn that
fabulous adsense dollars right away (although i haven’t earned a dime
yet). Cash flow is always important for anyone who bootstraps.
Maximize your effort. User requirement changes, site traffic changes,
life sucks, blah blah. there’s no one design that satisfy all the
requirements. Changes are unavoidable, eventually rewrite may be the
best solution. The best design is one that satisfy the most
requirements with least cost, don’t over engineer something.
===Failing is learning
I can tell you what i’ve done. When I was creating groups.wuyaSea.com,
i went through 2 prototypes, after a few months, each one becomes too
rigid and unmaintainable, then throw it away, and start over. Current
site is my 3rd implementation. Making webapp is like doing everything
else in life, you learn by just doing it. keep cranking, if it fails,
keep trying again.
hope that helps.
copy of this is also available at
Person who asked this question may also like