<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Adaptive AI Architecture - Medium]]></title>
        <description><![CDATA[Adaptive Content Architecture will simplify how you design, develop, deploy, and publish any applications. Even for native mobile-apps. Whether your “content” is local or remote, following these design patterns will simplify overall app development. - Medium]]></description>
        <link>https://medium.com/dynamic-content?source=rss----183fb4989ab9---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Adaptive AI Architecture - Medium</title>
            <link>https://medium.com/dynamic-content?source=rss----183fb4989ab9---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:59:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dynamic-content" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kotlin Multiplatform Setup (2) — API calls]]></title>
            <link>https://medium.com/dynamic-content/kotlin-multiplatform-setup-2-api-calls-f7fb6d07f399?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/f7fb6d07f399</guid>
            <category><![CDATA[adaptive-ai-architecture]]></category>
            <category><![CDATA[dynamic-content]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 01:44:52 GMT</pubDate>
            <atom:updated>2026-11-11T18:44:10.934Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>[November 11, 2026] UPDATE:<br></strong>The reference project <a href="https://github.com/migueltt/kmpAcme">https://github.com/migueltt/kmpAcme</a> has been updated.</p><p>Following up the <a href="https://miguelt.medium.com/kotlin-multiplatform-setup-84cdcc4d6341">Kotlin Multiplatform Setup</a> article (make sure you read it first!), the reference KMP Project now includes components to mock an API endpoint, simulating different scenarios.</p><blockquote>The main objective is to define proper API mechanisms to focus on what matters: Data Models, API endpoints, ViewModels, and @Composables.</blockquote><h3>Overview</h3><p>Within module kmpServerApp, a simple Ktor Server Application exposes one simple endpoint:</p><ul><li>GET /acme/data</li><li>Query-parameter delay indicates the number of seconds to delay response.</li><li>Query-parameter mode indicates the type of response: Success, NoData, RequestFailure, ServerFailure— each will send back a different response corresponding to 200 , 204 , 400 , 500 respectively. Unknown is also supported, but returns an invalid error-response payload.</li></ul><p>Similarly, within module kmpCompose, composable ApiResults displays different controls for each query-parameter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*0y5z3KbzbyAusB3QW5wyrA.gif" /><figcaption>Making an API call through KMP application</figcaption></figure><h3>API Contracts</h3><blockquote>API Contract defines how requests and responses for a particular endpoint are defined. This contract includes: supported http-methods, query-params, path-params, headers, request-body, response-body, error-response-body, and http-codes.<br>This is commonly defined using OpenAPI specifications.<br>Both Front-End applications and Back-End services must comply with these API Contracts.</blockquote><p>Endpoint GET /acme/data returns data class <a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeData.kt#L48">AcmeData</a> for 200 http-code — that is, a “Success”:</p><pre>@Serializable<br>@SerialName(&quot;AcmeData&quot;)<br>data class AcmeData(<br>    @SerialName(&quot;platform&quot;)<br>    val platform: String,<br>    @SerialName(&quot;timestamp&quot;)<br>    val timestamp: LocalDateTime,<br>    @SerialName(&quot;module&quot;)<br>    val module: ModuleInfo,<br>    @SerialName(&quot;any_list&quot;)<br>    val anyList: List&lt;@Contextual Any?&gt; = emptyList(),<br>    @SerialName(&quot;any_map&quot;)<br>    val anyMap: Map&lt;String, @Contextual Any?&gt; = emptyMap(),<br>)</pre><p>Have you noticed attributes anyList and anyMap? Those have been added to demonstrate how flexible a KMP application can be. More on this later.</p><p><a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/ModuleInfo.kt#L36">ModuleInfo</a> is defined as:</p><pre>@Serializable<br>@SerialName(&quot;ModuleInfo&quot;)<br>data class ModuleInfo(<br>    @SerialName(&quot;id&quot;)<br>    val id: String,<br>    @SerialName(&quot;name&quot;)<br>    val name: String,<br>    @SerialName(&quot;group&quot;)<br>    val group: String,<br>    @SerialName(&quot;version&quot;)<br>    val version: String,<br>)</pre><p>For failures, either 4XX or 5XX, the error response body returns <a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeError.kt#L38">AcmeError</a>:</p><pre>@Serializable<br>@SerialName(&quot;AcmeError&quot;)<br>data class AcmeError(<br>    @SerialName(&quot;code&quot;)<br>    val code: Int,<br>    @SerialName(&quot;message&quot;)<br>    val message: String,<br>)</pre><p>This could be improved with more details about what went wrong — for example, including some attributes to indicate the error location, and how to display it.</p><blockquote>Noticed the @SerialName at the data class level? This is relevant for [de]serialization.</blockquote><p>These data classes determine the <strong>API Contract</strong> between GET /acme/data endpoint and our reference KMP application. Therefore, all the data classes are defined in module kmpShared which is included in both kmpServerApp and kmpCompose modules. Any future changes to the data classes can be easily applied across the entire KMP project.</p><p><strong>Remember:</strong> these data classes are just examples for this reference KMP project to implement different use-cases and define proper mechanisms through out all modules, achieving a consistent API Contract.</p><h3>[De]serialization</h3><p>As you already have noticed, we rely 100% on Kotlin’s serialization library, due to its multiplatform support. Other libraries could be used, but this is discouraged due to the additional steps to make it work.</p><p>Module kmpShared defines Ktor’s JSON-parser and HTTP-client to provide consistent mechanisms for [de]serialization.</p><ul><li><a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeApiClient.kt#L37">AcmeApiClient</a>: Encapsulates how to call the sample API endpoints, such as GET /acme/data.</li><li><a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeApiResult.kt#L22">AcmeApiModeParam</a>: Defines the values for query-parameter mode — both kmpCompose and kmpServerApp modules use it as part of the API Contract.</li><li><a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeConstants.kt#L36">ACME_DISCRIMINATOR</a>: Kotlin’s Json [de]serializer provides mechanisms to introduce a “discriminator” attribute (set as &quot;clazz&quot;) that is used to identify which serializer to use when encoding/decoding JSON. Each data class can then use @SerialName to define the value which will be included in the JSON payload as &quot;clazz&quot;: &quot;&lt;serial-name&gt;&quot;. Due to obfuscation, it is highly recommended to include a unique key.</li><li><a href="https://github.com/migueltt/kmpAcme/blob/28a09c85b36bfafa742348f4d65b0b214e80afb8/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/api/AcmeConstants.kt#L24">ACME_SERIALIZERS</a>: Defines a Map&lt;String, KSerializer&lt;Any&gt;&gt; to be used when [de]serializing Any — those anyList and anyMap attributes in AcmeData. Obviously, the key should match the @SerialName used on each data class.</li></ul><pre>val ACME_SERIALIZERS: Map&lt;String, KSerializer&lt;out Any&gt;&gt; =<br>    mapOf(<br>        &quot;AcmeData&quot; to AcmeData.serializer(),<br>        &quot;ModuleInfo&quot; to ModuleInfo.serializer(),<br>        &quot;AcmeError&quot; to AcmeError.serializer(),<br>    )</pre><blockquote>Check package <a href="https://github.com/migueltt/kmpAcme/tree/main/kmpShared/src/commonMain/kotlin/com/acme/kmp/shared/utils">com.acme.kmp.shared.utils</a> for generic components.</blockquote><p>Whenever you annotate with @Serializable you are directing org.jetbrains.kotlin.plugin.serialization plugin to create a serializer() function, injected directly into the compiled artifact.</p><p>In Ktor, io.ktor.client.HttpClient includes a ContentNegotiation plugin which in most cases is io.ktor.serialization.kotlinx.json. This plugin plus the serializer() functions perform all the conversion between the application data and JSON: serialization into JSON and deserialization from JSON.</p><h3>API Integration</h3><p>As indicated, just one API endpoint has been defined in kmpServerApp module. Future improvements will add more to implement additional patterns — like handling basic API versioning mechanisms.</p><blockquote>For some reason, you cannot run parallel services in AndroidStudio — if you are using just an Android emulator, you should be fine. But if you are running JVM or Web, gradle will not be able to start another process.<br>Just open a terminal, use command ./gradlew :kmpServerApp:run, and send a request http://0.0.0.0:8080/acme/data?mode=Success</blockquote><h4>Success Response</h4><p>The API endpoint is simply implemented as:</p><pre>call.respond(<br>  AcmeData(<br>    platform = getPlatform().name,<br>    timestamp = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()),<br>    module =<br>      ModuleInfo(<br>        id = ModuleBuildConfig.MODULE_ID,<br>        name = ModuleBuildConfig.MODULE_NAME,<br>        group = ModuleBuildConfig.MODULE_GROUP,<br>        version = ModuleBuildConfig.MODULE_VERSION,<br>      ),<br>    // Include a list to demonstrate polymorphic serialization.<br>    anyList = createAnyList(),<br>    // Include a map to demonstrate polymorphic serialization.<br>    anyMap = createAnyMap(),<br>  )<br>)</pre><p>Ktor serialization will use AcmeData serializer to generate JSON payload:</p><pre>{<br>    &quot;clazz&quot;: &quot;AcmeData&quot;,<br>    &quot;platform&quot;: &quot;Java 25.0.2&quot;,<br>    &quot;timestamp&quot;: &quot;2026-08-22T22:17:21.322488&quot;,<br>    &quot;module&quot;: {<br>        &quot;clazz&quot;: &quot;ModuleInfo&quot;,<br>        &quot;id&quot;: &quot;app-server&quot;,<br>        &quot;name&quot;: &quot;Acme Server App&quot;,<br>        &quot;group&quot;: &quot;com.acme.server.app&quot;,<br>        &quot;version&quot;: &quot;0.1.0&quot;<br>    },<br>    &quot;any_list&quot; : [ ... ],<br>    &quot;any_map&quot; : { ... }<br>}</pre><p>For &quot;anyList&quot;, serialization relies on ContextualAnySerializer</p><blockquote>Notice attribute <em>&quot;clazz&quot;: &quot;AcmeData&quot; </em>—this is used during the deserialization process, as defined in <em>ACME_SERIALIZERS</em>.</blockquote><p>Notice attributes &quot;any_list&quot; and &quot;any_map&quot; — these two were defined with @Contextual Any? just to show how much flexibility we can accomplish within this proof of concept.</p><p>While this introduces a lot of concepts, some of them shouldn’t be used in well-defined API-Contracts, like using Any?.</p><p>In any case, this is just a reference project to get you going.</p><p>Happy Kotlin!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7fb6d07f399" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/kotlin-multiplatform-setup-2-api-calls-f7fb6d07f399">Kotlin Multiplatform Setup (2) — API calls</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adaptive AI Architecture]]></title>
            <link>https://medium.com/dynamic-content/adaptive-ai-architecture-5c75235327eb?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c75235327eb</guid>
            <category><![CDATA[adaptive-content]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[dynamic-content]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[adaptive-architecture]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 03:39:16 GMT</pubDate>
            <atom:updated>2026-08-09T15:18:17.609Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*wWiIWcXMOCECQkgBMPMoWw.png" /></figure><p>Using AI technologies can simplify every single aspect on how we develop applications — but most importantly, how we deploy, release, and execute such applications. An Adaptive AI Architecture is required to evolve applications as AI technologies mature.</p><blockquote>btw: I’ve changed the name to Adaptive AI Architecture for this publication. Of course, link still remains the same.</blockquote><h3>Why Adaptive?</h3><p>Any application should be able to adapt and evolve towards a full AI-based solution. While AI technologies are not there yet (as of August 2026), they will eventually be faster, cheaper, more reliable, and most importantly, more deterministic.</p><p>An application that can be tuned between traditional and AI-based mechanisms within this ever-changing environment is key for an effective long-term AI strategy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*OPfdBdUcXHytKWYDu-bUZw.png" /><figcaption>Decreasing or increasing AI aspects should be simple.</figcaption></figure><h3>Generative AI Use-Cases</h3><p>Generative AI (GenAI) can be used in two different ways:</p><ul><li><strong>GenAI for development (GenAI-Dev):</strong> AI technologies are used to design, implement, and test different components, assisting developers to build applications in a traditional way. At runtime, there aren’t any kind of AI artifacts being used and all the results are fully deterministic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQWKNFNyg6SKD1x0b5W8yw.png" /><figcaption>Traditional GenAI-Dev Workflow</figcaption></figure><ul><li><strong>GenAI at runtime (GenAI-Run):</strong> some or all components within an application are AI-driven at runtime. This could be some microservices using AI Agents, or even a mobile application relying on on-device AI-capabilities. Note that these components could have been implemented using <strong>GenAI-Dev</strong> workflows. Runtime behavior is non-deterministic, but may be reliable and accurate as AI technologies mature.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*vOn6NocdI0zgJp8Yer4kWw.png" /><figcaption>Traditional GenAI-Run Workflow</figcaption></figure><h3>The “status-quo” problem</h3><p>Most of us are prioritizing <strong>GenAI-Dev</strong> workflows, attempting to automate certain aspects of the existing Software Development Lifecycle (SDLC). Some are successful, while others fail miserably— using AI to maintain/fix legacy-code and/or sphagetti-code is not that easy after all.</p><blockquote>Check <a href="https://medium.com/ai-architecture/enterprise-genai-ai-readiness-9a3c323a7f03">Enterprise GenAI &amp; AI readiness</a> on how you can be more effective.</blockquote><p>Using AI to maintain this “<strong>status-quo</strong>” is not sustainable, neither effective nor efficient. Sure, some aspects could benefit, but, wouldn’t it be better to start from scratch? A blank canvas so to speak.</p><p>We may be reluctant to embark in such a journey: <em>“too expensive, takes too long” </em>might be some arguments.</p><p>Here’s where <strong>GenAI-Dev</strong> enters the scene: every single SDLC aspect can be faster, plus with all the experience gathered over the years, we can “easily” replace entire applications in record-time, <strong>IF AND ONLY IF </strong>we think “<strong>out-of-the-box</strong>”.</p><h3>The future is closer than you think</h3><p>A paradigm shift is required to comprenhend the impact AI will have on SDLC:</p><ul><li>Short-term: use of <strong>GenAI-Dev</strong> as we all are currently experiencing. Even <strong>GenAI-Run</strong> for some chat-assistant-like applications.</li><li>Medium-term: More <strong>GenAI-Run</strong> applications that could potentially be too complex to maintain, deploy, monitor, and even troubleshoot if a traditional approach is followed — even if <strong>GenAI-Dev</strong> is used.</li><li>Long-Term: More of the same? Or, fully AI-based reliable applications?</li></ul><p>Having a proper AI strategy for the long-term will definitively pay off.</p><p><strong><em>Remember: if you are not planning for an AI future, you can bet your competitors are.</em></strong></p><h3>Adaptive Applications</h3><p>The correct strategy would be to implement applications where you can integrate AI aspects incrementally, evolving applications over time, without disrupting your internal operations or your users activities.</p><p>For Back-End artifacts, API versioning mitigates downtimes up to some extent, allowing to manage changes through an API Gateway — each new version introduces new AI mechanisms. This includes Agents, MCP Servers, and any other artifact within your Back-End ecosystem.</p><p>What about Front-End? Web applications are easy to manage since you can deploy and release to all “clients” without too much effort.</p><p>The main challenges are mobile and desktop applications. Forcing users to update to new releases creates friction. Even worse, some changes may be time-sensitive. Juggling around features and delivery times, plus the overhead to release a mobile app which is subjected to multiple steps is overwhelming. What if your latest mobile app version is blocked by Google or Apple and you cannot release on time?</p><h3>Adaptive &amp; Dynamic Content</h3><p>An <strong>Adaptive AI Architecture</strong> introduces both adaptive and dynamic aspects on how applications are built. Conceptually, we can simplify a whole solution as “content”. This comprises everything you need to build features within an application.</p><p>The application itself then becomes just a “content processor”: the content can describe a screen, a module (set of screens), or the entire application (set of modules). A “content browser” with native capabilities.</p><p>This content could be defined statically within the app, or just some critical aspects (like authentication flows), while the rest could be delivered remotely — basically, <strong>Adaptive Content</strong>.</p><p>Back-End artifacts main objective is to provide this content. The related services could be using traditional (deterministic) or AI-based (non-deterministic) mechanisms , and <strong>this is where we can tune things up and down, adapting the solution based on how AI technologies evolve.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*hY81M0nb4wV3oSov8IciUA.png" /><figcaption>Adaptive AI Architecture</figcaption></figure><p>You may guessing what the ultimate objective is: content can be generated by a well-defined registered prompt. Releasing a module or an entire application is just one “prompt” away.</p><p>Future articles will explain these ideas in detail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c75235327eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/adaptive-ai-architecture-5c75235327eb">Adaptive AI Architecture</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Multiplatform Theming]]></title>
            <link>https://medium.com/dynamic-content/kotlin-multiplatform-theming-564bacd11e4c?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/564bacd11e4c</guid>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Sun, 01 Mar 2026 21:32:58 GMT</pubDate>
            <atom:updated>2026-03-05T03:57:05.956Z</atom:updated>
            <content:encoded><![CDATA[<p>Previous article was about <a href="https://medium.com/dynamic-content/kotlin-multiplatform-setup-84cdcc4d6341">setting up a base KMP Project</a>. Now we will apply theming across the app.</p><blockquote>This is a technical addendum for the <a href="https://medium.com/dynamic-content">Dynamic Content series</a>. Just to help you out on setting the technical foundations.</blockquote><p>You can check all the code here: See <a href="https://github.com/migueltt/kmpAcme">https://github.com/migueltt/kmpAcme</a></p><h3>Theming is Critical in Compose</h3><p>To avoid repeating instructions all over the place within your @Composables, a theme should be defined only once, without having to worry about it later.</p><p>But, this is not a one-time-thing — you have to be flexible but also strict, balancing technical and business requirements, adjusting as applicable.</p><p>UX Teams usually want broad control on how each tiny little UI component looks like, adding variations here and there. That’s where things get really complicated. You must explain that some UI attributes apply to multiple components and they scale up and down according to different form-factors, accessibility requirements link font-size, color-blind, among other things.</p><p>Since we are talking about KMP, you also need to explain that such theme attributes also apply to all platforms: iOS, Android, Web, Desktop — depending on your targets.</p><h3>Your app, your style?</h3><p>All the theming and styles are grounded on Compose guidelines. As of Feb 2026, these guidelines are defined by Google’s <a href="https://m3.material.io/">Material Design 3</a>.</p><p>For our reference kmpAcme project, details are included in <a href="https://github.com/migueltt/kmpAcme/blob/main/kmpCompose/README_Theme.md">README_Theme.md</a>.</p><p>For fonts, it is highly recommend to avoid the Type.kt generated in Theme Builder since it includes mechanism to get fonts dynamically. For Kotlin Multiplatform, this could be a challenge to support other platforms. There’s a more pragmatic approach using <a href="https://fonts.google.com/">Goole Fonts</a> — details are included in <a href="https://github.com/migueltt/kmpAcme/blob/main/kmpCompose/README_Typography.md">README_Typography.md</a>.</p><p>For Android targets, there’s a <a href="https://m3.material.io/styles/color/dynamic">dynamic color scheme</a>, which will choose the colors to match those as defined by the user’s background image, or, based on a specific content that can be set within your app. This feature will effectively remove any color-branding on your app. Check <a href="https://github.com/migueltt/kmpAcme/blob/main/app-android/src/main/kotlin/com/acme/mobile/app/MainActivity.kt">MainActivity</a> on how you can use this. Note that there are some specific <a href="https://m3.material.io/styles/color/dynamic/content-based-source">content-based mechanisms</a> to apply dynamic colors to specific components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*FROPXZtef0YnI83Ohi96aw.png" /></figure><h3>Start with the basics</h3><p>One important thing you must remember is that you are defining theming across all platforms. This is a Kotlin Multiplatform project after all.</p><p>Incremental changes should be applied only on your kmpCompose module which contains all your composables, sharing the UI/UX implementation across iOS, Android, Web, and Desktop.</p><p>Only introduce deviations on each target if really required — otherwise you are adding additional artifacts to maintain in the future, which increases the overall complexity. Sure, initially it may seem something trivial to do, but if you keep adding them, the codebase for each target will not be as unified as it should be.</p><p>This also increases friction across your teams. For example, UX Team may want to introduce a UI feature very specific for iOS which could potentially be very hard to included in Android and Web. This deviation may not be sustainable in the long term, going against the whole unified codebase principle. If you agree on these changes for a platform, expect more deviations in the future.</p><h3>Unified Theming as a Principle</h3><p>All stakeholders must understand that having a unified approach (theme, look and feel, overall user experience) is key to keep complexity low, allowing to introduce changes much faster.</p><p>The technology stack and business requirements should go hand-in-hand, influencing each other over time:</p><ul><li>Technology allows the business to innovate</li><li>Business dictates what needs to be done</li></ul><p>In reality, most organizations decide what technology must do, sometimes making technical decisions that are not sustainable.</p><p>Be strict on what you accept and on how you implement. It is not an easy task — most of the time such decisions are made (wrongly) by the business after all.</p><p>For our “theming” topic, something as trivial as how a Button should look like on a specific module on a particular platform could potentially affect your unified theming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=564bacd11e4c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/kotlin-multiplatform-theming-564bacd11e4c">Kotlin Multiplatform Theming</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Multiplatform Setup]]></title>
            <link>https://medium.com/dynamic-content/kotlin-multiplatform-setup-84cdcc4d6341?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/84cdcc4d6341</guid>
            <category><![CDATA[dynamic-content]]></category>
            <category><![CDATA[adaptive-ai-architecture]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 19:38:14 GMT</pubDate>
            <atom:updated>2026-11-11T18:43:50.050Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>[November 11, 2026] UPDATE:<br>- Major refactoring to match project structure from KMP plugin wizard.<br>- </strong><em>Android Studio Rabbit 2| 2026.2.2 Patch 1works without issues — most likely, you will need to clean all caches. <br>- Kotlin Multiplatform plugin </em><em>262.10968.183-ASworks as expected.<br>- The </em><em>kmpAcme reference project has also updated to use the Android Gradle plugin </em><em>v9.5.1 and Gradle </em><em>v9.8.2.<br>- Kotlin upgraded to </em><em>2.4.21<br>- Reference implemention to call API endpoint handling all edge-cases<br>- Repository </em><a href="https://github.com/migueltt/kmpAcme"><em>https://github.com/migueltt/kmpAcme</em></a><em> defines an up-to-date reference project.</em></p><p>There are several things that can be really annoying when setting up a new Kotlin Multiplatform (KMP) project — this article fixes almost everything for you!<br>Note that more technical articles will be added as we move along.</p><blockquote>This is a technical addendum for the <a href="https://medium.com/dynamic-content">Adaptive AI Architecture series</a>. Just to help you out on setting the technical foundations.</blockquote><h3>Creating the initial project</h3><p>It is highly recommended to use AndroidStudio if you are planning to develop an Android mobile-app. If you are using macOS, you can get iOS builds as well. Web and Desktop are just add-ons.</p><ol><li>Install AndroidStudio</li><li>Install the Kotlin Multiplatform plugin</li><li>Create a new Project — select Kotlin DSL for build configuration language</li><li>Select Android, iOS, Desktop, Web, Server — enabling “Share UI”</li></ol><p>Several modules will be created as depicted in <a href="https://kotlinlang.org/docs/multiplatform/compose-multiplatform-create-first-app.html">Create your Compose Multiplatform app</a>.</p><h3>Adjusting Project Structure</h3><p>With the introduction of Android-Gradle-Plugin 9+, several things have changed, and most likely, the default project we just created will throw a lot of warnings, if not errors.</p><p>Don’t worry, we will sort that out!</p><p>From a Gradle perspective, start modifying your Project structure as follows — or just clone the <a href="https://github.com/migueltt/kmpAcme">kmpAcme</a> reference PoC:</p><pre>+ &lt;project-root&gt;<br>   + app/<br>      + androidApp/<br>      |  + src/<br>      |  + build.gradle.kts<br>      + desktopApp/<br>      |  + src/<br>      |  + build.gradle.kts<br>      + iosApp/<br>      |  + iosApp/<br>      |  + Frameworks<br>      + webApp/<br>      |  + src/<br>      |  + build.gradle.kts<br>   + gradle/<br>   |  + wrapper/<br>   |  |  + gradle-wrapper.properties<br>   |  + libs.versions.toml<br>   + kmpCompose/<br>   |  + src/<br>   |  + build.gradle.kts   <br>   + kmpServerApp/<br>   |  + src/<br>   |  + build.gradle.kts<br>   + kmpShared/<br>   |  + src/<br>   |  + build.gradle.kts<br>   + build.gradle.kts<br>   + gradle.properties<br>   + settings.gradle.kts</pre><p><em>Tip: this structure is similar to the one described in </em><a href="https://medium.com/dynamic-content/dynamic-content-architecture-a01479d00abe#3a8b"><em>KMP/CMP Project Structure</em></a><em>.</em></p><p>Don’t worry, I’ll cover all the src directories later, plus the iosApp directory.</p><h4>&lt;project-root&gt;/gradle.properties</h4><p>Since we’ve added some tasks to generate ModuleBuildConfig classes, the org.gradle.configuration-cache must be false :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cd342b5112e26189bcdf7652f2d520d/href">https://medium.com/media/7cd342b5112e26189bcdf7652f2d520d/href</a></iframe><h4>&lt;project-root&gt;/settings.gradle.kts</h4><p>Mostly unchanged, except for the include statements at the end:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc7807657c758a056c89d781412694fe/href">https://medium.com/media/dc7807657c758a056c89d781412694fe/href</a></iframe><h4>&lt;project-root&gt;/gradle/wrapper/gradle-wrapper.properties</h4><p>Mostly unchanged, except for the gradle version — adjust as required, but it is recommended 9 or higher:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fabd51c491743bf402043c4a01cf6eca/href">https://medium.com/media/fabd51c491743bf402043c4a01cf6eca/href</a></iframe><h4>&lt;project-root&gt;/gradle/libs.versions.toml</h4><p>We will use the latest (stable) libraries and Android Gradle Plugin:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/426dfef60fc8810102ae048aaa59c126/href">https://medium.com/media/426dfef60fc8810102ae048aaa59c126/href</a></iframe><h4>&lt;project-root&gt;/build.gradle.kts</h4><p>We will include spotless to help out with code conventions. Note that ij_kotlin_imports_layout includes these patterns:</p><pre>&quot;*,|,com.acme.kmp.shared.kmpshared.**,|,com.acme.kmp.compose.kmpcompose.**,|,com.acme.**&quot;</pre><p>This is because each gradle module sets group to its proper package, which is used to generate the ModuleBuildConfig — thus, the default module name is no longer applicable.</p><p>For example, generated KMP resources are defined under package com.acme.kmp.compose.kmpcompose.generated.resources.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69eac27a7b3a1fa8e51a9492c32eee57/href">https://medium.com/media/69eac27a7b3a1fa8e51a9492c32eee57/href</a></iframe><p><strong>IMPORTANT:</strong> Notice that task moduleBuildConfig will create ModuleBuildConfig for each module, similar to the BuildConfig for those familiar with Android projects. For now, it will include constants related to each module using Kotlin-Multiplatform plugin within its gradle build.gradle.kts file:</p><ul><li>const val MODULE_ID → Gradle project.name</li><li>const val MODULE_NAME → Gradle project.description</li><li>const val MODULE_VERSION → Gradle project.version</li><li>const val MODULE_GROUP → Gradle project.group → package name</li></ul><p>ModuleBuildConfig is generated for every single module under build/generated/sources/moduleBuildConfig/kotlin/&lt;package-dirs&gt;.</p><p>Every time a module attribute changes, these files are auto-generated.</p><h4>&lt;project-root&gt;/kmpShared/build.gradle.kts</h4><p>Module kmpShared will contain:</p><ul><li>Unified Data Models — this will help out keeping consistency across API paylods on Front-End and Back-End implementations</li><li>Repostory / API patterns</li><li>API integration</li></ul><p>You can decouple different aspects as library modules — but to start, just keep things simple:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca6abbfd79b2e9ff47f81f1ad7521b65/href">https://medium.com/media/ca6abbfd79b2e9ff47f81f1ad7521b65/href</a></iframe><h4>&lt;project-root&gt;/kmpCompose/build.gradle.kts</h4><p>This module will define the shared-UI for all target platforms, using Data-Models from kmpShared.<br>These changes allow to visualize a @Composable using @Preview.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a64c244596ed4a856ddc80f812e9fb74/href">https://medium.com/media/a64c244596ed4a856ddc80f812e9fb74/href</a></iframe><h4>&lt;project-root&gt;/kmpServerApp/build.gradle.kts</h4><p>This module will implement API endpoints (microservices) using Ktor and will reuse all the Data-Models as defined in module kmpShared.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f7cad462f61776b3105ff4be2cf8401/href">https://medium.com/media/1f7cad462f61776b3105ff4be2cf8401/href</a></iframe><h4>&lt;project-root&gt;/app/androidApp/build.gradle.kts</h4><p>This module will be used for the Android mobile build. This implementation must rely as much as possible on the components defined in module kmpCompose.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c18baab700ab852abe06fc949f44f159/href">https://medium.com/media/c18baab700ab852abe06fc949f44f159/href</a></iframe><h4>&lt;project-root&gt;/app/desktopApp/build.gradle.kts</h4><p>This module will be used for the Desktop JVM-based build. This implementation must rely as much as possible on the components defined in module kmpCompose.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5347da5231d0964f0989e2cc378b3079/href">https://medium.com/media/5347da5231d0964f0989e2cc378b3079/href</a></iframe><h4>&lt;project-root&gt;/app/webApp/build.gradle.kts</h4><p>This module will be used for the web app build. This supports both javascript and web-assembly variants. This implementation must rely as much as possible on the components defined in module kmpCompose.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3abd4d00f8f1b91427a9559a5dc52628/href">https://medium.com/media/3abd4d00f8f1b91427a9559a5dc52628/href</a></iframe><h3>Synchronize Gradle</h3><p>After all these changes, synchronize gradle and clean / build your project.</p><p>You may need to delete your &lt;user-home&gt;/.gradle directory (it will be recreated )— <em>sometimes if you are behind a proxy, dependencies may point to different URLs.</em></p><p>Some warnings may appear due to the experimental compiler options we’ve added.</p><h3>Verifying builds on all platforms</h3><p>Below is the KMP/CMP running in all its glory on all four target platforms, using the same composable App as defined in kmpCompose/src/commonMain/kotlin/&lt;your-package&gt;/App.kt :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4DSeyXm-WFGuM1DMWeEGA.png" /><figcaption>Desktop, Web, iOS, Android</figcaption></figure><ul><li>All platforms support both Dark and Light mode, as shown above.</li><li>It includes the default <em>“Click me!”</em> created with the KMP Wizard and an additional <em>“Call API” </em>section to call a mock API.</li></ul><h4>Android KMP/CMP app</h4><p>Select and run app/androidApp as usual — nothing else to do.</p><h4>iOS KMP/CMP app</h4><p>Update the import statement in app/iosApp/iosApp/ContentView.swift:</p><pre>import UIKit<br>import SwiftUI<br>// We updated `baseName` in &lt;project-root&gt;/kmpCompose/build.gradle.kts<br>import KmpCompose<br><br>struct ComposeView: UIViewControllerRepresentable {<br>    func makeUIViewController(context: Context) -&gt; UIViewController {<br>        MainViewControllerKt.mainViewController()<br>    }<br><br>    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}<br>}<br><br>struct ContentView: View {<br>    var body: some View {<br>        ComposeView()<br>            .ignoresSafeArea()<br>    }<br>}</pre><p>In AndroidStudio, switch to “Files” in Project navigator and open app/iosApp/iosApp.xcodeproj/project.pbxproj. Search for :composeApp: and replace with :kmpCompose: (1 entry only) — we changed the module name after all.</p><h4>Desktop (JVM) KMP/CMP app</h4><p>In module app/desktopApp, execute src/main/kotlin/&lt;your-package&gt;/Main.main() — adjust the title argument.</p><h4>Web KMP/CMP app</h4><p>In module app/webApp, execute src/webMain/kotlin/&lt;your-package&gt;/Main.main() — adjust title in src/webMain/resources/index.html <br>Also verify the script tag iswebApp.js— it should match the module name.</p><p>As you have noticed, there are several things that are still considered a work-in-progress. Gradle Plugins may be difficult to identify and include, affecting the overall project build process.<br>This configuration will help you out on your initial journey. I will try to update this guide as new updates are provided.</p><p>Jetbrains and Google have published some articles around KMP and Plugins:</p><ul><li><a href="https://blog.jetbrains.com/kotlin/2026/01/update-your-projects-for-agp9/">https://blog.jetbrains.com/kotlin/2026/01/update-your-projects-for-agp9/</a></li><li><a href="https://developer.android.com/build/releases/agp-9-0-0-release-notes">https://developer.android.com/build/releases/agp-9-0-0-release-notes</a></li><li><a href="https://developer.android.com/kotlin/multiplatform/plugin">https://developer.android.com/kotlin/multiplatform/plugin</a></li></ul><p><em>imho: these guides should be providing a better guidance if KMP wants to be successful. I went through great lengths to troubleshoot most of the issues.</em></p><p>Next: <a href="https://medium.com/dynamic-content/kotlin-multiplatform-setup-2-api-calls-f7fb6d07f399">Kotlin Multiplatform Setup (2) — API calls</a> introduces basic Data-Models and API integration through Ktor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84cdcc4d6341" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/kotlin-multiplatform-setup-84cdcc4d6341">Kotlin Multiplatform Setup</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Content Architecture]]></title>
            <link>https://medium.com/dynamic-content/dynamic-content-architecture-a01479d00abe?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/a01479d00abe</guid>
            <category><![CDATA[dynamic-content]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 03:57:25 GMT</pubDate>
            <atom:updated>2026-01-24T02:40:49.347Z</atom:updated>
            <content:encoded><![CDATA[<p>Defining a flexible architecture allows to incrementally improve different design aspects, adding new features without affecting other parts.</p><p>Plus, introduction to Kotlin Multiplatform as the main technology.</p><blockquote>This the third article in a series —see <a href="https://medium.com/dynamic-content">https://medium.com/dynamic-content</a> for a complete list.</blockquote><h3>Concepts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPBx_b595JbfRZWH-yCxIA.png" /><figcaption>Modules, Flows, Screens, Widgets, and UI artifacts</figcaption></figure><ul><li><strong>Module:</strong> encloses all components used to implement complete features related to a business use-case. It could contain several “flows”. Additionally, it may define the main UI components related to all flows.<br>For example:<br>- Authentication Flow (login, password/pin, biometric, multi-factor, …)<br>- Profile Management Flow (view, edit, remove, …)<br>- Product Catalog (search, browse, details, …)<br>Additionally, it may define the main UI components related to all flows.</li><li><strong>Flow: </strong>includes the <strong>screens</strong>; their the logical sequence; and navigation specifications: arguments, deep-link, transitions, back-stack.<br>Additionally, it may define the main UI components related to all screens.</li><li><strong>Screen: </strong>includes all <strong>widgets</strong> to build the UI as per requirements. The layout will depend on each widget, and the screen itself may specify additional layout guidelines.</li><li><strong>Widget:</strong> represents a UI element as a unit, and may include one or more UI artifacts. Each widget may support additional UI attributes to customize font styles, colors, padding / margins, and similar. For Android, each widget will be defined using a <a href="https://developer.android.com/jetpack/compose/mental-model#simple-example"><em>composable function</em></a><em>.</em></li><li><strong>UI artifacts: </strong>built-in UI components part of a native UI-toolkit. You should use <a href="https://developer.android.com/jetpack/compose">Jetpack Compose</a>. But, using the legacy XML / View-Binding approach is possible.</li></ul><h3>Dynamic Content Data Models</h3><p>The relationships are straightforward:</p><ul><li>A module contains flows</li><li>A flow contains screens</li><li>A screen contains widgets</li><li>A widget contains UI artifacts → implemented through “composables”</li></ul><p>Using a declarative UI approach, high-level composables will receive a “screen” object and start building the UI. Basically, all the UI is defined through instances of data-classes.</p><p>These instances are created within a repository, following the <a href="https://developer.android.com/topic/architecture">Android Developer Architecture recommendations</a>.</p><p>These Separation of Concerns (SoC) will simplify how different services, components, and utilities are interconnected, allowing to optimize each layer independently. Maintenance activities are also simplified since secondary effects (“collateral damage”) are mitigated.</p><p>As you can see, the main objective is to simplify how native modules are built. You may be tempted to implement modules or individual screens “cooked” inside your native implementation — and that would be OK if you are focusing only on one specific platform.</p><p>But let’s be real — when you are working on native-apps you want to have implementations on each major mobile platform: Android, iOS.</p><p>The key for success is to standardize your Data Models that all platforms are going to use to render the UI. These Data Models should represent the UI state, streamlining all development across all layers.</p><h3>Kotlin Multiplatform &amp; Compose Multiplatform</h3><p>Since <a href="https://kotlinlang.org/docs/multiplatform">Kotlin Multiplatform</a> (KMP) has reached stable levels for all major platforms (Android, iOS, Desktop, Web, Server-side), I’ll use it extensively in the upcoming articles.</p><p>The same can be said for <a href="https://www.jetbrains.com/compose-multiplatform/">Compose Multiplatform</a> (CMP), which basically expands multiplatform capabilities to UI implementation.</p><p>By using KMP + CMP you can easily start prototyping all functionality, leaving specific requirements for later. For example, authentication usually involves specific implementation to take advantage of different sensors (FaceID, Fingerprint). These features can be left for later while the core functionality is defined once.</p><p>Defining the foundations for (almost) any solution that can be used across multiple platforms is a win-win scenario.</p><h3>Composables Everywhere</h3><p>As you can imagine, the central piece for a Dynamic Content strategy is based on declarative-UI. CMP is based on Android’s Jetpack Compose, allowing to define UI components (functions annotated with@Composable) that are called to build the UI at runtime.</p><p>There are multiple resources around Compose — check <a href="https://developer.android.com/develop/ui/compose/mental-model">Thinking in Compose</a> and <a href="https://kotlinlang.org/docs/multiplatform/compose-layout.html">Layout Basics</a> to start.</p><p>The @Composable functions will be called passing arguments. For us, these arguments will be UI-state models describing what needs to be rendered.</p><p>If you define your UI hierarchy consistently and reusing composables without out-of-pattern designs, the whole application can be built very easily.</p><p>Your role as a developer will be to negotiate simplicity vs. complexity:</p><blockquote>- The simpler the UI/UX is, the faster you can implement and the easier to maintain.<br>- UI/UX designers may want to introduce more custom designs for each screen — increasing complexity → more time to implement, harder to maintain / support.<br>- You must negotiate that all such “embellishment” can be implemented later, once your team gets more familiar with the new declarative-UI paradigm.<br><strong>Remember: the highest priority is to release something to your users.</strong></blockquote><h3>Unified Domain Layer</h3><p>On one side, you have the Front-End representing all your target platforms. On the other side, if applicable, your Back-End services feeding the “data”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXIBKYGtoBl1JbDYoSQOsg.png" /></figure><h4><strong>“shared” module</strong></h4><ul><li>Unified Data Models used across all layers → UI State / Data.</li><li>Repository patterns.</li><li>Cache mechanisms, if applicable. Note that this is an orthogonal aspect and should not impact the overall behavior — it is just an optimization layer.</li><li>API processing mechanisms: requests / responses, encode / decode payloads.</li><li>Note that parts of this module should also be used for Back-End implementation. Basically the same Data Models should be used on the API-Contracts (response payloads) to keep everything in-sync.</li></ul><h4>“compose” module</h4><ul><li>ViewModels, including core patterns and lifecycle mechanisms.</li><li>Reusable composables to build UI on Front-End applications.</li><li>Concrete UI implementations that can be used across all the target platforms. <em>Write once, use anywhere.</em></li><li>Ideally, you should have another module defining all reusable composables, keeping a well-maintained widget library. Then, use this library to implement your concrete platform-agnostic implementation. To simplify things, keep everything in one place and once you get more familiar with KMP/CMP, start decoupling accordingly.</li></ul><h4>“app” modules</h4><ul><li>Specific implementations for each target module, as applicable.</li><li>Note that KMP starter-guides usually mix <strong>&quot;app&quot;</strong> and <strong>&quot;compose&quot;</strong> modules together — feel free to keep such structure until you think it is better to split.</li></ul><h4><strong>“server” module</strong></h4><ul><li>KMP will create this module if you select such option.</li><li>For our purposes, makes a lot of sense, since the whole Dynamic Content architecture implies that all participants must understand that some aspects are fully driven by API calls — yes, even the UI.</li></ul><p>These 4 our the basic modules you should start with. Later, you can modularize / organize your codebase as you get more experience.</p><h3>KMP / CMP Project Structure</h3><p>Ideally, your project should look something like this in the long term:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*Pd52iJZJ7bCtoSqLnWaepQ.png" /><figcaption>Project structure</figcaption></figure><p><em>But as indicated earlier, just start with the basics KMP creates.</em></p><ul><li>UI-Composables: just a collection of widgets that will grow over time to accommodate new UI patterns.</li><li>Integration: common utilities to manage API calls, repository patterns, formatting, transformation.</li><li>App Domain: this will be a concrete implementation for your project, including API calls, Data Models, Business rules, etc.</li><li>App Compose: contains all the UI logic and event handling, using the functionality defined in the App Domain.</li><li>Applications (front-end): specific requirements for each particular platform.</li><li>Applications (back-end): mainly microservices processing data.</li></ul><p>For our Dynamic Content approach, all these libraries and modules will focus on unifying how to manipulate “data” that is generic enough to display any potential UI, while allowing to “operate” on such data.</p><h3>The AI Factor</h3><p>For those looking into AI, you probably have identified how it will fit into this overall architecture. This will be dicussed later. So, stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a01479d00abe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/dynamic-content-architecture-a01479d00abe">Dynamic Content Architecture</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Content Strategy]]></title>
            <link>https://medium.com/dynamic-content/dynamic-content-strategy-d824570b7302?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/d824570b7302</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[compose-ui]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[cms]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 18:01:48 GMT</pubDate>
            <atom:updated>2026-08-10T23:49:43.655Z</atom:updated>
            <content:encoded><![CDATA[<p>Dynamic content consists of building entire modules and screens on-the-fly, without having to define static resources to describe the UI, including behaviors, like handling UI events, validating errors, performing navigation and transitions.</p><blockquote>This the second article in a series — see <a href="https://medium.com/dynamic-content">https://medium.com/dynamic-content</a> for a complete list.</blockquote><p>All the metadata related on how a module, flow, screen, or a specific UI element (aka widget) could be defined:</p><ul><li>Locally using a static data-model</li><li>Locally using a persistence layer</li><li>Or, remotely through API services</li></ul><p>At the end, all these three strategies are exactly the same:</p><ul><li>Data Models define the structures for all layers.</li><li>Modules could potentially define instances of this Data Model which provides all what is required to Content-Services. All the UI definition is considered as hard-coded.</li><li>Persistence layer (e.g. using Room Database) could store all the information using the same Data Model structures. Note that this could be used to implement a caching mechanism; offline support; or just store all metadata rather than hard-coding Data-Model instances.</li><li>Remote Services could define the response payloads using the same Data Model. Obviously, the correct strategy should be caching all the information.</li></ul><p>In this way, all the architectural components are consistent across all layers and defining services is easy, scalable, maintainable, and testable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*yPwPAES5XPiaUNTVYPpaCw.png" /><figcaption>Data Models, Persistence, and Remote Services vs. Content Services</figcaption></figure><p>This is not something new. In the old days imperative UI programming made this somewhat difficult (XML layouts, view-bindings), but the tools and technologies available today make things much easier and <strong>fun</strong> to work with.</p><blockquote>For all these articles, I will focus on <a href="https://kotlinlang.org/compose-multiplatform/">Compose Multiplatform</a>, since its declarative UI foundations apply to all major platforms.</blockquote><h4>A basic example: Dynamic Surveys</h4><p>I had to work on a project where different surveys could be delivered to users at any time. Such surveys consisted of 2, 3, 4, “n” different questionnaires, and each one could have several possible answers: single-choice (radio-button), multiple-choice (check-boxes), or even free-text.</p><p>There are pros and cons for a <strong>static </strong>approach:</p><p><strong>Advantages</strong></p><ul><li>Each survey can have its own UX design.</li><li>Each questionnaire can be customized, organizing answers using a better visual design.</li></ul><p><strong>Disadvantages</strong></p><ul><li>Implies that new surveys will require new mobile-app releases.</li><li>Longer development times since each questionnaire has to be manually crafted.</li></ul><p>To support business requirements, a <strong>dynamic</strong> approach was taken, where all surveys were provided from an API-request, defining a proper JSON structure that defines the survey itself, its questionnaires, and related answers:</p><p><strong>Advantages:</strong></p><ul><li>No new mobile-app releases were required — all surveys can be defined on the back-end services</li><li>Shorter development times, since abstractions and generics are defined once</li></ul><p><strong>Disadvantage:</strong></p><ul><li>Overall design lacks customizations per survey / questionnaire / answers</li></ul><p>This basic architecture was built in less than 1 month, and it allowed to define any survey, provided the JSON payload complied with the specifications → the “contract”. Answers were saved on a back-end service using a standard format.</p><p>In summary, a dynamic approach solved several challenges:</p><ul><li>How and when to deliver surveys to users</li><li>How the organization builds new surveys without having to force users to install a new release</li><li>Decrease time-to-market: development, deployment</li><li>Coordinate and orchestrate all publishing activities (e.g. specific date and time)</li></ul><p>Of course, this “survey solution” only addressed one specific use-case: delivering surveys.</p><blockquote>This implies that data-models, mobile components, and API services were all designed around a single conceptual context, forcing to reinvent the wheel for new use-cases.</blockquote><p><strong>Can we do better? Absolutely yes!</strong></p><h3>Dynamic Content Objectives</h3><ul><li>Define a framework to build modules / screens on-the-fly, without having to rely on local hard-coded resources (static layouts, labels)</li><li>Enforce Separation of Concerns and Single Source of Truth principles:<br>- Render UI;<br>- Handle UI events (triggered by UI or business-logic);<br>- Handle errors;<br>- Decouple local / remote requests and responses (repositories);<br>- Perform transitions / navigation</li><li>Streamline all “content” through a unified architecture, totally agnostic from source:<br>- Local: offline, cache;<br>- Remote services</li><li>Define a unified Data Model to accommodate all requirements.</li><li>Outline the “contract” (http-methods, JSON specifications) between clients and remote services to simplify API requests and responses.</li><li>Define comprehensive policies and mechanisms for widgets that can be managed per release, allowing to add more features incrementally.</li></ul><p><strong>Next: </strong><a href="https://medium.com/dynamic-content/dynamic-content-architecture-a01479d00abe"><strong>Dynamic Content Architecture</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d824570b7302" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/dynamic-content-strategy-d824570b7302">Dynamic Content Strategy</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Mobile Apps]]></title>
            <link>https://medium.com/dynamic-content/dynamic-mobile-apps-b727f946aa14?source=rss----183fb4989ab9---4</link>
            <guid isPermaLink="false">https://medium.com/p/b727f946aa14</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[compose-ui]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Miguel T]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 17:55:43 GMT</pubDate>
            <atom:updated>2026-03-05T03:15:16.612Z</atom:updated>
            <content:encoded><![CDATA[<p>Is your mobile architecture preventing innovation, causing delays due to an overwhelming complexity? Are there parts of your codebase everyone is afraid of? Is your development process too convoluted leaving little space for continuous improvements?</p><p>If you answer “Yes” to any of these questions, keep reading.</p><p>These series of articles will demonstrate that native mobile-apps development is something trivial, if the correct strategy is chosen.</p><h3>Mobile native development matters</h3><p>Modern mobile apps can be developed using multiple technologies.</p><p>The best User Experience (UX) can be achieved by using a native approach, making the whole app much more efficient, where it can truly “flourish”, taking advantage of multiple hardware features, without compromising on security.</p><p>Unfortunately, this approach is rather expensive since you need dedicated teams for each platform: Android and iOS — and this <strong>does not guarantee the resulting mobile-app will be:</strong></p><ol><li>Efficient — cpu, memory, network usage</li><li>Effective — provide the best UX for each use-case, support different devices / hardware-profiles and take advantage of its features (tablets / dual-screens, home-widgets, notifications, geo-location, etc)</li><li>Easy to maintain and support — mobile-apps are continuously evolving</li></ol><h3>A bad / wrong architecture → failed project</h3><p>This is true for any project. Bad / wrong architectures result in rigid structures, libraries, and services, where developers implement workarounds everywhere, adding more complexity and technical debt.</p><p>The main challenge is about defining an architecture that can fulfill all requirements, without compromising any features, UX design, and delivery times, in a cost-effective way.</p><p>Many organizations tend to invest heavily on native mobile-apps, but the challenges related to high-complexity, high-costs, and slow delivery, make them switch to other alternatives that have a higher ROI (return-of-investment), often a web-like approach, in detriment of the entire user experience.</p><p>There are multiple vendors that will promote their products and frameworks, how easy to use it is, and outsell the premise that it can actually solve all your problems. Some of them may actually be the right fit for your project. But, beware! Your organization will be locked-in with such technology, spending thousands, if not millions, maintaining and supporting all the infrastructure behind it.</p><p>After a few years (even just months!) somebody will realize that additional features are required and another migration project will take place.</p><p>If you are investing in a solution, make it agnostic to any proprietary technology — of course, this is easier said than done.</p><h3>Choose wisely</h3><p>Why do most native-app projects take so much time ? Is it because the target platforms are too complex? Are developers lacking some skills?</p><p>There are several reasons:</p><ul><li><strong>Wrong architecture or design patterns:</strong> MVVM (Model-View-ViewModel) is a design pattern that is supposed to separate logic from UI — unfortunately, the design guidelines are somewhat lazily enforced. Another example could be managing remote services as a pure data-layer, forcing “clients” to continuously apply transformations / formatting to such data.</li><li><strong>Bad UX design patterns:</strong> people think that UX design is just UI design — nothing further from the truth. <strong>UX = UI + behavior</strong>, covering for ALL aspects related to a module: <br><em>- how data is retrieved.<br>- what to do if there are errors — any error: business rules, network access, invalid request / response, etc.<br>- what pieces of content could be potentially retrieved in parallel.<br>- visual cues that something is being loaded.<br>- accessibility features.</em><br>… and the list goes on.</li><li><strong>Bad technical choices: </strong>for example, on an Android project, somebody may decide to use dependency-injection (Dagger, Hilt) — while this could be correct for some scenarios, injection makes very easy to “instantiate/pass” something to other components that developers will use it indiscriminately— spreading <strong>everywhere</strong>, breaking any attempt to enforce the Separation-of-Concerns principle. At the end, the resulting codebase will be so intertwined (spaghetti-code) that adding new features or modifying existing ones will be impossible without having to perform major code refactoring.</li></ul><h3>The solution</h3><p>Most articles in this series will be focusing on <a href="https://kotlinlang.org/multiplatform/">Kotlin Multiplatform</a> and <a href="https://kotlinlang.org/compose-multiplatform/">Compose Multiplatform</a> , allowing to deliver applications targeting all major platforms (Web, Android, iOS, Desktop), plus associated back-end services.</p><p>I will provide key aspects, benefits, challenges, takeaways on what I refer as a <a href="https://medium.com/dynamic-content/dynamic-content-strategy-d824570b7302"><strong><em>Dynamic Content Strategy</em></strong></a>, highlighting the <a href="https://developer.android.com/jetpack/compose/mental-model?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fjetpack-compose-for-android-developers-1%23article-https%3A%2F%2Fdeveloper.android.com%2Fjetpack%2Fcompose%2Fmental-model#paradigm">differences between imperative vs. declarative UI</a>.</p><p>By choosing the correct architecture,</p><ul><li>Development will be easier and faster</li><li>Reduce the number of bugs</li><li>Easier test, support, and maintain</li><li>Proper planning on future releases</li><li>Developers will enjoy participating on a <em>fun to work</em> project</li><li>Users and customers will enjoy using your mobile-app!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FhDHiylysFt_4rykmMIYCQ.png" /><figcaption>Building complete modules / flows / screens dynamically</figcaption></figure><p><strong>Next: </strong><a href="https://medium.com/dynamic-content/dynamic-content-strategy-d824570b7302"><strong>Dynamic Content Strategy</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b727f946aa14" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamic-content/dynamic-mobile-apps-b727f946aa14">Dynamic Mobile Apps</a> was originally published in <a href="https://medium.com/dynamic-content">Adaptive AI Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>