Skip to content

Instantly share code, notes, and snippets.

@sbose78
Created February 13, 2018 03:11
Show Gist options
  • Save sbose78/4bb7d589014ee896958956981c84f1a7 to your computer and use it in GitHub Desktop.
Save sbose78/4bb7d589014ee896958956981c84f1a7 to your computer and use it in GitHub Desktop.
type OrganizationService interface{
CreateOrganization(...)
ListOrganization(...)
}
type OrganizationServiceImpl struct{
organizationModelService OrganizationModelService
}
func NewOrganizationServiceImpl( m organizationModelService ) OrganizationServiceImpl{
return OrganizationServiceImpl{
organizationModelService: m,
}
}
func (o *OrganizationServiceImpl) CreateOrganization(...) error {
o.CreateOrganization(..) // model service call.
return nil
}
-----------------------------------------------------------------------------------------------
type OrganizationModelService interface{
CreateOrganization(..)
ListOrganization(..)
}
type OrganizationModelServiceImpl struct{
app.DB
}
func NewOrganizationModelServiceImpl( db ) OrganizationServiceImpl{
.............
}
func (o *OrganizationModelServiceImpl) CreateOrganization(...) error {
// call 10 different database tables/DAOs/repositories
return nil
}
---------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment