Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Making Materialized implicit suggests that a Materialized is a context object whereas it's not.
  • The user of the API will by default just not care about implicit parameters and assume that they are provided.
  • The user of the API might declare it's own Materialized in an implicit val since the parameter is implicit and then be caught by other unwanted functions that also takes Materialized as implicit.
  • This a long shot view but in Scala 3 giving implicits explicitly looks like:
    groupedStream.count().explicitly(Materialized.as("store-name"))
    So it's clear thathat implicits should not be used as a defaulting system.

All of that applies to Consumed and Produced too.

...

def to(extractorTopicNameExtractor[KV])(implicit keySerdeSerde[K], valueSerdeSerde[V])
def to(extractorTopicNameExtractor[KV], producedProduced[KV])

This way we require only the implicit Serdes if the Materialized (or Consumed, or Produced) is not given explicitly.

...