Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming cleanup #61

Open
nicpottier opened this issue Jan 17, 2019 · 1 comment
Open

Naming cleanup #61

nicpottier opened this issue Jan 17, 2019 · 1 comment
Assignees
Labels

Comments

@nicpottier
Copy link
Member

I haven't been super consistent on the naming of all the utilities in models, need to do through and audit and rename them.

Current thinking is for extreme clarity, so things like, CreateContact should be InsertContact and things like GetContact should be SelectContact.. IE if we know for sure we are going to hit the DB, then we use Select .. if there may be a cache in between then we can use Get. Same rules for Update etc..

@nicpottier nicpottier added this to the GoFlow Launch milestone Jan 17, 2019
@nicpottier nicpottier self-assigned this Jan 17, 2019
@nicpottier nicpottier removed this from the GoFlow Launch milestone Jun 12, 2019
@rowanseymour
Copy link
Contributor

Thought about this a bit when I was adding all the new import stuff. I think I would lean toward verbs that provide some information about the higher-level contract rather than the db operations, since there's often multiple db operations involved.

So exported functions that look like:

CreateX - create new X and return it, or error
GetX - return existing X or an error
GetOrCreateX - return existing or newly created X or an error
LookupX - X may or may not exist, may return nil and no error
UpdateX
ReleaseX

But those might call lower-level utilities which do actually describe their DB behavior:

queryX (e.g. queryContactIDs)
insertX (e.g. insertContactAndURNs)
deleteX

awensaunders pushed a commit to Jozian/mailroom that referenced this issue Sep 8, 2023
Handled incoming messages should be associated with the open ticket if there is one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants