• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PetStore Account Class

 
James Gordon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was going through the petstore application and found something which I can't figure out regarding the Customer related classes.

What benefit do we get by introducing the Account class?
Why not just have the CreditCard and ContactInfo as attributes for Customer?

Please comment.

Thanks in advance.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you provide more data on this we will be able to help you better. Not everyone here knows what the petstore is and what it attempts to do. If you can tell us the relationship between the classes right now, people will be able to add thoughts on that.
 
Ashish Sarin
author
Ranch Hand
Posts: 444
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James,

The Account class contains the active/inactive status of the customer. Thats the only relevant information it contains directly. The ContactInfo and CreditCard classes are linked to Account class. You don't need an Account class if you are not tracking active/inactive status of the user.
In SCEA Part II assignment I haven't used the Account class because I preferred not to track the user status.

Hope this helps.
Ashish
 
James Gordon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashish,

Even if I need to keep track of the status, I guess I would have it
as an attribute in the Customer class itself. I personally don't see any reasons introducing the Account class.
 
Ashish Sarin
author
Ranch Hand
Posts: 444
10
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic