The reason to define a service interface is to enable the creation of
so-called service middlewares. Service middlewares are implementations
of your service that perform a single responsibility (logging,
instrumentation, audit trail reporting, etc.) and pass the thread of
execution to a wrapped service interface. In this way, the "core"
concrete implementation of your service can perform only the core
business logic, including things like interacting with
storage/persistence layers.
It's generally unusual for the store/repository type to look similar
to the service type, i.e. have a similar set of methods. Normally, the
repository is a CRUD-oriented data access layer, and the service
provides a higher-level, user- or goal-oriented API. The profilesvc is
somewhat atypical in that the user-oriented API is approximately a
CRUD-oriented API. I think that is an anomaly; I probably wouldn't try
to make design decisions on the assumption that this is true across
most/all services.
Hope this helps,
Peter.
> --
> You received this message because you are subscribed to the Google Groups
> "Go kit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
go-kit+un...@googlegroups.com.
> To post to this group, send email to
go-...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/go-kit/4b37b7ec-89b1-4717-b365-b067c57db197%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.