# What's the flow?

**URL:** <https://www.ruby-forum.com/t/whats-the-flow/107566>\
**Category:** Rails\
**Created:** [June 23, 2007, 12:37pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566 "2007-06-23T12:37:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 23, 2007, 12:37pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/1 "2007-06-23T12:37:32Z")

</div>

Hello,  
I’m new to web programming. I want to learn about the process while  
developing web applications. What must come first? design, database or  
model?

I think the order must be design-\>database-\>model.

What’s the best approach?

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 23, 2007, 3:17pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/2 "2007-06-23T15:17:59Z")

</div>

Hi Bahadir

it depends on what you want to do, what size of your ideas have.

Get a pen, a paper write your ideas down.  
Then start with a design or your business model

I think the design (rough) should come out of your business model,  
where your application design should come out of your rough design  
sketch.  
In Rails, many Ideas may come also later while you are programming,  
because you discover nice features in ruby and/or rails, which helps  
you to integrate nice-to-have features.

But as I said, try starting with pen and paper write your ideas down  
and make a sketch, of what you have in mind.

best regards and have fun!

Rafael

On 23 Jun., 12:37, “BahadÄ±r DoÄŸan” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 26, 2007, 2:25am UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/3 "2007-06-26T02:25:05Z")

</div>

Bahadir Dogan wrote:

> I’m new to web programming. I want to learn about the process while  
> developing web applications. What must come first? design, database or  
> model?

In traditional development, you must write the database first, then the  
design. That’s because changing a traditional program - especially  
changing  
the database schema - runs incredible risk of bugs.

Rails is a member of a category of programming styles called “Agile”,  
meaning Rails uses tests and database migrations to help reduce the  
impact  
of early design mistakes. This, in turn, allows you to start a program  
as  
“lean” as possible. Just enough data tables, models, and controllers to  
pass  
some test, and produce some output.

So the flow should be to write unit tests and functional tests, get them  
to  
fail, then write enough code to pass the test. And repeat, adding a test  
for  
each new bit of code you need. Keep your program as simple as possible  
at  
all times.

Some programming environments make that technique very hard. HTML  
development makes it especially hard. Rails is unique in the industry  
for  
making test-driven development for HTML easier than most other  
platforms.

–  
Phlip  
[Test Driven Ajax (on Rails) [Book]](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 23, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/4 "2007-06-23T15:51:03Z")

</div>

BahadÄ±r DoÄŸan wrote:

> I’m new to web programming. I want to learn about the process while  
> developing web applications. What must come first? design, database or  
> model?
> 
> I think the order must be design-\>database-\>model.
> 
> What’s the best approach?

Focus on the user experience: views =\> models =\> database  
=\> controllers

–  
We develop, watch us RoR, in numbers too big to ignore.

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 26, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/5 "2007-06-26T13:07:14Z")

</div>

Hi –

On Sat, 23 Jun 2007, BahadÄ±r DoÄ~\_an wrote:

> Hello,  
> I’m new to web programming. I want to learn about the process while  
> developing web applications. What must come first? design, database or  
> model?
> 
> I think the order must be design-\>database-\>model.
> 
> What’s the best approach?

It depends so much on the project. When I’m working on something  
alone, at least, I always seem to work on the domain modeling and  
database design first, and then layer the program logic (the  
controllers) and design (to the extent that what I do can be called  
design 🙂 on top. But that’s just how I work; it’s not necessarily a  
recommendation that you proceed the same way.

David

–

- Books:  
RAILS ROUTING (new! [http://www.awprofessional.com/title/0321509242](http://www.awprofessional.com/title/0321509242))  
RUBY FOR RAILS ([Ruby for Rails](http://www.manning.com/black))
- Ruby/Rails training  
& consulting: Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 27, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/6 "2007-06-27T23:55:02Z")

</div>

Hi,

In my opinion it should start and end with the user interface. This is  
the  
only part of the entire system that the user will see and will use so  
the  
user interface should drive everything else. Now, this doesn’t mean that  
the  
UI needs to be nailed down and signed off before you start working on  
the  
model or the DB, but it means that in any iteration, the work being done  
should be driven by the state of the UI for that iteration and should be  
ultimately verified according to the UI.

So, to put this more simply, create a screen(s) and then work to make  
the  
screen(s) function. Then go back to the screen(s) and ensure that what  
is  
happening and the data you are getting back based on what you are  
entering  
is correct.

As much as the rest of the application is important, your users don’t  
care  
if there is a database or you are using comma separated flat files.

Cheers,  
Chris

On 6/23/07, BahadÄ±r DoÄŸan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
[www.fuzzylizard.com](http://www.fuzzylizard.com)

You know you’ve achieved perfection in design, Not when you have nothing  
more to add, But when you have nothing more to take away.  
– Antoine de Saint-Exupery

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 27, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/7 "2007-06-27T21:58:52Z")

</div>

Agile doesn’t change the order of the traditional process of software  
development it shortens the cycles of releases.

More like this:  
analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy-

> analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy-  
> analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy-  
> analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy-  
> analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy-  
> analysis-\>design-\>develop-\>deploy-\>anlysis-\>design-\>develop-\>deploy

```
This increases transparency of status of the project, mitigates

```

risks, and reveals scope and resource usage (velocity)…

~)o  
gustin

[http://www.entryway.net](http://www.entryway.net)

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 28, 2007, 5:50am UTC](https://www.ruby-forum.com/t/whats-the-flow/107566/8 "2007-06-28T05:50:27Z")

</div>

> It depends so much on the project. When I’m working on something  
> alone, at least, I always seem to work on the domain modeling and  
> database design first, and then layer the program logic (the  
> controllers) and design (to the extent that what I do can be called  
> design 🙂 on top. But that’s just how I work; it’s not necessarily a  
> recommendation that you proceed the same way.

I’m the same way, but neither of us are designers 🙂

I think it’s a good idea to go straight to the source though. Rails  
was created out of a 37signals application, so it’s tailored to the  
way they work. Getting Real is their PDF book talking about it:  
[Getting Real](http://gettingreal.37signals.com/toc.php).

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
