Class Suffix Guideline

July 01, 2021

Following suffixes are guidelines to help understand the responsibility of a class.

Builder

This is generally a builder pattern that creates a class. Generally exptected behaviour is to call Build() after setting mandatory and optional properties.

Also, the instance is expected to be re-used.

Model / Controller / View

This is typical Model of the view that this representing. This applies to both Model-View-Controller (MVC) or Model-View-View-Model (MVVM).

Manager

Class that manages multiple objects. Like a baseball manager that keeps track of players. Team manager that keeps track of a team.

Context

Class housing the process context. A context can span from application down to a function.

Service

Class that provides services. Relating to the infrastructure layer.

Session

Class that provides session (short lived) data. This has some similarities with Context. Main difference is the session may not depend on the context.


© 2023 Kee Nam