Skip to content
Discussion options

You must be logged in to vote

The -er suffix works well for simple interfaces like io.Reader & io.Writer (or even io.ReadCloser). One option is to break up the interface into smaller interfaces like DialFinder, DialCreator, DialUpdater, & DialDeleter. However, I've found that you end up with a lot of tiny interfaces without much benefit.

Naming the service as Dialer is an option but that would imply that there's a Dial() function. That's the case with net.Dialer (although that's not an interface).

Ultimately it comes down to what works for me in practice. "Service" is generic enough that I don't need to think about what to name the CRUD interface but it's clear that it handles an entity.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benbjohnson
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