Question: Factory Pattern Our Deck from the Blackjack Game is an interesting Class. We produce one Deck and add it to the DealPile in our implementation.

Factory Pattern

Our Deck from the Blackjack Game is an interesting Class. We produce one Deck and add it to the DealPile in our implementation. However, it is easy to see that there may be call to change this for different situations. For more players, or to prevent "card counting," it might be useful to have a way to create a Deck with 5 of each card for the DealPile For a different game (e.g., Pinochle), it may be helpful to generate a Deck with a subset of the cards.

The Cards in the Deck all behave the same, but the generation of the Deck object itself may have a number of variations, as described above.

All hands on DeckDiagram (in a Class Diagram) the set of classes and methods needed to implement a Factory Pattern for creating

Standard, 52-card decks

Jumbo, 260 card Decks (containing the same cards as 5 52-card Standard decks)

Pinochle, a 48-card deck consisting of 2 copies of each standard card 9, 10, J, Q, K, A in each suit.

Notes

Your diagram should show inheritance/subclassing as appropriate, and all public methods should be shown.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!