Designing Poker game

77 views
Skip to first unread message

Arun Nair

unread,
Dec 6, 2020, 3:03:20 AM12/6/20
to DDD/CQRS
Hi,
  I am starting to design a mobile based Poker game.  As there are many variants of poker, I was thinking about creating a Base PokerGame class, and deriving all its variants from them as sub classes.  Each sub class will encapsulate rules pertaining to the variation.

But what is needed is, to add support to other poker variants, without changing code.
The only way I know is to use Open Closed Principle, but that would entail adding new code.

Is it possible to add support to poker game variants without any code change? If yes, what would the approach be.

Thanks,

Arun

Niket Kapadia

unread,
Dec 7, 2020, 12:11:46 AM12/7/20
to DDD/CQRS

Hi,

 

Not Exactly the answer you are looking for but I am developing mobile app to capture golf score and identifying winners based on different games.

And while implementing it, I am considering to use RedHat Process Automation Manager for core game engine.

The reason for selecting it is, product owner  can visualize the complete scoring process for different games very easily. 

Still this is hypothetical and in coming days, I will have better idea.

Niket Kapadia

unread,
Dec 7, 2020, 12:11:47 AM12/7/20
to ddd...@googlegroups.com

Hi,

 

Not Exactly the answer you are looking for but I am developing mobile app to capture golf score and identifying winners based on different games.

And while implementing it, I am considering to use RedHat Process Automation Manager for core game engine.

The reason for selecting it is, product owner  can visualize the complete scoring process for different games very easily.

 

Still this is hypothetical and in coming days, I will have better idea.

 

Regards

Niket 

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dddcqrs/b0decae7-e51b-4423-a09a-9e79378a0d61n%40googlegroups.com.

Jorge Olivé

unread,
Dec 7, 2020, 12:11:47 AM12/7/20
to ddd...@googlegroups.com
Hello, 

The question is whether those rules could be parametrized through pure configuration settings. If game rules are widly different between variants I dont think you have many options other than adding new code.

 Given this, as it seems you are trying to avoid inheritance, I would take a look at some compositional/behavioural patterns such as strategy, decorator or bridge. 

Regards, 
Jorge

--
Reply all
Reply to author
Forward
0 new messages