PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Design question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Design question

Réponse
 
LinkBack Outils de la discussion
Vieux 19/04/2008, 16h06   #1
Adrian
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Design question

Hi All

I am restructuring a company's DB and web-based ordering system. The
DB contains separate tables for
1. Users (who may or may not be customers and/or users)
2. Customers (who may or may not be customers and/or users)
3. Contacts (who may or may not be customers and/or users).

Part of the restructure involves enabling current customers to view/
edit their orders and details online where previously only Users (who
typically staff) were able to do this.

Question:

Should the redesign:
a. Keep tables separate, or
b. Combine the tables into a single table

Note that all types may eventually become users and that separate
tables are planned for roles and permissions.

Any advice welcome

Thanks
Adrian
  Réponse avec citation
Vieux 19/04/2008, 16h40   #2
Erick T. Barkhuis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Design question

Adrian:
> Hi All
>
> I am restructuring a company's DB and web-based ordering system. The
> DB contains separate tables for
> 1. Users (who may or may not be customers and/or users)
> 2. Customers (who may or may not be customers and/or users)
> 3. Contacts (who may or may not be customers and/or users).

[...]
> Should the redesign:
> a. Keep tables separate, or
> b. Combine the tables into a single table


Well, you haven't told us yet:
- what the difference between those three groups is
- why you want to define these three groups
- how a member of one group becomes member of another group

In other words: why not one table "ThemFolks"?

--
Erick
[concerned that you are talking about tables, and not about entities in
your ER diagram]

  Réponse avec citation
Vieux 19/04/2008, 16h40   #3
Michael Austin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Design question

Adrian wrote:
> Hi All
>
> I am restructuring a company's DB and web-based ordering system. The
> DB contains separate tables for
> 1. Users (who may or may not be customers and/or users)
> 2. Customers (who may or may not be customers and/or users)
> 3. Contacts (who may or may not be customers and/or users).
>
> Part of the restructure involves enabling current customers to view/
> edit their orders and details online where previously only Users (who
> typically staff) were able to do this.
>
> Question:
>
> Should the redesign:
> a. Keep tables separate, or
> b. Combine the tables into a single table
>
> Note that all types may eventually become users and that separate
> tables are planned for roles and permissions.
>
> Any advice welcome
>
> Thanks
> Adrian



So, you took on a job for which you were not qualified and expect the
user community - a number of whom are IT/DB professionals - to do your
job for free? My fee is $75hr for this sort of work...



  Réponse avec citation
Vieux 19/04/2008, 18h08   #4
Adrian
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Design question

On Apr 19, 4:40pm, Erick T. Barkhuis <erick.use-...@ardane.c-o-m>
wrote:
> Adrian:
>
> > Hi All

>
> > I am restructuring a company's DB and web-based ordering system. The
> > DB contains separate tables for
> > 1. Users (who may or may not be customers and/or users)
> > 2. Customers (who may or may not be customers and/or users)
> > 3. Contacts (who may or may not be customers and/or users).

> [...]
> > Should the redesign:
> > a. Keep tables separate, or
> > b. Combine the tables into a single table

>
> Well, you haven't told us yet:
> - what the difference between those three groups is
> - why you want to define these three groups
> - how a member of one group becomes member of another group
>
> In other words: why not one table "ThemFolks"?
>
> --
> Erick
> [concerned that you are talking about tables, and not about entities in
> your ER diagram]


Good point - the objects in the domain model are:

1. Customer - who has orders for products and collects to ordered
items from a delivery location
2. User - who can login, edit, add orders and various admin functions
depending on role/permissions
3. Contact Person - who acts as the point of contact at a delivery
location

At present no customers are users (ie have online access) but purpose
of the re-development is to provide customer with a user account.
Contact people are often customers but not necessarily.

Thanks
  Réponse avec citation
Vieux 19/04/2008, 18h54   #5
Erick T. Barkhuis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Design question


Adrian [on Sat, 19 Apr 2008 10:08:10 -0700 (PDT)]:


> 1. Customer - who has orders for products and collects to ordered
> items from a delivery location
> 2. User - who can login, edit, add orders and various admin functions
> depending on role/permissions
> 3. Contact Person - who acts as the point of contact at a delivery
> location


So, you have 'people' who are at least a Contact...someone you have to
deal with, one way or the other.
Add a few relationships (hasOrdered, mustPay) and attributes (billing
address, customerNumber) and he is a Customer. Add some more (uID,
password, memberOfDepartment) and he is a User.

Barring any repetitive attributes, you may consider putting it all into
one table, leaving the superfluous columns NULL. The alternative would
be one table for all common fields, and two more for the additional
fields of Customer and User.

Me? I would let it depend on the company's dynamics. If you expect more
roles or 'people types' in the near future, then I'd go for the smallest
common table possible, and additional tables for specific 'people type
fields'.


--
Erick

"Tell me what you need, and I'll tell you how to get along without it."
  Réponse avec citation
Vieux 19/04/2008, 19h14   #6
Adrian
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Design question

On Apr 19, 6:54pm, Erick T. Barkhuis <erick.use...@ardane.c-o-m>
wrote:
> Adrian [on Sat, 19 Apr 2008 10:08:10 -0700 (PDT)]:
>
> > 1. Customer - who has orders for products and collects to ordered
> > items from a delivery location
> > 2. User - who can login, edit, add orders and various admin functions
> > depending on role/permissions
> > 3. Contact Person - who acts as the point of contact at a delivery
> > location

>
> So, you have 'people' who are at least a Contact...someone you have to
> deal with, one way or the other.
> Add a few relationships (hasOrdered, mustPay) and attributes (billing
> address, customerNumber) and he is a Customer. Add some more (uID,
> password, memberOfDepartment) and he is a User.
>
> Barring any repetitive attributes, you may consider putting it all into
> one table, leaving the superfluous columns NULL. The alternative would
> be one table for all common fields, and two more for the additional
> fields of Customer and User.
>
> Me? I would let it depend on the company's dynamics. If you expect more
> roles or 'people types' in the near future, then I'd go for the smallest
> common table possible, and additional tables for specific 'people type
> fields'.
>
> --
> Erick
>
> "Tell me what you need, and I'll tell you how to get along without it."


Thanks Erick

I'm leaning toward a single table soln - I guess I was just facing the
question of object model vs data model and which first - an issue that
I have now seen is extensively discussed on the web.

Cheers
Adrian
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h54.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12963 seconds with 14 queries