I am working on an ERD which represents the relationships between entities in a Web development company behavioral model. There I have entities like:
- Customer
- Service ----------- (like: web development, web design, web consultation, ...)
- Order-item ------- (like: web development, web design, web consultation, ...)
- Order
- Invoice
- Project
- Project-phase
- Task --------------- (like: web development task3, web design task7)
- Developer
- Delivery ----------- (like: the developed web app, web consultation session, ...)
I have this diagram so far, though I know it still has major problems, and it is just for a start point:
Main concept
- Customer makes
order-item
s onservice
s, combined to form anorder
which relates to aninvoice
. - Each
project
has multipleproject-phase
s with eachproject-phase
related to anorder
. - Each
project-phase
has multipletask
s, each of which is assigned to adeveloper
. - Each
project-phase
has adelivery
, which will be delivered upon payment of the relatedorder
sinvoice
.
Questions
- Are
has
andcontains
completely the same? If not, how to choose between them for relationships?! what is the measure?! - Are there any rational problems with the Main concept section?
- Any helpful ideas or suggestions to improve this model?
Any help with this, would be really appreciated.
Update 1
Refined version of the diagram
Update 2
Considering an analogy of a Fast food restaurant would be helpful:
- Customer ---------- A hungry person
- Service ------------- Making a burger, Home delivery, Mobile delivery, ...
- Order-item --------- A burger, ...
- Order ---------------- A home-delivered burger
- Invoice -------------- The printed invoice
- Project -------------- Serving the customer for a complete year (like a contract)
- Project-phase ----- Serving the customer for a single day
- Task ----------------- Preparing the kitchen, process the meat, ...
- Developer ---------- The cookie
- Delivery ------------- A burger in wrapped in wax papaer and a drink with the tray
Update 3
Project seems to be unrelated to Customer in your diagram. Is this what you intended?
I think Order is and Project should not be related, as I think it is something off-the-counter and customer has nothing to do with it. she/he is only after the delivery and is concerned about time and money, nothing else. Please tell if I am wrong.
Are all Orders part of a Project or can you have orders that aren't in a project at all?
All Orders are part of a project, except those new ones which are waiting in the process queue.
Similarly, you relate order item directly to customer, but also to order. Are orders split between customers?
Please think of Order-Item as these:
- web design
- web design consultancy
- domain name consultancy
- ...
So, customer choose some of these items, collected as an Order which has an invoice and could be paid. Order-Items are directly related to offered Services. I don't understand what do you mean by Are orders split between customers?.
If not you don't need a ternary relationship between customer, order item and service. Rather, an order item is an intersection between order and service. Order items belong to customers by inheritance from order (or even project?)
This is somehow true: Order items belong to customers by inheritance from order, but I think it is more rational to say it like this:
Order-Items, inherited from Service, belong to Order which itself belongs to Customer.