JRockFL
asked on
General Class Questions
Let's say I am creating a program to create invoices for clients
So far, I have these classes
contact (abstract)
company (inherits contact)
client (inherits contact)
invoice
invoice would have properties like invoice date, invoice number, invoice total etc.
My question is
Would the line items for the invoice need to be their own class? Why or what not?
The line items might be something like... be quantity, rate, description total
So far, I have these classes
contact (abstract)
company (inherits contact)
client (inherits contact)
invoice
invoice would have properties like invoice date, invoice number, invoice total etc.
My question is
Would the line items for the invoice need to be their own class? Why or what not?
The line items might be something like... be quantity, rate, description total
You might want to explain what your line items would be.
If an invoice has several line items, and each item may consist of more than one parameter(Eg: Name, type, date, cost...etc), then it would be wise to create a class called Item.
This would make things easier later on, when u start creating, adding and even removing line items.
If an invoice has several line items, and each item may consist of more than one parameter(Eg: Name, type, date, cost...etc), then it would be wise to create a class called Item.
This would make things easier later on, when u start creating, adding and even removing line items.
ASKER
Thanks for the replies. Yes, the rate could come from the client class.
Typically, I have several items on an invoice like...
Qty Desc Rate Total
2 Analysis of code changes 35 70
1 Code changes 35 35
Typically, I have several items on an invoice like...
Qty Desc Rate Total
2 Analysis of code changes 35 70
1 Code changes 35 35
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jim,
Your thoughts now that I provided a little more details?
Your thoughts now that I provided a little more details?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Jim, I could create a list of lineitem classes like you suggested.
I was thinking the entries would be stored in a database. Is that what you mean by your question, or something else?
Also, is there a "rule of thumb" of when to create classes?
I was thinking the entries would be stored in a database. Is that what you mean by your question, or something else?
Also, is there a "rule of thumb" of when to create classes?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would expect rate to come from the client class. That way you can have differet rates for different clients, and set the rate in the invoice when you invoice that client.
Jim