Skip to content

Singleton rule per session ? #352

Closed Answered by snikolayev
GianLucaBagnoli asked this question in Q&A
Discussion options

You must be logged in to vote

@GianLucaBagnoli there are legit use cases where the same rule type may need to be instantiated multiple times. E.g. if the class is parameterized, and each instance is actually a different rule with different conditions. So, the RuleRepository cannot make assumptions about the rules' uniqueness solely based on the type. You are right - it is the caller's responsibility to ensure logical uniqueness of the rules in the repository.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GianLucaBagnoli
Comment options

Answer selected by GianLucaBagnoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants