D2: deck of cards

imagine we’re designing the objects for a deck of cards. Consider the following approach:
1.  What are you trying to do with the deck of cards? Ask your interviewer.  Let’s assume 
we want a general purpose deck of cards to implement many di#erent types of card 
games.
2.  What are the core objects—and what “sub types” are there? For example, the core 
items might be: Card, Deck, Number, Suit, PointValue
3.  Have you missed anything? Think about how you’ll use that deck of cards to imple-
ment di#erent types of games, changing the class design as necessary. 
4.  Now, get a little deeper: how will the methods work? If you have a method like Card 
Deck:.getCard(Suit s, Number n), think about how it will retrieve the card. 
posted @ 2013-03-06 06:00  西施豆腐渣  阅读(149)  评论(0编辑  收藏  举报