Should I limit my type name suffix vocabulary when using OOP?
Posted
by
Den
on Programmers
See other posts from Programmers
or by Den
Published on 2014-08-18T08:33:47Z
Indexed on
2014/08/18
16:44 UTC
Read the original article
Hit count: 273
My co-workers tend to think that it is better to limit non-domain type suffixes to a small fixed set of OOP-pattern inspired words, e.g.:
- *Service
- *Repository
- *Factory
- *Manager
- *Provider
I believe there is no reason to not extend that set with more names, e.g. (some "translation" to the previous vocabulary is given in brackets):
- *Distributor (=> *DistributionManager or *SendingService)
- *Generator
- *Browser (=> *ReadonlyRepositoryService)
- *Processor
- *Manipulator (=> *StateMachineManager)
- *Enricher (=> *EnrichmentService)
(*) denotes some domain word, e.g. "Order", "Student", "Item" etc.
The domain is probably not complex enough to use specialized approaches such as DDD which could drive the naming.
© Programmers or respective owner