Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Marker interfaces #242

Open
1 of 2 tasks
georgait opened this issue Dec 10, 2022 · 3 comments
Open
1 of 2 tasks

[FEATURE]: Marker interfaces #242

georgait opened this issue Dec 10, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@georgait
Copy link

Description

The IInteraction interface is a marker interface and according to
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1040
this rule is violated.

Alternatives

Attributes might suit better.

Anything else?

If you have a different take on this, it would be nice to have it explained or even documented.

Commitments

  • I agree to follow Boa Constrictor's Code of Conduct.
  • I want to work on this issue myself. (This is voluntary, not required.)
@georgait georgait added the enhancement New feature or request label Dec 10, 2022
@AutomationPanda
Copy link
Contributor

That's interesting.

Philosophically, the IInteraction interface is the base interface for all interactions: Tasks and Questions. I like having that shared root.

Pragmatically, IInteraction is used by AnswerCache. I'm not sure why it doesn't use ICacheableQuestion instead. I don't remember. I'll ask the other core contributors.

Rather than removing IInteraction outright, we should consider if there is anything we should add directly to it. I don't think an attribute would be appropriate.

@AutomationPanda
Copy link
Contributor

Okay, so I did some playing around, and I realized why AnswerCache uses IInteraction directly. The answer cache holds answers to any kind of cacheable questions. Its methods control the type conversion, but the internal Dictionary uses the IInteraction type as the key type. I suppose a non-generic Dictionary could be used instead.

@AutomationPanda
Copy link
Contributor

#244 removes IInteraction from AnswerCache so there's one less reference to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants