General Notes:
1. There is a balance you need to maintain. The easier things are for
your users, the more work needs to be done by the developer. The
methods suggested below can be tweaked, depending on where you choose
to set the sliding scale between your burden (of time and expense) and
that of your users.
2. Based on the priorities laid out in your question and your RFC, I
am suggesting a method that will keep your data relatively simple,
while still offering you a lot of choices for how to present the
information to both groups of your users.
3. I assumed that you are using a relational database. I also assume
that you have a table in your database called tblBusinesses which
stores, among other things, a unique id for each business
(BusinessID).
--- The Back End - Database Tables ---
I recommend creating a table to store your geographic areas. Let's
call it tblRegions. tblRegions can have the following fields:
RegionID - Autonumber - Unique ID
RegionName - Text - The name of the region, i.e. Michigan, France...
RegionGroupID - Number(Long Integer) - See below for details
The above table will allow you to define and redefine the regions that
you are interested in as you see fit. If you want to list all the
counties in Australia and all the individual boroughs of New York, but
only list the country for Germany, then you can do that. The
RegionGroupID allows you to tie Regions together. For example, you can
list Vermont, New Hampshire and Maine as separate states, but also tie
them together for search purposes as US Northeast. The records in
tblRegions would look like this:
RegionID RegionName RegionGroupID
-----------------------------------------
1 US Northeast
2 Vermont 1
3 New Hampshire 1
4 Maine 1
You can cascade RegionGroups to develop whatever relationships you
need. For example, if you want US Northeast to also be found for
searches on United States, then:
RegionID RegionName RegionGroupID
-----------------------------------------
1 US Northeast 5
2 Vermont 1
3 New Hampshire 1
4 Maine 1
5 United States
Depending on how you write your queries, Vermont, New Hampshire and
Main can also appear in searches for United States.
Once you have the data entry done on this, it's all in how you write
your queries for what you get back when. It also makes it very easy to
do things like move countries out of Europe and into the European
Union.
OK, now that you have tblRegions, you need to tie the Regions to the
Businesses. We'll do that using a junction table. A junction table is
a small table used to avoid many-to-many relationships. If you want to
be bored by why that would be a problem, please post an RFC and I'll
be glad to elaborate :>.
We'll call the junction table tblBusinessRegions. This table will
contain one record for each Region a Business inhabits. It has the
following fields:
BusinessRegionID - Autonumber - Unique ID
BusinessID - Number(Long) - BusinessID from tblBusinesses
RegionID - Number(Long) - RegionID from tblRegions
Type - Text - Office or Service Area
If a Business has offices in Maine and Vermont, but serves the entire
US Northeast, then its records in tblBusinessRegions would look like
this:
BusinessRegionID BusinessID RegionID Type
----------------------------------------------------
1 1 4 Office
2 1 2 Office
3 1 1 Service Area
Depending on your needs, you may want to have separate junction tables
for Office and Service Area. For efficiency and flexibility, you may
also want to create a small lookup table for the Types.
--- The Front End - User Forms ---
At this point, you have a lot of choices for how you present this
information to your users. It's difficult for me to make
recommendations without more information, but here are some
suggestions:
On the website where your businesses update their info, you can offer
them a choice of Quick Entry or Maximize Hits. Quick Entry takes them
to a broad image map or set of lists where they are offered detailed
choices for their own country, but only the broad choices for other
countries. This will cause them to appear in less searches, but they
get out quicker. Maximize Hits presents drilldowns with lots of
specific choices where they can select all 60 office locations and 20
additional service areas. They do more work, but they hit in many more
searches, and they elected to do the extra work.
The Searching users can be offered detailed drilldowns to perform
their searches, enabling them to easily change search scope to include
RegionGroups searches, etc.
Wrapping Up:
Without a more detailed understanding of your requirements, budget and
priorities, I can't lay out a complete plan for you, but I hope this
gives you an idea of how you can set up such a thing. There is a lot
of work here for the person who needs to build the forms and queries
that make this sort of system do its job. I recommend you get their
input before making a decision. Please request clarification if you
need me to elaborate on any particular point.
Best regards,
- Hammer |