typewriter icon indicating copy to clipboard operation
typewriter copied to clipboard

Android - Duplicate classes

Open bboralRMN opened this issue 5 years ago • 0 comments

In the case of a feature proposal ✍️

Our team is using typewriter v7 for android. Thank you for publishing this useful tool.

One thing we've noticed is that we re-use certain objects throughout our analytics implementation (as recommended in Segment Academy). For example, we have a notion of Quantity with attributes number and type that gets re-used in several analytics events.

It could be represented like:

data class Quantity {
  val number: Int,
  val type: String
}

We've observed that typewriter will generate identical classes Quantity, Quantity1, Quantity2, etc. for every separate event that uses the notion of Quantity. Not a big deal, but it would be a nice thing if typewriter was smart enough to consolidate these identical classes into one shared class just to make usage of generated typewriter code easier to grok and reduce in bloat.

Thanks again for the great tool, and for considering our suggestion.

bboralRMN avatar May 18 '20 14:05 bboralRMN