[Brug-talk] Technical question
Tom Klaasen
tom at 10to1.be
Thu Oct 11 04:38:28 EDT 2007
Hi Hans,
Is your question about how to avoid all those dropdown boxes, or about how
to persist everything in a database?
Assuming the second one, the answer is: it depends :-)
If you foresee only one type of house (say, a traditional one-family home),
you might want to make all relations explicit (with the risk of having high
maintenance cost to add an attribute to your model)
If you want to model multiple sorts of houses (eg appartments and boat
houses), you might want to go for a more generic approach, which allows you
to be flexible in your model, but has a detoriated performance and risks to
make business logic hard to maintain. The generic approach models everything
in 4 tables: 'objects', 'attributes', 'object types' and 'attribute types'.
You'll probably end up with a mix of both.
Don't hesitate to ask for more clarification.
(BTW, I sent this to Hans only previously by accident; is there a way to
have the reply-to header point to the list?)
hth,
Tom Klaasen
10to1
http://www.10to1.be
+32 475 28 17 62
On 10/9/07, Hans verschooten <hans at verschooten.com> wrote:
>
> Hi all,
>
> I've a question that's been on my mind for a while now.
> If I have a Model for a House. A house can have many properties that
> describe it, the kind of roof, the windows, how many floors,
> orientation, ...
> Looking at an interface to create or update the house, this would mean
> a lot of select boxes.
>
> Now my question is, how would you set this up. Every option a separate
> model,for ex a house has_one rooftype. Or is there another way, for
> ex. to group all options in one database and then use polymorphic
> associations.
>
> What is the common practice for such things? Any tips are appreciated.
>
> Thanks,
> Hans
> _______________________________________________
> Brug-talk mailing list
> Brug-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/brug-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/brug-talk/attachments/20071011/4765b9d7/attachment.html
More information about the Brug-talk
mailing list