Re: Which data structure to use for semi static data?

Duane Johnson
2005-05-29T20:29:08Z

Putting that in the database would make the most sense to me.  The
time to access a database is usually equal to or less than the time
to load a text file.  In addition, it would only take ten to twenty
minutes to build the scaffold you''d need to edit / add / delete
apartment or building information.

Duane Johnson
(canadaduane)

On May 29, 2005, at 2:56 PM, Matthew Margolis wrote:

> I have a three level deep hierarchy  building > apartment > room.
> The listing will only change once a year and will consist of a
> hefty number of subtractions and just a few additions.  I will be
> using each level in the hierarchy as a limiting factor in choosing
> which items to show from the level below it in an option select box
> in a form using some ajax.
>
> So to start you would have a drop down labeled building.  If you
> choose building ''10'' an ajax request will be made that
will create
> the code to render a drop down that lists all the apartments in
> building ''10''.  When you chose the apartment an ajax
request will
> be made that will render a drop down list with all the rooms in
> that specific apartment.
>
> With this knowledge how would you recommend that I store my
> hierarchy in my application?  It doesn''t change very often so I
was
> thinking that maybe I should not throw it in the db.  If I keep it
> purely in code as some sort of class or hash structure then I
won''t
> have to hit the db so often and initial setup could be done inside
> of a text editor as opposed to the having to use funky sql syntax
> or slow phpmyadmin record entry forms.
>
>
> Thank you,
> Matthew Margolis
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>