Devs ~ Coding style - GeoscienceAustralia/egeodesy GitHub Wiki
Generally follow:
Services
Based on https://docs.angularjs.org/guide/services, Services are:
@Injectable()
- can be dependency injected (Singleton, holds some state) - in components or other services- Give them a '.service' suffix
Functional Classes
This is everything else.
Ideally we should only use services when necessary (ie. hold some state) and then defer to either standard classes that we new()
or better still, standard classes with static
methods (since more efficient as no copies created on the stack; and easier to code since don't need to new()
first).
These will NOT have a .service
suffix.