What kind of naming convention (if any) do we want for these top level abstract classes? #1555
TotoGaz
started this conversation in
Infrastructure
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
PR #1418 implements an abstract base class (hence the
ABC
)CellBlockManagerABC
on top of all the hierarchy.Same for
CellBlockABC
. ThoseABC
classes are meant to describe the concept for the client code.This trailing
ABC
does not exist yet inGEOSX
.When working at this refactoring, I used it as a reminder for myself.
The question is “What kind of naming convention (if any) do we want for these top level abstract classes?”
In GEOSX we currently have
Base
suffix convention to indicate that we have something on top of a hierarchy.But quite often also this
Base
is meant to share/factorize code for the derived classes. (Which should not be the case forABC
classes).And one may finish exposing too much: we may have to expose some factorized pre-computational method (or maybe simply a setter) that would not fit another context.
The idea of the
ABC
is to offer the contract and only the contract.So how do we want to call these
ABC
classes. There are multiple options.ABC
for abstractions, keepBase
on centralized implementations.ABC
, useBase
on top instead. (CellBlockManagerABC
becomesCellBlockManagerBase
)ABC
, use nothing instead.CellBlockManagerABC
would becomeCellBlockManager
, the derived implementations will have to find some descriptive name (can beBase
?)namespace api
(e.g.geosx::api::CellBlockManager
) for the contracts.Personally, I’m not too much in favor having devs manipulating
Base
classes.Consider
EventBase
: devs manipulate a bunch ofevents
, noteventBases
. And we have anEventManager
, not anEventBaseManager
.Beta Was this translation helpful? Give feedback.
All reactions