Re: Multidimensional Possibilities



On Dec 18, 2007 11:30 AM, Phrogz <phrogz@xxxxxxx> wrote:
I recently had to solve a one-off problem for work, and the solution I
came up with was about as non-DRY as you can imagine. I couldn't
figure out how to make it simple, however. In order to expand my
knowledge, I'm hoping to get some ideas (or even related problem
domains) to solve this generically.

The problem was this:

This website has a menu of industries, a menu of categories, and a
menu of products.
If a single industry is selected, highlight the categories and
products are available for that industry.
If a single category is selected, highlight the industries and
products are available for that category.
If a single product is selected, highlight the industries and
categories available for that industry.
If a pair of items is selected (for example, one industry and one
product) show all the related items that match the intersection (for
example, all the categories that apply to the intersection of those
two choices).

I'll have a look at your code later, but this looks to me solvable
using queries to the database; that is, if you have a database. If
not, then you are trying to create one, which task I wouldn't wish on
anybody (that's a way of saying I wish you well :). The problem
domain, though, seems confined to be tackled solely in Ruby and still
be maintainable, the solution unstable. I think it would be an
awesome Ruby Quiz!

If you have a database, using SQL (fill in the blanks)...

select <columns that you want> from industries, categories, products
where <condition>

I know, db guys/gals like to use caps for key words, but I tend to be
lazy on lists.

I'm pretty certain you were well aware of this, but I thought I'd
throw the SQL info in for other newbies (like myself, not you) that
struggle with this kind of situation.

From there, it would depend on the tool a person would use to access
the db, you know, all the ones people keep bringing up on the list.

Todd

.



Relevant Pages

  • IP: A natural experiment
    ... Representatives of interested industries come to regulators and ask for ... "Extensions of rights can help or hurt, but without economic evidence ... Europe adopted a Database ... in databases without paying the monopoly cost. ...
    (sci.econ)
  • Re: How do I add a new industry to my database?
    ... Brewery, Water, Soft Drink, but I would like to add more ... How do I go about adding more industries? ... Try pressing F11 with the database open. ...
    (microsoft.public.access.queries)
  • Re: How do I add a new industry to my database?
    ... You might want to consider future-proofing it by building in easy-to-use ... "Tom Ellison" wrote: ... make a copy of the database ... How do I go about adding more industries? ...
    (microsoft.public.access.queries)
  • Re: How do I add a new industry to my database?
    ... If the person who designed the database did not give you a way to do this, ... or instructions, then there are many possible pitfalls. ... How do I go about adding more industries? ...
    (microsoft.public.access.queries)