Defining your service's interface

When I start to write a service, I use a set of best practices to guide me on its construction. I've gathered these over my years of writing libraries, frameworks, and services, and they never fail to provide the proper guidance as I write my code.

Focus on the developer, not yourself

When you start to define a service, think about the consumer of your service and what their skill levels are; are they experienced developers, are they new to the framework, or are they in-between? Does your service require knowledge of higher-level concepts to comprehend? Or, is it very basic to comprehend? These are all things you should think about, because the harder it is for the developer to consume your service, the more painful ...

Get AngularJS Services now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.