# interface implementation

Published articles for interface implementation.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Bridging Compose and View: Seamless Interop Communication with CompositionLocal

DevFeed: [Bridging Compose and View: Seamless Interop Communication with CompositionLocal](<https://devfeed.tech/articles/bridging-compose-and-view-seamless-interop-communication-with-compositionlocal-25937.md>)

Original publisher: [Read original article](<https://juliensalvi.medium.com/bridging-compose-and-view-seamless-interop-communication-with-compositionlocal-4b0a273bf15f?source=rss-cbfc736ddcd3------2>)

Author: Julien Salvi

Published: 2025-03-05T13:42:13Z

Content type: tutorial

Language: en

Sources: [Stories by Julien Salvi on Medium](<https://devfeed.tech/sources/stories-by-julien-salvi-on-medium.md>)

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [bridge](<https://devfeed.tech/tags/bridge.md>), [compose](<https://devfeed.tech/tags/compose.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [interface-implementation](<https://devfeed.tech/tags/interface-implementation.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [sharedflow](<https://devfeed.tech/tags/sharedflow.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [ui](<https://devfeed.tech/tags/ui.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

This tutorial explains how to bridge Jetpack Compose and traditional Android Views using CompositionLocal. It shows how to provide a FeedbackMessageInterop implementation so composables can trigger View-based feedback, and describes the reverse direction through an interface and reactive streams such as StateFlow or SharedFlow.

### Source excerpt

Migrating to Compose exposed the team to several interoperability challenges as we integrated new Composables into our existing codebase. One key hurdle was figuring out how to trigger events from Compose and dispatch them to the main View holder, such as a Fragment or Activity. After some exploration, we found an efficient solution using CompositionLocal. Here's how we made it work! 🚀 What is a CompositionLocal? Think of CompositionLocal as a localized dependency injection system built directly into Compose's composition model. You create a CompositionLocal instance, which acts as a key for a specific type of data. Then, using the CompositionLocalProvider, you define a scope within your UI tree and associate a value with that CompositionLocal key. Any composable within that scope can then access the provided value using the CompositionLocal.current property, without needing to know where the value originated. This not only simplifies code but also makes it more maintainable and reusable. Furthermore, CompositionLocal values can be dynamic, triggering recomposition when they change, and they are thread-safe, making them a powerful tool for managing shared state within your Compose UI. Interop Communication with CompositionLocal In the following code, LocalFeedbackInterop is a staticCompositionLocalOf that will hold an implementation of the FeedbackMessageInterop interface. This interface defines the methods for showing feedback alerts, and the staticCompositionLocalOf ensures that the implementation is unlikely to change as it cannot be re-provided. This allows any composable within the scope to access the FeedbackMessageInterop implementation and trigger feedback messages without explicit dependencies. import androidx.compose.runtime.ProvidableCompositionLocal import androidx.compose.runtime.staticCompositionLocalOf val LocalFeedbackInterop: ProvidableCompositionLocal<FeedbackMessageInterop?> = staticCompositionLocalOf { null } interface FeedbackMessageInterop { fu

## Interfaces 101 : Determine LOC with io.Writer Ep. 5

DevFeed: [Interfaces 101 : Determine LOC with io.Writer Ep. 5](<https://devfeed.tech/articles/interfaces-101-determine-loc-with-io-writer-ep-5-22212.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/02/interfaces-101-determine-loc-with-iowriter.html>)

Published: 2023-02-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [IO](<https://devfeed.tech/topics/io.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interface-implementation](<https://devfeed.tech/tags/interface-implementation.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [io](<https://devfeed.tech/tags/io.md>), [io-writer](<https://devfeed.tech/tags/io-writer.md>), [stringer](<https://devfeed.tech/tags/stringer.md>), [video](<https://devfeed.tech/tags/video.md>), [writer](<https://devfeed.tech/tags/writer.md>)

### AI overview

A video tutorial demonstrates how to implement a Go interface using a type alias, pass a variable as an interface to a function, and repurpose the interface to count lines of code with io.Writer.

### Source excerpt

Introduction In episode 4, Miki defined an enumerated type that satisfied Go's fmt.Stringer interface. By implementing the fmt.Stringer interface, Miki can specify how his enumerators were printed within a formatted string and in this case, he expected the values to be displayed as a predetermined text value. Miki also pointed out how using the value of the method's receiver within the Stringer method can result in a recursive loop.