JetBrains / JetBrains/Exposed

Property name collision for "source" in table object

Open
#602 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
9.3k
Forks
798
Avg merge
4d 2h
Merged PRs (30d)
26

Description

I'm enjoying Exposed, and it is eye-opening for my Java-only colleagues. Because of the domain we are modeling, it is natural for us to name a property "source" in a table object. However, this collides with `Table`:
```
abstract class ColumnSet : FieldSet {
abstract val columns: List>
override val fields: List> get() = columns
override val source
get() = this
```
I don't have an obvious alternative. One could, suppose, name these properties with leading/trailing underscore or some similar obfuscation, but it is unpleasant to look at. Perhaps "tableSource" or something else more specific?

Alternatively, we've renamed our naturally-named "source" property in the table object, but then in that code it is a wart, with the one "source" property renamed to "sourceRef" (or anything, really), while the other properties are the natural names for the domain concepts represented.

Suggestions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.