question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Code health] Consistent naming of local DB converters

See original GitHub issue

Pretty much every local db entity has to/from conversion methods for converting a corresponding model object to the local db entity type. However, we don’t name these consistently. Sometimes they are named toModel, sometimes toObject sometimes to<ModelTypeName>

We should pick a consistent naming scheme. For extra clarity, my vote goes toward to<ModelTypeNameModel>Model; e.g.

toLocationOfInterestModel; fromLocationOfInterestModel; toAuditInfoModel; fromAuditInfoModel

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
gino-mcommented, Sep 15, 2022

I think that makes sense. I haven’t made up my mind about using inheritance solely for the purpose of enforcing naming conventions (ie LocalDbConverter would never be referenced except by implementors), but the pattern make sense.

Nit: Following Java naming conventions (assuming they’re the same in Kotlin) here we’d have LocalDb and not LocalDB.

Thanks for working through this!

0reactions
gino-mcommented, Sep 23, 2022

The last proposal sgtm, all things considered.

On Fri, Sep 23, 2022, 11:35 AM Scott Olsen @.***> wrote:

We could land somewhere in the middle:

model.toLocalDataStoreObject() entity.toModelObject()

— Reply to this email directly, view it on GitHub https://github.com/google/ground-android/issues/1276#issuecomment-1256368221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXVUQ7AC6TR6JXJXB5VPTV7XE4JANCNFSM6AAAAAAQNOF5UQ . You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database Naming Standards - DEV Community ‍ ‍
There's long been a huge debate amongst experts in database theory about whether or not database tables should be singular ( customer )...
Read more >
9. Naming Conventions - Oracle
Interface names should be capitalized like class names. Methods should be verbs, in mixed case with the first letter lowercase, with the first...
Read more >
BI Database Naming Standards: Contents
A naming standard is a collection of rules, which, when applied to data, results in a set of data objects named in a...
Read more >
Implement Best Practices for Development - Mendix Docs
This document can be used as a guideline for adopting consistent naming and modeling conventions while developing your Mendix applications.
Read more >
Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error ... Check the network address name and that the ports for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found