<?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[Stories by Kayvan Kaseb on Medium]]></title>
        <description><![CDATA[Stories by Kayvan Kaseb on Medium]]></description>
        <link>https://medium.com/@kayvan.kaseb?source=rss-99c9fac0813d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Ce3eNXV7kCSl68U1NaCVDQ.jpeg</url>
            <title>Stories by Kayvan Kaseb on Medium</title>
            <link>https://medium.com/@kayvan.kaseb?source=rss-99c9fac0813d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 20:23:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kayvan.kaseb/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Most Developers Underestimate Reading]]></title>
            <link>https://medium.com/kayvan-kaseb/why-most-developers-underestimate-reading-dcb847410d77?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcb847410d77</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 19:00:53 GMT</pubDate>
            <atom:updated>2026-06-09T19:01:39.608Z</atom:updated>
            <content:encoded><![CDATA[<h4>Reading is not a soft skill — it is a cognitive infrastructure for engineering thinking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NS62jetWVXQDbjmE32PlCw.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/person-reading-book-on-brown-and-beige-textile-w_qTfiPbjbg">Unsplash</a></figcaption></figure><p>Most developers do not fail because they cannot code. They fail because they cannot think beyond code.</p><p>Modern software engineering is increasingly dominated by acceleration.</p><p>Faster frameworks. Faster release cycles. Faster AI-generated code. Faster tutorials.</p><p>The entire ecosystem is optimized for speed.</p><p>Yet in the middle of this velocity, one of the most powerful long-term engineering tools is consistently underestimated:</p><p>Reading.</p><p>Not documentation. Not quick technical answers. But deep reading — books, essays, philosophy, psychology, history, systems theory, literature, and long-form technical writing.</p><p>Many developers treat reading as something separate from “real engineering work.” Over time, I have come to believe the opposite:</p><p>Reading is not separate from engineering. It is part of how engineers think.</p><h4>Reading Is Compressed Experience</h4><p>A good book compresses years of thinking, failure, refinement, and insight into a small number of pages.</p><p>When we read deeply, we are not simply consuming information. We are inheriting mental models.</p><p>This matters because software engineering is fundamentally about managing complexity — not just writing code.</p><p>And complexity rarely exists only inside code.</p><p>It exists in:</p><ul><li>organizations</li><li>communication</li><li>architecture</li><li>incentives</li><li>ambiguity</li><li>long-term system evolution</li><li>human behavior</li></ul><p>Developers who rely only on fragmented online content often develop fragmented thinking.</p><p>Developers who read broadly tend to build richer internal models of how systems behave.</p><p>That difference becomes more important as systems scale.</p><h4>Reading Builds Conceptual Vocabulary</h4><p>One of the most underrated benefits of reading is conceptual vocabulary.</p><p>Not just words — but thinking tools.</p><p>Reading gives engineers names for patterns they already sense but cannot yet articulate clearly:</p><ul><li>abstraction</li><li>emergence</li><li>entropy</li><li>feedback loops</li><li>tradeoffs</li><li>asymmetry</li><li>cognitive bias</li><li>systemic risk</li></ul><p>Once a concept has a name, it becomes easier to reason about, communicate, and apply.</p><p>Many engineering problems are not purely technical problems.</p><p>They are framing problems.</p><p>For example, a system failure is often not caused by a missing feature or a broken function — but by an incorrect mental model shared across a team.</p><p>When language is imprecise, architecture becomes inconsistent. When thinking is unclear, systems drift.</p><p>Reading strengthens both clarity of thought and clarity of expression.</p><h4>How Reading Shaped My Writing and Engineering Perspective</h4><p>For me personally, reading was not just an intellectual habit — it directly shaped how I approach engineering and writing.</p><p>It helped me:</p><ul><li>structure ideas more clearly</li><li>recognize deeper patterns in software systems</li><li>move beyond framework-level thinking</li><li>connect technical decisions to system-level behavior</li><li>communicate ideas with more precision</li></ul><p>But more importantly, it influenced why I started writing in the first place.</p><p>When I began writing technical articles, my goal was not only to document knowledge. It was to contribute something useful to the engineering community — especially by helping bridge a gap I consistently observed between industry practice and more foundational or academic thinking.</p><p>Industry knowledge is often practical but fragmented.<br>Academic knowledge is often deep but disconnected from real-world constraints.</p><p>My writing sits somewhere between these two worlds — translating abstract ideas into something engineers can actually apply.</p><p>Reading made that possible. It exposed me to multiple domains and gave me the language to connect them.</p><h4>A concrete example</h4><p>In one of my earlier engineering projects, I remember optimizing a system purely from a “performance-first” mindset. On paper, the changes looked correct: lower latency, fewer allocations, faster execution.</p><p>But the system became harder to reason about over time. Debugging complexity increased, and long-term maintenance cost silently grew.</p><p>Later, while reading about systems theory and organizational complexity, I encountered a simple idea: <strong>local optimization can create global fragility</strong>.</p><p>That idea reframed how I saw the problem.</p><p>It was not just a technical optimization issue; it was a systems tradeoff problem.</p><p>That shift in framing directly influenced how I wrote subsequent technical articles: focusing less on isolated optimizations and more on system-level consequences.</p><p>This is one example of how reading does not stay in theory; it changes engineering judgment.</p><h4>The Engineer as Reader</h4><p>I previously explored this idea in <a href="https://medium.com/kayvan-kaseb/the-engineer-as-reader-why-literature-skills-matter-for-software-engineers-in-the-age-of-ai-8d53b80fa02a"><em>The Engineer as Reader</em></a><em>: Why Literature Skills Matter for Software Engineers in the Age of AI</em>.</p><p>A central idea was that literature develops interpretive intelligence — the ability to understand nuance, ambiguity, context, and layered meaning.</p><p>At first glance, literature may seem unrelated to software engineering.</p><p>But modern engineering is filled with interpretation:</p><ul><li>unclear requirements</li><li>conflicting priorities</li><li>evolving systems</li><li>organizational constraints</li><li>incomplete information</li></ul><p>Large-scale systems are not purely technical systems.</p><p>They are human systems operating under uncertainty.</p><p>Literature trains the mind to work with ambiguity instead of resisting it.</p><p>And in the age of AI, this becomes even more relevant — because implementation becomes cheaper, but interpretation becomes more valuable.</p><h4>Reading Improves Pattern Recognition</h4><p>Strong engineers are often strong pattern recognizers.</p><p>They notice:</p><ul><li>recurring architectural failures</li><li>organizational anti-patterns</li><li>scaling bottlenecks</li><li>behavioral dynamics in teams</li><li>long-term consequences of decisions</li></ul><p>This ability does not come only from coding experience.</p><p>It comes from exposure to ideas across domains.</p><p>History reveals cycles.<br>Psychology reveals behavior.<br>Systems theory reveals interdependence.<br>Literature reveals motivation and contradiction.</p><p>Over time, engineering stops being a collection of isolated tasks.</p><p>It becomes a study of interacting systems.</p><h4>Industry vs Academia: Why This Gap Matters</h4><p>One reason I care about reading is that it helps bridge a gap I often see between industry and academic thinking.</p><p>Industry tends to prioritize:</p><ul><li>speed</li><li>constraints</li><li>implementation</li><li>delivery</li></ul><p>Academia tends to prioritize:</p><ul><li>rigor</li><li>abstraction</li><li>correctness</li><li>theoretical depth</li></ul><p>Both are valuable — but incomplete on their own.</p><p>My writing has often tried to sit between these worlds: translating abstract ideas into practical engineering understanding, and grounding practical engineering experience in deeper conceptual models.</p><p>Reading is what allows that translation to happen. It connects isolated domains into a coherent mental framework.</p><h4>AI Makes Reading More Important, Not Less</h4><p>There is a common belief that AI reduces the need for deep thinking.</p><p>A more accurate view may be the opposite.</p><p>As AI handles more implementation work, the value of:</p><ul><li>judgment</li><li>abstraction</li><li>systems thinking</li><li>communication</li><li>interdisciplinary reasoning</li></ul><p>will likely increase.</p><p>Engineers who rely only on syntactic knowledge may struggle in this transition.</p><p>Engineers who understand ideas and systems may become significantly more valuable.</p><p>Reading is one of the simplest ways to build that foundation.</p><h4>The Best Engineers Think in Multiple Layers</h4><p>The strongest engineers I have met were rarely one-dimensional.</p><p>Some studied philosophy.<br>Some read history.<br>Some were deeply engaged with literature.<br>Some explored psychology or economics.</p><p>What distinguished them was not just technical skill.</p><p>It was intellectual range.</p><p>They could see systems from multiple perspectives simultaneously.</p><p>That depth influenced:</p><ul><li>architecture decisions</li><li>product thinking</li><li>communication</li><li>leadership</li><li>long-term strategy</li></ul><p>Software engineering is not only about building systems.</p><p>It is about understanding complexity, including human complexity.</p><h4>Conclusion</h4><p>A developer who only consumes fragmented information may become productive, but a developer who reads deeply may become transformative because in the long run, engineering excellence is not defined only by what we can build. It is defined by what we are able to see. And reading quietly shapes that vision more than most developers realize.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcb847410d77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/why-most-developers-underestimate-reading-dcb847410d77">Why Most Developers Underestimate Reading</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Immutability & Thread Safety in Android]]></title>
            <link>https://medium.com/kayvan-kaseb/kotlin-immutability-thread-safety-in-android-2ae0a01fd803?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ae0a01fd803</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[android-development]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 02:20:40 GMT</pubDate>
            <atom:updated>2026-06-09T02:22:13.462Z</atom:updated>
            <content:encoded><![CDATA[<h4>Beyond val and var: a practical model for safe state in Android apps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WloGRfu5jXR4xt5i_xQ_Vg.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/macbook-pro-on-brown-wooden-table-SyYmXSDnJ54">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Immutability and thread safety in Android are often oversimplified as using val and avoiding var. In real systems, correctness depends on controlling state ownership and preventing uncontrolled mutation, not just language keywords. This article explains a practical mental model for Kotlin and modern Android architecture, covering why shared mutable state causes most bugs, how thread safety actually breaks down (atomicity, visibility, ordering), and how tools like StateFlow, coroutine confinement, and encapsulation help build predictable, safe UI systems.</p><h4>1. val is not immutability</h4><p>In Android development, immutability and thread safety are often reduced to:</p><blockquote><em>“Use </em><em>val, avoid </em><em>var, and you’re safe.”</em></blockquote><p>This is incorrect.</p><p>A correct mental model is:</p><blockquote><strong><em>Safety comes from controlling ownership and mutation of state, not from keywords or types alone.</em></strong></blockquote><p>val only makes the reference read-only — it does not make the object immutable.</p><pre>val buffer = StringBuilder()</pre><pre>buffer.append(&quot;A&quot;)<br>buffer.append(&quot;B&quot;)</pre><p>This is valid because:</p><ul><li>val prevents reassignment</li><li>the object itself remains mutable</li></ul><p>You cannot do:</p><pre>// buffer = StringBuilder() ❌</pre><h4>Correct interpretation</h4><blockquote><em>val protects binding, not object state.</em></blockquote><h4>2. Kotlin “read-only” collections are not truly immutable</h4><p>Kotlin separates:</p><ul><li>List → read-only view</li><li>MutableList → mutable implementation</li></ul><pre>val data: List&lt;Int&gt; = mutableListOf(1, 2, 3)</pre><p>This does not guarantee immutability.</p><p>If another reference exists:</p><pre>val mutable = data as MutableList&lt;Int&gt;<br>mutable.add(100)</pre><p>Now data appears changed.</p><h4>Correct principle</h4><blockquote><em>Kotlin collection interfaces prevent mutation through that reference, but do not guarantee immutability of the underlying data.</em></blockquote><p>True immutability requires:</p><ul><li>no mutable references escaping</li><li>or persistent immutable collections</li></ul><h4>3. The real problem: uncontrolled mutation</h4><p>Most Android state bugs are not caused by var, but by <strong>hidden shared mutation</strong>.</p><h4>Bad example</h4><pre>class Cache {<br>    val items = mutableListOf&lt;String&gt;()<br>}</pre><p>External code can mutate it:</p><pre>cache.items.add(&quot;X&quot;)</pre><p>This breaks encapsulation.</p><h4>Correct approach: ownership-based mutation</h4><pre>class Cache {<br>    private val items = mutableListOf&lt;String&gt;()<br><br>fun add(item: String) {<br>        items.add(item)<br>    }<br>    fun snapshot(): List&lt;String&gt; = items.toList()<br>}</pre><h4>Principle</h4><blockquote><em>Mutation is acceptable only when ownership is controlled and exposure is safe.</em></blockquote><h4>4. Deep immutability (state integrity boundary)</h4><p>Even if a structure uses val, it can still be mutable internally.</p><pre>data class Profile(<br>    val name: String,<br>    val tags: MutableList&lt;String&gt;<br>)</pre><p>This is unsafe for shared state:</p><pre>profile.tags.add(&quot;android&quot;)</pre><h4>Correct state model</h4><pre>data class Profile(<br>    val name: String,<br>    val tags: List&lt;String&gt;<br>)</pre><h4>Principle</h4><blockquote><em>Immutability matters most for </em><strong><em>state that crosses boundaries</em></strong><em> (UI, threads, modules).</em></blockquote><h4>5. Thread safety is three separate problems</h4><h4>5.1 Atomicity (lost updates)</h4><pre>var counter = 0<br><br>fun increment() {<br>    counter = counter + 1<br>}</pre><p>Two threads can overwrite each other.</p><h4>5.2 Visibility</h4><p>Without proper memory guarantees, one thread may not see updates made by another thread.</p><h4>5.3 Ordering</h4><p>Compiler and CPU may reorder instructions, changing observed behavior across threads.</p><h4>6. @Volatile is limited but important</h4><pre>@Volatile var active = false</pre><h4>Guarantees:</h4><ul><li>visibility across threads</li><li>ordering of reads/writes for that variable</li></ul><h4>Does NOT guarantee:</h4><ul><li>atomic operations</li></ul><p>Example (still unsafe):</p><pre>active = !active</pre><p>Because this is a read-modify-write sequence.</p><h4>7. Safe ways to handle concurrency in Android</h4><h4>7.1 Single-writer ownership (preferred)</h4><p>Modern Android architecture avoids shared mutation:</p><ul><li>ViewModel owns state</li><li>updates happen in controlled context (usually coroutine scope)</li><li>UI observes state</li></ul><p>This eliminates most locking needs.</p><h4>7.2 Atomic primitives</h4><pre>val counter = AtomicInteger(0)<br><br>counter.incrementAndGet()</pre><p>Useful for counters and simple shared state.</p><h4>7.3 Mutex (structured synchronization)</h4><pre>val mutex = Mutex()<br><br>suspend fun update() {<br>    mutex.withLock {<br>        // safe mutation<br>    }<br>}</pre><p>Used only when shared mutable state cannot be avoided.</p><h4>8. StateFlow and atomic updates</h4><pre>state.update { current -&gt;<br>    current.copy(count = current.count + 1)<br>}</pre><h4>What this guarantees:</h4><ul><li>atomic update of a single value (CAS loop internally)</li><li>avoids lost updates at the assignment level</li></ul><h4>What it does NOT guarantee:</h4><ul><li>correctness if multiple independent pieces of state are updated separately without coordination</li></ul><h4>Principle</h4><blockquote><em>StateFlow ensures atomic replacement, not automatic correctness of complex concurrent logic.</em></blockquote><h4>9. Compose state model (correct mental model)</h4><p>Jetpack Compose does not rely on object identity alone.</p><p>It uses:</p><ul><li>snapshot state system</li><li>tracking of state reads during composition</li><li>invalidation based on observed dependencies</li></ul><h4>Correct model:</h4><blockquote><em>Recomposition happens when </em><strong><em>observed state changes</em></strong><em>, not when objects are replaced or mutated blindly.</em></blockquote><p>Immutability is still preferred because:</p><ul><li>it simplifies reasoning</li><li>avoids accidental in-place mutation bugs</li><li>works well with snapshot-based observation</li></ul><h4>10. Safe publication (cross-thread correctness)</h4><p>Even correctly written objects can be unsafe if shared improperly between threads.</p><p>Example:</p><pre>class Holder {<br>    var config: Config? = null<br>}</pre><p>Without proper synchronization or visibility guarantees:</p><ul><li>another thread may see stale values</li></ul><h4>Safe publication mechanisms:</h4><ul><li>val initialization</li><li>@Volatile</li><li>synchronized</li><li>AtomicReference</li><li>coroutine confinement (preferred)</li></ul><h4>11. Core mental model used in senior Android design</h4><p>Instead of thinking in terms of keywords, engineers reason like this:</p><h4>1. Ownership</h4><ul><li>Who is allowed to mutate this state?</li></ul><h4>2. Mutation control</h4><ul><li>Is mutation centralized or distributed?</li></ul><h4>3. Concurrency boundary</h4><ul><li>Is state shared across threads or confined?</li></ul><h4>4. Exposure safety</h4><ul><li>Are we exposing mutable internals?</li></ul><h4>Conclusion</h4><p>A correct senior Android understanding is:</p><ul><li>val is not immutability</li><li>Kotlin collections are not inherently immutable</li><li>hidden mutation is the primary source of state bugs</li><li>thread safety involves atomicity, visibility, and ordering</li><li>@Volatile only provides visibility guarantees</li><li>StateFlow.update provides atomic state replacement, not full correctness</li><li>Compose reacts to observed state, not raw mutation</li><li>best architecture often eliminates shared mutable state entirely</li></ul><p>One-line senior principle:</p><blockquote><em>“Correct Android architecture minimizes shared mutation, enforces ownership, and treats concurrency as a design problem — not a keyword problem.”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ae0a01fd803" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/kotlin-immutability-thread-safety-in-android-2ae0a01fd803">Kotlin Immutability &amp; Thread Safety in Android</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Android Interviews in 2026: 11 Core Concepts Every Android Developer Must Know]]></title>
            <link>https://medium.com/kayvan-kaseb/mastering-android-interviews-in-2026-11-core-concepts-every-android-developer-must-know-7890480b8e40?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7890480b8e40</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[android-interviews]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 11:11:17 GMT</pubDate>
            <atom:updated>2026-06-06T18:03:32.649Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Practical Deep Dive into Kotlin, Coroutines, and Jetpack Compose for Modern Android Interviews</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBzknut0IyiPdOFb1BNdPg.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/a-man-and-a-woman-shaking-hands-in-front-of-a-laptop-qFSQFSmfZkA">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Android interviews rarely focus on syntax alone. Most companies evaluate how deeply you understand Android architecture, concurrency, state management, Kotlin internals, and modern UI frameworks like Jetpack Compose. This article will break down 11 essential Android concepts frequently asked in interviews, not just from a theoretical perspective, but with practical reasoning and real-world use cases.</p><h4>Introduction</h4><p>Android development interviews in 2026 are no longer focused on basic framework knowledge alone. Instead, they evaluate how well you understand <strong>modern Android architecture, concurrency, reactive programming, and Jetpack Compose internals</strong>.</p><p>Many developers struggle not because these concepts are inherently difficult, but because they learn them in isolation without understanding how they connect in real-world applications.</p><p>This article breaks down the <strong>11 most important Android interview concepts</strong>, including:</p><ul><li>Kotlin Coroutines and Dispatchers</li><li>Kotlin Flow (StateFlow, SharedFlow, Channel)</li><li>Jetpack Compose state and recomposition</li><li>Core Kotlin language concepts</li><li>Android architecture fundamentals</li></ul><p>By the end, you’ll not only be able to answer interview questions confidently, but also understand the reasoning behind each concept — which is exactly what interviewers look for.</p><h4>1. Content Providers in Android</h4><p>Content Providers enable secure data sharing between applications using <strong>Inter-Process Communication (IPC)</strong>.</p><p>They are one of the four core Android components:</p><ul><li>Activities</li><li>Services</li><li>Broadcast Receivers</li><li>Content Providers</li></ul><h4>Purpose</h4><p>They expose structured data (usually from SQLite or system databases) in a controlled way using permissions.</p><h4>Real-world examples:</h4><ul><li>Contacts Provider → access device contacts</li><li>MediaStore → access images, videos, and audio files</li></ul><h4>Why it matters:</h4><ul><li>Secure cross-app data sharing</li><li>Encapsulation of internal storage</li><li>Standardized system data access</li></ul><h4>2. Coroutine Dispatchers</h4><p>Dispatchers determine which thread a coroutine runs on.</p><h4>Dispatchers explained:</h4><h4>Dispatchers.Main</h4><p>Runs on the UI thread.<br>Used for:</p><ul><li>UI updates</li><li>Compose rendering</li><li>State observation</li></ul><h4>Dispatchers.IO</h4><p>Used for:</p><ul><li>Network calls</li><li>Database operations</li><li>File I/O</li></ul><p>Optimized for blocking IO tasks.</p><h4>Dispatchers.Default</h4><p>Used for CPU-intensive work:</p><ul><li>Sorting</li><li>Parsing</li><li>Image processing</li></ul><p>Thread pool size ≈ number of CPU cores.</p><p><strong>Example</strong></p><pre>viewModelScope.launch(Dispatchers.IO) {<br>    val data = repository.fetchData()<br><br>withContext(Dispatchers.Main) {<br>        uiState.value = data<br>    }<br>}</pre><h4>3. Backpressure in Kotlin Flows</h4><p>Backpressure occurs when a producer emits faster than a consumer can process.</p><h4>Example:</h4><ul><li>Producer: 300ms emissions</li><li>Consumer: 500ms processing</li></ul><h4>Solutions:</h4><h4>buffer()</h4><p>Stores items temporarily.</p><h4>conflate()</h4><p>Keeps only the latest value.</p><h4>collectLatest()</h4><p>Cancels previous work when new value arrives.</p><p><strong>Example</strong></p><pre>searchFlow.collectLatest { query -&gt;<br>    val result = repository.search(query)<br>    showResult(result)<br>}</pre><p>Best for:</p><ul><li>Search inputs</li><li>Live filtering</li><li>Auto-complete</li></ul><h4>4. Coroutines vs Threads</h4><p>Threads are heavy OS-level units.</p><p>Coroutines are lightweight and run inside threads.</p><h4>Key difference:</h4><p><strong>Threads</strong></p><ul><li>Heavy weight OS-level unit</li><li>Managed by the operating system</li><li>Blocking in nature</li><li>Expensive to create and switch</li></ul><p><strong>Coroutines</strong></p><ul><li>Lightweight concurrency unit</li><li>Managed by Kotlin</li><li>Non-blocking (suspending)</li><li>Can run thousands efficiently</li></ul><p><strong>Example</strong></p><pre>Thread.sleep(2000) // ❌ Blocks thread</pre><pre>delay(2000) // ✔ Suspends coroutine only</pre><h4>5. remember vs rememberSaveable in Jetpack Compose</h4><h4>remember</h4><p>Survives recomposition only.</p><h4>rememberSaveable</h4><p>Survives configuration changes and process death (when possible).</p><p><strong>Example</strong></p><pre>@Composable<br>fun Counter() {<br>    var count by rememberSaveable { mutableStateOf(0) }<br><br>Button(onClick = { count++ }) {<br>        Text(&quot;Count: $count&quot;)<br>    }<br>}</pre><h4>6. How Compose Handles Recomposition</h4><p>Jetpack Compose uses a <strong>Snapshot system</strong> to track state reads.</p><p>When state changes:</p><ul><li>Only affected composables recompose</li><li>Not the entire UI</li></ul><p><strong>Example</strong></p><pre>@Composable<br>fun Greeting(name: String) {<br>    Text(text = &quot;Hello $name&quot;)<br>}</pre><p>If name changes, only this composable recomposes.</p><h4>7. val vs const val in Kotlin</h4><p><strong>val</strong></p><ul><li>Initialized at runtime</li><li>Can be declared anywhere</li><li>Value is immutable after assignment</li><li>Stored as a normal property with a getter</li></ul><p><strong>const val</strong></p><ul><li>Must be known at compile time</li><li>Can only be declared at top-level or inside objects</li><li>Value is inlined at compile time</li><li>No runtime lookup (better performance)</li></ul><p><strong>Example</strong></p><pre>val runtimeValue = &quot;Hello&quot;.reversed()<br><br>const val API_KEY = &quot;12345&quot;</pre><h4>8. Encapsulation in OOP</h4><p>Encapsulation hides internal implementation and exposes only necessary behavior.</p><p><strong>Example</strong></p><pre>class BankAccount {<br>    private var balance = 0<br><br>fun deposit(amount: Int) {<br>        if (amount &gt; 0) balance += amount<br>    }<br>    fun getBalance(): Int = balance<br>}</pre><h4>9. Any, Unit, and Nothing in Kotlin</h4><h4>Any</h4><p>Root type of all classes.</p><h4>Unit</h4><p>Represents no meaningful return value.</p><pre>fun logMessage(): Unit {<br>    println(&quot;Logging...&quot;)<br>}</pre><h4>Nothing</h4><p>Represents functions that never return.</p><pre>fun fail(): Nothing {<br>    throw IllegalStateException(&quot;Error&quot;)<br>}</pre><p>Used for:</p><ul><li>Exceptions</li><li>Infinite loops</li><li>Unreachable code</li></ul><h4>10. StateFlow vs SharedFlow vs Channel</h4><h4>StateFlow (State holder)</h4><p>Always holds latest value.</p><pre>val state = MutableStateFlow(0)</pre><h4>SharedFlow (Event stream)</h4><pre>val events = MutableSharedFlow&lt;String&gt;()</pre><h4>Channel (One-time events)</h4><pre>val channel = Channel&lt;String&gt;()</pre><p>Used for:</p><ul><li>Navigation events</li><li>Snackbars</li><li>One-off actions</li></ul><h4>11. Structured Concurrency in Coroutines</h4><p>Structured concurrency ensures coroutines follow lifecycle rules.</p><p>If parent cancels → children cancel automatically.</p><p><strong>Example</strong></p><pre>viewModelScope.launch {<br>    launch {<br>        delay(1000)<br>        println(&quot;Child 1&quot;)<br>    }<br><br>launch {<br>        delay(2000)<br>        println(&quot;Child 2&quot;)<br>    }<br>}</pre><h4>Common Mistakes Android Developers Make</h4><h4>1. Blocking Main Thread</h4><pre>Thread.sleep(2000) // ❌</pre><h4>2. Wrong Dispatcher Usage</h4><p>Using IO for CPU-heavy work instead of Default.</p><h4>3. Misusing SharedFlow</h4><p>Using it as state instead of StateFlow.</p><h4>4. Overusing rememberSaveable</h4><p>Storing complex objects instead of ViewModel.</p><h4>5. Confusing Coroutines with Threads</h4><p>Coroutines are not threads — they are lightweight tasks inside threads.</p><h4>Where These Concepts Are Used in Real Android Applications</h4><h4>1. Messaging Apps</h4><ul><li>StateFlow → chat UI state</li><li>SharedFlow → incoming messages</li><li>Dispatchers.IO → network sync</li></ul><p><strong>Example</strong></p><pre>val chatState = MutableStateFlow&lt;List&lt;Message&gt;&gt;(emptyList())<br>val incomingMessages = MutableSharedFlow&lt;Message&gt;()</pre><h4>2. E-commerce Apps</h4><ul><li>collectLatest → search optimization</li><li>Flow → user input handling</li><li>StateFlow → cart state</li></ul><p><strong>Example</strong></p><pre>searchFlow<br>    .debounce(300)<br>    .distinctUntilChanged()<br>    .collectLatest { query -&gt;<br>        val result = repository.searchProducts(query)<br>        _searchState.value = result<br>    }</pre><h4>3. Media Apps</h4><ul><li>StateFlow → playback state</li><li>Default dispatcher → processing</li><li>Compose → UI updates</li></ul><h4>4. System Apps</h4><ul><li>Content Providers → MediaStore, Contacts</li><li>ContentResolver → querying system data</li></ul><p><strong>Example</strong></p><pre>val cursor = contentResolver.query(<br>    MediaStore.Images.Media.EXTERNAL_CONTENT_URI,<br>    null,<br>    null,<br>    null,<br>    null<br>)</pre><h4>5. Compose Apps</h4><ul><li>rememberSaveable → state survival</li><li>ViewModel + Flow → business logic</li><li>Compose → reactive UI</li></ul><p><strong>Additional Notes</strong></p><p>The examples in this article are intentionally simplified for learning purposes. In real Android applications, there are usually additional architectural and lifecycle considerations.</p><p>Dispatchers.IO is often used inside the repository layer rather than directly in the ViewModel.</p><p>SharedFlow can replay previous emissions using configurations like replay = 1.</p><p>MediaStore and ContactsContract require runtime permissions such as READ_MEDIA_IMAGES or READ_CONTACTS.</p><p>rememberSaveable is best for lightweight UI state, while complex state should typically live inside a ViewModel.</p><p>Production Flow pipelines commonly use operators like debounce(), distinctUntilChanged(), retry(), and catch().</p><p>Understanding these trade-offs and architectural decisions is what separates production-ready Android engineers from developers who only memorize APIs.</p><h4>Conclusion</h4><p>Modern Android development is no longer about memorizing APIs — it is about understanding how the system behaves under real-world constraints.</p><p>If you understand the concepts in this article, you are already ahead of most Android developers preparing for interviews.</p><p>Mastering:</p><ul><li>Kotlin Coroutines and structured concurrency</li><li>Flow APIs (StateFlow, SharedFlow, Channel)</li><li>Jetpack Compose state and recomposition model</li><li>Core Kotlin fundamentals</li><li>Android architecture principles</li></ul><p>will not only help you clear interviews but also make you a more reliable and production-ready Android engineer.</p><p>Great Android engineers don’t just use frameworks — they understand the trade-offs behind them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7890480b8e40" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/mastering-android-interviews-in-2026-11-core-concepts-every-android-developer-must-know-7890480b8e40">Mastering Android Interviews in 2026: 11 Core Concepts Every Android Developer Must Know</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why the Software Engineering Industry Needs System Thinkers More Than Ever]]></title>
            <link>https://medium.com/kayvan-kaseb/why-the-software-engineering-industry-needs-system-thinkers-more-than-ever-5769acd90105?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5769acd90105</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 22:27:16 GMT</pubDate>
            <atom:updated>2026-06-03T22:27:55.639Z</atom:updated>
            <content:encoded><![CDATA[<h4>Beyond Code: The Rise of System Thinking in the Age of AI-Driven Development</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DFVqLFxao9QZz85pKLwVA.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/man-siting-on-wooden-dock-qg6MDcCWBfM">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Software engineering has evolved from writing low-level machine instructions to building highly abstracted, distributed, and AI-augmented systems. In the early era of computing, developers worked close to hardware, carefully optimizing code for limited resources. As languages, frameworks, and platforms matured, development shifted toward abstraction, productivity, and rapid iteration. The mobile and cloud revolutions further expanded this complexity, turning standalone applications into interconnected ecosystems spanning devices, APIs, and services. Now, with the rise of AI-assisted development, the act of writing code itself is becoming increasingly automated. As a result, the real challenge is no longer producing code — it is ensuring that systems remain coherent, scalable, and resilient as they grow. In this environment, system thinking is becoming the defining skill of modern software engineering.</p><h4>Introduction</h4><p>Software engineering has always evolved alongside computing itself. In its earliest form, development was tightly bound to hardware constraints, where engineers wrote low-level instructions with a primary focus on performance, memory efficiency, and precision. Over time, the rise of high-level programming languages shifted the focus from machine-centric optimization to human-centric design, enabling abstraction, reuse, and faster development cycles.</p><p>As the industry matured, frameworks and platforms introduced new layers of structure and complexity. The mobile era fragmented application development across devices, operating systems, and screen sizes, forcing engineers to think beyond single-environment software. Soon after, the cloud revolution redefined applications entirely, transforming them into distributed systems composed of services, APIs, queues, and globally scalable infrastructure. Software was no longer a standalone artifact — it became a living, interconnected system.</p><p>Today, we are entering another major shift driven by AI-assisted development. Code generation, automated scaffolding, and intelligent copilots are dramatically reducing the cost of writing software. However, while implementation is becoming faster and more accessible, system-level complexity is increasing at an even greater rate. The core challenge is no longer how to write code efficiently, but how to ensure that increasingly complex systems remain coherent, maintainable, and resilient over time.</p><p>This is where system thinking becomes essential.</p><p>System thinking is a mindset that shifts the focus from isolated components to the relationships and interactions between them. Instead of evaluating software in terms of individual features or modules, it emphasizes understanding how data flows through the system, how dependencies evolve, and how local decisions impact global behavior. It encourages engineers to think in terms of structure rather than syntax, and behavior rather than implementation details.</p><p>At its core, a system thinking mindset prioritizes long-term stability over short-term convenience. It encourages engineers to design clear boundaries between components, minimize hidden coupling, and maintain predictable data flow. Rather than optimizing for the “happy path,” system thinkers design for uncertainty — considering failure modes, scaling pressures, and real-world runtime conditions from the beginning.</p><p>In modern software engineering, where AI accelerates development and systems grow more distributed and interconnected, this mindset is becoming a critical differentiator. The ability to reason about systems holistically is what separates engineers who build features from those who build sustainable, scalable architectures.</p><h4>1. Frameworks Change, but System Thinking is Permanent</h4><p>The tech industry is defined by constant change. Frameworks, languages, and paradigms evolve rapidly — what was standard yesterday may be obsolete tomorrow.</p><p>The problem is that developers who focus too heavily on tools often become trapped in cycles of re-learning and rework whenever the ecosystem shifts. This leads to fragile career dependency on specific technologies rather than transferable engineering skill.</p><p>System thinkers avoid this trap by focusing on enduring principles: separation of concerns, decoupling, lifecycle management, and predictable data flow. Instead of asking “How do I use this framework?”, they ask “How does information move through this system safely and efficiently?”</p><p>This mindset makes them adaptable across any technology stack.</p><h4>2. Guarding Against AI-Generated Code Bloat</h4><p>AI coding tools have dramatically increased development speed. Features that once took days can now be generated in minutes. However, this acceleration introduces a new risk: architectural inconsistency at scale.</p><p>AI tools excel at producing localized solutions but often lack awareness of system-wide structure. When used without oversight, they can generate redundant logic, inconsistent patterns, and tightly coupled components that are difficult to maintain.</p><p>System thinkers act as architectural gatekeepers in this environment. They evaluate AI-generated code not just for correctness, but for alignment with the system’s overall design. Their role is to ensure coherence across modules, enforce boundaries, and prevent long-term technical debt from accumulating unnoticed.</p><h4>3. Designing for Multi-Device and Multi-Environment Systems</h4><p>Modern applications are no longer confined to a single screen or device type. Software must now operate across phones, foldables, wearables, desktop environments, automotive systems, and even spatial computing platforms.</p><p>A common failure point in many systems is device-specific design — hardcoding layouts and logic for a single form factor. While this may work initially, it creates brittle systems that require significant rework when extended to new platforms.</p><p>System thinkers solve this by designing architecture around device-agnostic principles. They separate core business logic and data layers from presentation layers, allowing the same system to adapt to different interfaces without structural changes.</p><p>This ensures longevity and scalability across evolving hardware ecosystems.</p><h4>4. Building for Real-World Complexity and Scale</h4><p>Software behaves predictably in controlled environments, but production systems operate under constant uncertainty. Network instability, memory limitations, background process termination, and unpredictable user behavior all introduce failure conditions that are difficult to replicate in development.</p><p>Many systems fail because they are designed primarily for the “happy path,” where everything functions perfectly. In reality, robustness comes from handling the edge cases first.</p><p>System thinkers design defensively. They account for offline behavior, caching strategies, retry mechanisms, state recovery, and resource constraints. Their goal is not only to make systems work, but to ensure they continue working under adverse and unpredictable conditions.</p><h4>Conclusion</h4><p>The role of the software engineer is shifting. Writing code is no longer the primary differentiator, as AI increasingly automates implementation details. What remains essential is the ability to design systems that are structured, scalable, and resilient.</p><p>System thinkers represent this next stage of engineering maturity. They see beyond individual features and code files, focusing instead on how entire systems behave, evolve, and survive over time. In a world where software is becoming more complex and more automated simultaneously, this mindset is no longer optional — it is foundational.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5769acd90105" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/why-the-software-engineering-industry-needs-system-thinkers-more-than-ever-5769acd90105">Why the Software Engineering Industry Needs System Thinkers More Than Ever</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gaps in Modern Android Architecture: Balancing Structure and Practicality]]></title>
            <link>https://medium.com/kayvan-kaseb/gaps-in-modern-android-architecture-balancing-structure-and-practicality-821d56985903?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/821d56985903</guid>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[android-development]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 21:13:52 GMT</pubDate>
            <atom:updated>2026-06-03T21:15:25.930Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Evolution and Limitations of Modern Android Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ae7LTS7JlOHERcXxE9T8CQ.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/photo-of-silhouette-photo-of-man-standing-on-rock-U3C79SeHa7k">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Modern Android architecture evolved to address the growing complexity of mobile applications through patterns such as MVVM, Clean Architecture, and modularization. While these approaches improve scalability, maintainability, and separation of concerns, they can also introduce over-engineering, excessive abstraction, and unnecessary complexity when applied without considering actual project needs. As Android development continues to evolve with reactive UI systems and asynchronous data flows, architecture must remain practical, adaptive, and focused on solving real problems rather than pursuing structural perfection. This essay aims to discuss the evolution of Android architecture, the reasons behind structured design patterns, and the importance of balancing architectural principles with practical development needs.</p><h4>Introduction</h4><p>Modern Android development has evolved significantly over the years. Early Android applications were often built with minimal architectural planning, where Activities and Fragments handled almost everything: UI rendering, API calls, business logic, state management, and database operations. While this approach worked for small applications, it quickly became problematic as applications grew in complexity.</p><p>As Android applications became larger and teams became bigger, developers started facing serious challenges:</p><ul><li>tightly coupled code</li><li>difficult testing</li><li>poor maintainability</li><li>duplicated logic</li><li>unstable UI state management</li><li>slow feature development</li></ul><p>To solve these issues, the Android ecosystem gradually adopted architectural patterns such as MVC, MVP, MVVM, Clean Architecture, and modularization. These structures introduced separation of concerns, scalability, and better maintainability.</p><p>Today, modern Android architecture commonly combines:</p><ul><li>MVVM</li><li>Clean Architecture</li><li>Repository Pattern</li><li>Modularization</li><li>Reactive state management with Flow/StateFlow</li><li>Jetpack Compose</li></ul><p>These patterns provide a strong foundation for building scalable applications. However, while they look ideal in theory, real-world production systems often expose important gaps, trade-offs, and hidden complexities that are not always discussed.</p><p>This article explores those gaps and highlights a critical idea:</p><blockquote><em>Good architecture is not about adding more layers. It is about choosing the right level of structure for the problem you are solving.</em></blockquote><h4>Why Structured Architecture Became Necessary</h4><p>Architecture in Android development did not become popular because developers wanted complexity. It emerged because applications became difficult to manage without clear boundaries.</p><p>Without structure:</p><ul><li>Activities became “God classes”</li><li>UI and business logic were mixed together</li><li>Testing became nearly impossible</li><li>Features affected unrelated parts of the app</li><li>Teams struggled to collaborate efficiently</li></ul><p>To address this, modern architecture introduced separation of concerns.</p><p>A common modern structure looks like this:</p><p>UI → ViewModel → UseCase → Repository → Data Source</p><p>Each layer has a specific responsibility:</p><ul><li>UI handles rendering and user interaction</li><li>ViewModel manages UI state</li><li>UseCase contains business logic</li><li>Repository coordinates data</li><li>Data Sources handle API and database operations</li></ul><p>This separation improves:</p><ul><li>scalability</li><li>maintainability</li><li>testability</li><li>developer collaboration</li></ul><p>However, the real challenge begins when structure becomes excessive.</p><h4>1. The Biggest Problem: Over-Engineering</h4><p>One of the most common mistakes in modern Android development is applying full Clean Architecture to every feature regardless of complexity.</p><p>For example, a simple “display a list” screen may end up containing:</p><ul><li>ViewModel</li><li>UseCase</li><li>Repository interface</li><li>Repository implementation</li><li>DTO models</li><li>Domain models</li><li>UI models</li><li>Mappers</li><li>Remote data source</li><li>Local data source</li></ul><p>While technically “clean,” this creates unnecessary complexity.</p><h4>Problems caused by over-structuring:</h4><ul><li>slower development</li><li>excessive boilerplate</li><li>difficult onboarding for junior developers</li><li>harder debugging</li><li>unnecessary abstractions</li></ul><p>Architecture should solve problems, not create them.</p><p>The most important principle is:</p><blockquote><em>Structure should scale with complexity.</em></blockquote><p>Simple features should remain simple.<br>Complex systems should receive stronger architectural boundaries.</p><h4>2. Excessive Abstraction and Boilerplate</h4><p>Modern Clean Architecture often introduces multiple layers of abstraction:</p><ul><li>API models</li><li>domain models</li><li>presentation models</li><li>mappers between every layer</li></ul><p>Although abstraction can improve flexibility, overusing it creates:</p><ul><li>repetitive code</li><li>duplicated data structures</li><li>unnecessary transformations</li><li>larger maintenance costs</li></ul><p>In many projects, developers spend more time maintaining architecture than solving business problems.</p><p>A practical architecture should introduce abstraction only when it provides clear value.</p><h4>3. Weak State Management Guidance</h4><p>Many architecture discussions mention:</p><blockquote><em>“ViewModel should hold UI state.”</em></blockquote><p>However, they rarely explain how state should actually be designed.</p><p>Real applications must handle:</p><ul><li>loading states</li><li>error states</li><li>partial updates</li><li>concurrent updates</li><li>configuration changes</li><li>real-time data streams</li></ul><p>Without a clear state management strategy, applications often suffer from:</p><ul><li>inconsistent UI</li><li>unpredictable behavior</li><li>race conditions</li><li>stale data rendering</li></ul><p>Modern Android development increasingly relies on:</p><ul><li>StateFlow</li><li>immutable UI state</li><li>sealed state classes</li><li>unidirectional data flow</li></ul><p>State management is now one of the most critical parts of architecture, especially with Jetpack Compose.</p><h4>4. Concurrency and Real-Time Complexity</h4><p>Architecture diagrams usually assume linear execution:</p><p>UI → ViewModel → Repository → API</p><p>Real-world systems are not linear.</p><p>Modern Android apps frequently deal with:</p><ul><li>multiple simultaneous requests</li><li>request cancellation</li><li>retries</li><li>pagination</li><li>caching</li><li>offline synchronization</li><li>websocket updates</li></ul><p>Without proper concurrency handling, architecture becomes fragile regardless of how “clean” the structure looks.</p><p>Important modern solutions include:</p><ul><li>coroutine scopes</li><li>Flow operators</li><li>caching strategies</li><li>single source of truth patterns</li><li>request deduplication</li></ul><h4>5. Repository Layer Becoming a “God Object”</h4><p>Repositories are intended to abstract data operations.</p><p>However, in many projects they slowly become overloaded with:</p><ul><li>API calls</li><li>caching logic</li><li>mapping logic</li><li>synchronization logic</li><li>business rules</li></ul><p>Eventually, the repository violates separation of concerns internally.</p><p>A healthier approach is:</p><ul><li>RemoteDataSource → handles APIs</li><li>LocalDataSource → handles database</li><li>Repository → coordinates data flow only</li></ul><p>The repository should orchestrate, not dominate the entire data layer.</p><h4>6. The Domain Layer Is Not Always Necessary</h4><p>Clean Architecture strongly promotes the domain layer.</p><p>However, many Android applications are:</p><ul><li>CRUD-based</li><li>API-driven</li><li>relatively simple</li></ul><p>In these cases:</p><ul><li>UseCases become pass-through wrappers</li><li>domain models duplicate existing models</li><li>complexity increases without meaningful benefit</li></ul><p>The domain layer becomes valuable when:</p><ul><li>business rules are complex</li><li>logic is reusable</li><li>multiple data sources exist</li><li>application rules must remain independent from frameworks</li></ul><p>Architecture should be introduced based on actual needs, not architectural fashion.</p><h4>7. Modularization Challenges</h4><p>Feature-based modularization improves scalability and team collaboration.</p><p>However, many discussions fail to explain:</p><ul><li>when to split modules</li><li>how large modules should be</li><li>how to avoid circular dependencies</li><li>how to share common code safely</li></ul><p>Poor modularization can create:</p><ul><li>fragmented codebases</li><li>complicated dependency graphs</li><li>increased build complexity</li></ul><p>A practical guideline is:</p><blockquote><em>Modules should represent business capabilities or user flows, not individual screens.</em></blockquote><h4>8. Testing Complexity</h4><p>Modern architecture improves testability in theory, but testing strategy is often under-explained.</p><p>Teams still struggle with:</p><ul><li>what should be unit tested</li><li>what should be mocked</li><li>how integration testing should work</li><li>testing asynchronous flows</li></ul><p>A balanced testing strategy typically includes:</p><ul><li>ViewModel tests for UI state</li><li>UseCase tests for business rules</li><li>Repository tests for data orchestration</li><li>fake data sources for isolation</li></ul><p>Architecture alone does not guarantee good testing practices.</p><h4>9. Jetpack Compose Changed Architectural Needs</h4><p>Many older architecture patterns were designed around XML and Fragments.</p><p>Jetpack Compose introduced:</p><ul><li>reactive UI</li><li>recomposition</li><li>state-driven rendering</li></ul><p>This changes architectural requirements significantly.</p><p>Modern architectures must now consider:</p><ul><li>state hoisting</li><li>recomposition safety</li><li>lifecycle-aware state collection</li><li>immutable state patterns</li></ul><p>Architecture can no longer focus only on layering; it must also support reactive rendering models.</p><h4>10. Performance and Build-Time Costs</h4><p>Large-scale modular architectures introduce hidden costs:</p><ul><li>increased Gradle complexity</li><li>slower builds</li><li>more generated classes</li><li>deeper object graphs</li><li>excessive mapping overhead</li></ul><p>A highly layered architecture is not automatically efficient.</p><p>Practical systems often optimize by:</p><ul><li>reducing unnecessary abstractions</li><li>simplifying data transformations</li><li>minimizing module fragmentation</li></ul><h4>Final Insight</h4><p>The biggest gap in many “modern Android architecture” discussions is this:</p><blockquote><em>They often describe ideal architecture instead of practical architecture.</em></blockquote><p>Good architecture is not measured by:</p><ul><li>the number of layers</li><li>the number of abstractions</li><li>how “pure” Clean Architecture appears</li></ul><p>Good architecture is measured by:</p><ul><li>maintainability</li><li>adaptability</li><li>developer productivity</li><li>scalability when needed</li><li>simplicity when possible</li></ul><h4>Conclusion</h4><p>Modern Android architecture provides powerful tools for building scalable applications. MVVM, Clean Architecture, modularization, and reactive state management all solve important engineering problems.</p><p>However, architecture should never become an objective by itself.</p><p>The real skill in software architecture is judgment:</p><ul><li>knowing when to introduce structure</li><li>knowing when to simplify</li><li>knowing when abstraction adds value</li><li>and knowing when complexity becomes harmful</li></ul><p>The best architecture is not the most complicated one. It is the architecture that:</p><ul><li>solves the current problem effectively</li><li>remains maintainable over time</li><li>adapts as the application evolves</li><li>and avoids unnecessary complexity</li></ul><p>In software engineering, simplicity is not the absence of structure. It is the result of choosing the right structure for the right problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=821d56985903" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/gaps-in-modern-android-architecture-balancing-structure-and-practicality-821d56985903">Gaps in Modern Android Architecture: Balancing Structure and Practicality</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking Skeleton for AI-Native Android Systems]]></title>
            <link>https://medium.com/kayvan-kaseb/walking-skeleton-for-ai-native-android-systems-b330026c938c?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b330026c938c</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[walking-skeleton]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 21:33:40 GMT</pubDate>
            <atom:updated>2026-06-01T21:34:21.729Z</atom:updated>
            <content:encoded><![CDATA[<h4>A system design approach for building reliable generative AI Android applications</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbLfePhY1GBctLzWeB2inQ.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/black-stacking-stones-on-gray-surface-ObpCE_X3j6U">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Modern Android applications increasingly integrate generative AI, on-device models, and cloud-based inference systems. While these capabilities unlock new user experiences, they also introduce integration complexity that is often only discovered late in development. The Walking Skeleton approach provides a practical engineering strategy to reduce this risk by validating a minimal end-to-end system early. This ensures that core architecture, data flow, and external integrations work together before scaling features. This article explains how to apply the Walking Skeleton approach in AI-enabled Android applications using standard architectural principles based on UI, ViewModel, domain layer, repository, and data sources.</p><h4>Introduction</h4><p>Modern Android applications are typically structured using a layered architecture:</p><ul><li>UI layer (Jetpack Compose or XML)</li><li>ViewModel (state holder)</li><li>Domain layer (use cases)</li><li>Repository (data coordination layer)</li><li>Data sources (remote and local)</li></ul><p>This architecture ensures separation of concerns, testability, and long-term maintainability. However, modern applications increasingly depend on external AI systems such as:</p><ul><li>Cloud-based LLM APIs</li><li>On-device inference models</li><li>Tool-based integrations</li></ul><p>These introduce complexity not in the UI layer, but in system integration, data flow consistency, and execution reliability. The Walking Skeleton approach addresses this by validating a complete vertical execution path early in development.</p><h4>What Is a Walking Skeleton in Android?</h4><p>A Walking Skeleton is a minimal but fully functional end-to-end implementation of a system that validates the complete execution path.</p><p>It follows the standard Android architecture flow:</p><p>UI → ViewModel → UseCase → Repository → Data Source</p><p>A Walking Skeleton focuses on a single vertical slice that ensures:</p><ul><li>User interaction triggers a real execution flow</li><li>State flows correctly through the system</li><li>UseCase applies business rules and coordinates execution</li><li>Repository delegates data operations</li><li>Data sources return a real response to the system</li></ul><p>The goal is system-level validation, not feature completeness.</p><h4>Why Walking Skeleton Matters in AI-Enabled Applications</h4><p>AI-enabled Android applications introduce variability inside the data layer.</p><p>Unlike traditional backend systems, AI systems are:</p><ul><li>Non-deterministic in output</li><li>Sensitive to latency</li><li>Dependent on external services</li><li>Subject to rate limits and runtime failures</li></ul><p>In addition, applications may support multiple execution environments:</p><ul><li>Cloud-based inference for higher capability</li><li>On-device inference for low latency or offline usage</li></ul><p>These variations introduce integration risks that should be validated early. A Walking Skeleton ensures that at least one complete AI execution path works end-to-end before system complexity increases.</p><h4>AI Integration in Standard Android Architecture</h4><p>In a clean Android architecture, AI integration is not a separate architectural layer. It is implemented within the existing data layer.</p><h4>Standard architecture:</h4><p>UI → ViewModel → UseCase → Repository → Data Source</p><h4>AI-enabled architecture:</h4><p>The Repository delegates data operations to an appropriate data source, which may represent:</p><ul><li>Cloud-based AI services</li><li>On-device inference models</li></ul><p>Selection logic between sources is an implementation detail inside the data layer and should not introduce additional architectural layers. This preserves architectural clarity while enabling AI capabilities.</p><h4>Hybrid Inference in Android Applications</h4><p>Hybrid inference refers to selecting between different execution environments:</p><ul><li>On-device inference (fast, offline-capable)</li><li>Cloud inference (more powerful, network-dependent)</li></ul><p>In a Walking Skeleton, hybrid inference is validated through a minimal flow:</p><ul><li>One user input</li><li>One inference execution path</li><li>One response returned to the UI</li></ul><p>At this stage, the goal is correctness of system flow rather than optimization or performance tuning.</p><h4>A Practical Example: AI Summarization App</h4><p>Consider an application that summarizes user-provided text.</p><h4>Walking Skeleton flow:</h4><ol><li>User enters text in the UI</li><li>ViewModel passes input to a UseCase</li><li>UseCase coordinates execution and calls the Repository</li><li>Repository delegates to a data source: <em>Cloud LLM</em> OR <em>On-device model</em></li><li>Response is returned and rendered in the UI</li></ol><p>At this stage:</p><ul><li>UI is minimal</li><li>Prompt engineering is not a focus</li><li>Context or memory systems are not required</li></ul><p>However, the full system execution path is validated.</p><h4>What You Validate with the Walking Skeleton</h4><h4>Architecture validation</h4><ul><li>UI ↔ ViewModel communication</li><li>UseCase coordination of business rules</li><li>Repository delegation correctness</li></ul><h4>Integration validation</h4><ul><li>Connectivity with AI services</li><li>On-device inference feasibility</li><li>Response handling consistency</li></ul><h4>System behavior validation</h4><ul><li>Latency differences across execution paths</li><li>Failure scenarios (timeouts, empty responses)</li><li>End-to-end data flow correctness</li></ul><h4>Growing the System After the Skeleton</h4><p>Once the Walking Skeleton is stable, the system can evolve incrementally:</p><h4>AI capabilities</h4><ul><li>Prompt refinement and optimization</li><li>Multi-turn conversation support</li><li>Context handling</li></ul><h4>Advanced features</h4><ul><li>Tool calling (APIs, search, structured actions)</li><li>Response formatting improvements</li><li>Lightweight orchestration logic inside the domain layer when needed</li></ul><h4>System improvements</h4><ul><li>Caching strategies</li><li>Streaming responses</li><li>Retry and fallback handling</li><li>Cost-aware routing decisions</li></ul><p>The key principle remains:</p><blockquote><em>Build a working end-to-end system first, then evolve functionality incrementally within the same architecture boundaries.</em></blockquote><h4>Common Mistakes in AI-Enabled Android Development</h4><h4>1. Overengineering AI logic early</h4><p>Introducing complex prompt or orchestration systems before validating basic integration.</p><h4>2. Delaying real integration</h4><p>Relying too long on mocked responses and missing real system behavior.</p><h4>3. Breaking architectural boundaries</h4><p>Introducing unnecessary layers outside the standard Android architecture.</p><h4>4. Ignoring multiple execution paths</h4><p>Failing to validate both cloud and on-device flows early enough.</p><h4>Why This Approach Matters</h4><p>AI-enabled Android applications are integration-heavy systems. Their correctness depends on:</p><ul><li>Data flow integrity</li><li>External model behavior</li><li>Runtime variability</li><li>System-level interactions</li></ul><p>The Walking Skeleton approach ensures these risks are addressed early by validating a real but minimal system.</p><h4>Conclusion</h4><p>The Walking Skeleton approach is a practical strategy for building reliable Android applications, especially when integrating generative AI and hybrid inference systems. By keeping AI interactions encapsulated within the data layer and maintaining standard Android architecture boundaries, developers can support advanced capabilities while preserving system clarity.</p><p>The key principle is simple:</p><blockquote><em>Build a working end-to-end system first, then evolve capabilities incrementally within the same architecture boundaries.</em></blockquote><blockquote>Start with a skeleton that walks — within a real Android architecture — not a system that only exists in design.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b330026c938c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/walking-skeleton-for-ai-native-android-systems-b330026c938c">Walking Skeleton for AI-Native Android Systems</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Native Android Systems with Hybrid Inference and Agentic Architecture]]></title>
            <link>https://medium.com/kayvan-kaseb/ai-native-android-systems-with-hybrid-inference-and-agentic-architecture-b627b511f061?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b627b511f061</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[android-apps]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Tue, 26 May 2026 14:56:01 GMT</pubDate>
            <atom:updated>2026-05-26T14:56:58.350Z</atom:updated>
            <content:encoded><![CDATA[<h4>A System Design Perspective on On-Device Intelligence, Cloud Models, and Dynamic UI Systems</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joMZHf38g1BP8scHmRLgww.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/a-person-holding-a-cell-phone-in-their-hand-hWSNT_Pp4x4">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Mobile applications are evolving from static, API-driven systems into AI-native architectures that combine on-device intelligence, cloud reasoning, and agent-based orchestration. Using a reference Android AI system as a case study, this essay explores how applications integrate Gemini Nano for local inference, Gemini Pro/Flash for cloud reasoning, and hybrid routing to balance latency, privacy, and capability. It further examines agentic workflows enabled by ADK, dynamic UI generation through A2UI/AG-UI-style interfaces, and system-level challenges such as reliability, structured outputs, and privacy-aware design. Together, these patterns illustrate a shift toward distributed intelligent systems where applications no longer execute fixed workflows but coordinate adaptive AI-driven behavior across device and cloud. This essay discuss the architectural principles, trade-offs, and design patterns underlying AI-native Android travel systems, and how they redefine the relationship between applications, intelligence, and user interaction.</p><h4>Introduction</h4><p>Mobile applications have gone through multiple architectural eras. Early Android apps were essentially local UIs backed by remote APIs. Later, cloud-driven architectures introduced personalization, recommendations, and real-time data synchronization. But in both cases, intelligence remained an external layer — something the app <em>called</em>, not something it <em>embodied</em>.</p><p>That separation is now breaking down.</p><p>With the rise of large language models, multimodal AI, and agentic systems, applications are no longer limited to executing predefined workflows. They can interpret intent, reason across multiple sources of information, and coordinate multi-step tasks autonomously.</p><p>This shift is especially visible in travel applications, where complexity is naturally high: itineraries, bookings, maps, receipts, schedules, and real-time updates all converge into a single user experience.</p><p>However, traditional architectures struggle in this domain due to three fundamental constraints:</p><ul><li><strong>Connectivity dependence</strong> (cloud-only systems fail offline)</li><li><strong>Latency sensitivity</strong> (real-time travel assistance requires instant responses)</li><li><strong>Privacy requirements</strong> (travel data is highly sensitive)</li></ul><p>To address this, modern Android AI systems are evolving toward a hybrid model combining on-device intelligence, cloud reasoning, and agent-based orchestration.</p><p>Google’s Jetpack AI ecosystem — demonstrated through reference applications like <strong>Jetpacker</strong> — illustrates this transition. Jetpacker is not just an app concept, but a reference architecture showing how AI-native Android systems can be designed using:</p><ul><li>on-device models (Gemini Nano)</li><li>cloud models (Gemini Pro / Flash)</li><li>hybrid inference routing</li><li>multi-agent orchestration (ADK)</li><li>AI-driven UI generation (A2UI / AG-UI)</li></ul><p>Rather than focusing on “features of a travel app,” this article focuses on the <strong>system design patterns behind AI-native travel applications</strong>, using Jetpacker as a reference model.</p><h4>1. Jetpacker as a Reference AI Architecture</h4><p>Jetpacker represents a shift in Android design philosophy: from feature-driven apps to system-driven intelligence.</p><p>Instead of treating AI as an isolated component, Jetpacker integrates intelligence across all layers of the application stack:</p><ul><li>device-side inference</li><li>cloud reasoning services</li><li>backend agent orchestration</li><li>dynamic UI generation</li><li>hybrid decision routing</li></ul><p>At a high level, the system can be understood as:</p><pre>Android App (Jetpacker)<br> ├── UI Layer (Jetpack Compose + AI-generated UI)<br> ├── On-device AI Layer (Gemini Nano)<br> ├── Hybrid Routing Engine<br> └── Sync Layer</pre><pre>Cloud Backend<br> ├── Gemini Pro / Flash Models<br> ├── Agent Orchestrator (ADK)<br> ├── Specialized Travel Agents<br> └── Session + Tooling Infrastructure</pre><p>This architecture introduces a key idea:</p><blockquote>Intelligence is not a feature — it is a distributed system spanning device, cloud, and UI.</blockquote><h4>2. The Shift to AI-Native Mobile Applications</h4><p>Traditional mobile architecture follows a deterministic pipeline:</p><pre>User Action → UI → Backend API → Database → Response</pre><p>In this model:</p><ul><li>logic is predefined</li><li>workflows are static</li><li>user intent is translated into API calls</li></ul><p>But generative AI breaks this structure.</p><p>Modern LLM-based systems can:</p><ul><li>interpret ambiguous intent</li><li>generate structured outputs</li><li>plan multi-step workflows</li><li>interact with external tools</li><li>dynamically generate responses and interfaces</li></ul><p>This transforms mobile apps into <strong>probabilistic systems</strong> rather than deterministic ones.</p><p>Jetpacker reflects this shift by embedding AI not as a feature layer, but as a <strong>core execution layer</strong>.</p><h4>3. Hybrid Inference: The Core System Design Problem</h4><p>One of the most important architectural decisions in AI-native Android systems is where inference should run.</p><p>Jetpacker uses a <strong>hybrid inference model</strong> combining:</p><ul><li>on-device inference (Gemini Nano)</li><li>cloud inference (Gemini Pro / Flash)</li><li>dynamic routing logic</li></ul><p>This solves a fundamental systems problem:</p><p><em>No single inference environment is optimal for all conditions.</em></p><h4>Why Hybrid Architecture Is Necessary</h4><p>Different execution environments come with different trade-offs. On-device environments offer low latency, better privacy, and the ability to work offline, but they are limited in model capacity and overall computational power. In contrast, cloud environments provide much stronger reasoning capabilities and support much larger context windows, but they depend on network connectivity and can introduce latency. These trade-offs become especially important in travel applications, where conditions are often unstable — such as in airports, during roaming, or in fully offline travel scenarios — making it difficult to rely consistently on either environment alone.</p><h4><strong>Routing Strategy</strong></h4><p>A hybrid inference system evaluates multiple signals:</p><ul><li>network quality</li><li>battery level</li><li>query complexity</li><li>privacy sensitivity</li><li>device capability</li><li>latency constraints</li></ul><p>Then it routes requests accordingly:</p><pre>User Query<br>   ↓<br>Inference Router<br>   ├── On-device (Gemini Nano)<br>   └── Cloud (Gemini Flash / Pro)</pre><p>This creates a system that adapts dynamically rather than relying on fixed execution paths.</p><h4>4. On-Device Intelligence with Gemini Nano</h4><p>On-device AI is enabled by lightweight models such as Gemini Nano, designed for efficient execution on mobile hardware.</p><p>In Jetpacker-style systems, on-device AI is used for:</p><ul><li>itinerary summarization</li><li>travel recommendations</li><li>packing suggestions</li><li>offline assistance</li><li>receipt and document parsing</li></ul><p>A key advantage is <strong>data locality</strong>:</p><blockquote>Sensitive travel data never leaves the device unless necessary.</blockquote><p>This enables a privacy-first AI architecture where personal context remains local by default.</p><h4>Multimodal On-Device Processing</h4><p>Modern mobile AI systems are not limited to text.</p><p>Jetpacker-style applications also process:</p><ul><li>images (receipts, tickets, documents)</li><li>structured data (itineraries, bookings)</li><li>hybrid inputs (image + text reasoning)</li></ul><p>This enables automated travel bookkeeping and contextual understanding without cloud dependency.</p><h4>5. Cloud Intelligence and Grounded Reasoning</h4><p>While on-device models provide efficiency, cloud models provide depth.</p><p>Jetpacker uses cloud-based Gemini models for:</p><ul><li>complex itinerary planning</li><li>conversational travel assistants</li><li>real-time information retrieval</li><li>multi-step reasoning tasks</li></ul><p>However, raw LLM output is not sufficient for real-world travel systems due to factual uncertainty.</p><p>This is where <strong>grounding</strong> becomes essential.</p><p><strong>Grounding Strategies</strong></p><p>Cloud responses are improved using external context:</p><ul><li>web search grounding (real-time information)</li><li>maps grounding (location-based queries)</li><li>URL grounding (structured knowledge sources)</li></ul><p>This ensures that travel recommendations reflect real-world conditions such as:</p><ul><li>opening hours</li><li>transport availability</li><li>current events</li><li>local constraints</li></ul><h4>6. Agentic Architecture: Moving Beyond Single Models</h4><p>A key evolution in Jetpacker-style systems is the shift from single-model inference to <strong>multi-agent orchestration</strong>.</p><p>Instead of one AI handling all tasks, specialized agents are introduced.</p><p>Each agent is responsible for a domain:</p><ul><li>flight booking agent</li><li>hotel reservation agent</li><li>restaurant recommendation agent</li><li>activity planning agent</li></ul><p>A central orchestrator coordinates them.</p><pre>User Request<br>   ↓<br>Orchestrator<br>   ├── Flight Agent<br>   ├── Hotel Agent<br>   ├── Activity Agent<br>   └── Restaurant Agent</pre><p>This design improves:</p><ul><li>modularity</li><li>maintainability</li><li>scalability</li><li>task isolation</li></ul><p>It also mirrors distributed systems design, where responsibilities are decomposed into independent services.</p><h4>7. AI-Native UI Systems</h4><p>One of the most important emerging patterns is AI-generated UI.</p><p>Instead of predefining every screen, AI systems can generate UI structures dynamically.</p><p>This is enabled through protocols like A2UI, where agents return structured UI descriptions instead of raw text.</p><p>On Android, Jetpack Compose acts as a renderer for these dynamic UI definitions.</p><p>This enables:</p><ul><li>dynamic booking flows</li><li>adaptive forms</li><li>context-aware dialogs</li><li>personalized interaction layouts</li></ul><p>The UI becomes a <strong>runtime construct</strong>, not a static design artifact.</p><h4>8. Reliability in Probabilistic Systems</h4><p>Unlike traditional APIs, AI systems are inherently non-deterministic.</p><p>This introduces new system design requirements:</p><p><strong>Key reliability strategies:</strong></p><ul><li>fallback from cloud → on-device models</li><li>structured outputs for safe parsing</li><li>retry and recovery mechanisms</li><li>session persistence for long workflows</li><li>grounding to reduce hallucinations</li></ul><p>A robust AI system is not one that never fails, but one that <strong>degrades gracefully under failure conditions</strong>.</p><h4>9. Privacy-Centric System Design</h4><p>Travel applications process highly sensitive user data:</p><ul><li>passports</li><li>bookings</li><li>payments</li><li>travel history</li></ul><p>Jetpacker-style architectures adopt a <strong>privacy-first hybrid model</strong>:</p><ul><li>sensitive processing remains on-device</li><li>cloud is used for non-sensitive reasoning</li><li>agents enforce data boundaries</li></ul><p>This separation enables: <em>intelligence without full data centralization, </em>which is becoming a key requirement in modern AI systems.</p><h4>10. System Design Principles Derived from Jetpacker</h4><p>From this reference architecture, several reusable design principles emerge:</p><p><strong>1. Intelligence is distributed</strong></p><p>AI systems span device, cloud, and backend layers.</p><p><strong>2. Inference must be adaptive</strong></p><p>Static routing is insufficient for real-world conditions.</p><p><strong>3. Agents improve modularity</strong></p><p>Breaking AI workflows into specialized agents improves system clarity.</p><p><strong>4. UI should be AI-aware</strong></p><p>Interfaces can be partially generated at runtime.</p><p><strong>5. Reliability is a design requirement</strong></p><p>Fallbacks and structured outputs are essential, not optional.</p><h4>Conclusion: Toward AI-Native Android Systems</h4><p>Jetpacker represents a broader transformation in Android development.</p><p>The role of mobile applications is shifting from:</p><ul><li>static interfaces + backend APIs</li></ul><p>to:</p><ul><li>distributed intelligent systems spanning device and cloud</li></ul><p>By combining:</p><ul><li>on-device models (Gemini Nano)</li><li>cloud reasoning (Gemini Pro / Flash)</li><li>hybrid inference routing</li><li>agent orchestration (ADK)</li><li>AI-native UI generation</li></ul><p>Android applications evolve into adaptive systems capable of understanding context, executing workflows, and assisting users across complex real-world scenarios.</p><p>The most important shift is conceptual:</p><blockquote>We are no longer building apps with AI features. We are building AI systems that happen to have apps as their interface.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b627b511f061" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/ai-native-android-systems-with-hybrid-inference-and-agentic-architecture-b627b511f061">AI-Native Android Systems with Hybrid Inference and Agentic Architecture</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Years of Reviewing Research Papers Taught Me About Building Real Systems]]></title>
            <link>https://medium.com/kayvan-kaseb/what-years-of-reviewing-research-papers-taught-me-about-building-real-systems-03654f821224?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/03654f821224</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Fri, 15 May 2026 08:26:47 GMT</pubDate>
            <atom:updated>2026-05-15T08:27:47.932Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lessons learned from working across industry software engineering and reviewing academic research papers since 2012</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6uXb1lwXSeUijF7jjkZyA.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/man-writing-on-paper-OQMZwNd3ThU">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>The gap between academic research and industry practice is often discussed — but rarely experienced from both sides in a meaningful way. Over the years, I’ve found that reviewing research papers has been one of the most effective ways to sharpen my engineering thinking. I’ve served as a reviewer for IEEE and international conferences in software engineering, AI, and educational technology since 2012. In parallel, I have also worked in industry for over a decade in different roles in software development, which gave me exposure to how systems behave beyond academic settings. What became increasingly clear over time is that there is a persistent and important gap between academic research and industry practice. And in the AI era, that gap is becoming more visible and more consequential. Reviewing research papers over time has also given me a practical set of questions I now use to evaluate engineering work in real-world systems.</p><h4>Two different optimization worlds</h4><p>Academia and industry are not in conflict, but they optimize for different things.</p><p>In academic research:</p><ul><li>The focus is on novelty and theoretical contribution</li><li>Results must be formalized, justified, and reproducible</li><li>Evaluation often happens in controlled environments</li></ul><p>In industry:</p><ul><li>The focus is reliability, scale, and maintainability</li><li>Systems must work under messy, real-world constraints</li><li>Success is measured by impact, not publication</li></ul><p>Both are valid. Both are necessary. But they often don’t align naturally.</p><h4>Where the tension becomes obvious</h4><p>One pattern I’ve noticed while reviewing research is that strong academic work can still struggle with practical relevance.</p><p>A solution may be mathematically elegant or experimentally sound, but:</p><ul><li>it assumes clean data that doesn’t exist in production</li><li>it ignores latency, cost, or integration constraints</li><li>it depends on conditions that are hard to reproduce outside the paper</li></ul><p>On the other side, industry systems often evolve without the benefit of structured evaluation:</p><ul><li>improvements are incremental rather than principled</li><li>decisions are driven by engineering intuition and constraints</li><li>documentation of “why it works” is often incomplete</li></ul><p>This creates a disconnect where academia can feel impractical, and industry can feel under-theorized.</p><h4>Why this gap matters more in the AI era</h4><p>AI is changing this dynamic in a fundamental way.</p><p>We are now in a space where:</p><ul><li>research ideas move into products extremely quickly</li><li>large models blur the line between experimentation and deployment</li><li>benchmarks can influence real-world systems almost immediately</li></ul><p>This acceleration has a side effect: <strong>the feedback loop between theory and practice is faster, but not always deeper</strong>.</p><p>It is now possible for:</p><ul><li>a paper to become a product feature within weeks</li><li>a model improvement to be deployed at scale before being fully understood</li><li>evaluation metrics to shape entire product directions</li></ul><p>In this environment, the gap between academic assumptions and industrial reality becomes more critical, not less.</p><h4>What reviewing papers taught me</h4><p>Reviewing research over time has changed how I approach engineering problems.</p><p>A few questions I now naturally ask when evaluating technical work:</p><ul><li>Is this idea still valid under real-world constraints?</li><li>What assumptions are hidden in the evaluation?</li><li>Does the improvement survive outside controlled benchmarks?</li><li>What would break first in production?</li></ul><p>These questions are not only academic — they are deeply practical.</p><p>They force a shift from “does this work in theory?” to “does this still work when everything is imperfect?”</p><h4>The value of staying between both worlds</h4><p>Staying between academia and industry — rather than fully committing to one side — has been one of the most valuable perspectives in my career.</p><p>Academia provides:</p><ul><li>structured thinking</li><li>rigorous evaluation</li><li>long-term perspective</li></ul><p>Industry provides:</p><ul><li>constraint-driven problem solving</li><li>scale and performance realities</li><li>exposure to real user behavior</li></ul><p>The intersection of both is where engineering becomes most meaningful.</p><h4>Conclusion</h4><p>The gap between academic research and industry practice has always existed. But in the AI era, it is becoming more visible, more compressed, and more important to understand.</p><p>Reviewing research has helped me stay closer to this intersection — and think more clearly about what “useful engineering” actually means in practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03654f821224" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/what-years-of-reviewing-research-papers-taught-me-about-building-real-systems-03654f821224">What Years of Reviewing Research Papers Taught Me About Building Real Systems</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building AI Glasses Experiences with Android XR]]></title>
            <link>https://medium.com/kayvan-kaseb/building-ai-glasses-experiences-with-android-xr-3d545496e3d1?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d545496e3d1</guid>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Mon, 11 May 2026 13:58:20 GMT</pubDate>
            <atom:updated>2026-05-11T14:03:40.926Z</atom:updated>
            <content:encoded><![CDATA[<h4>Projection-based architecture, runtime design, and performance constraints in Developer Preview 3</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddlJSKpAgzSBk_T2q0EdAQ.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/man-inside-computerized-room-ML0Bdrx8Go0">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Android XR introduces a unified platform for extended reality across headsets and AI glasses through the Android XR SDK Developer Preview 3. AI glasses represent a lightweight, phone-tethered XR device class designed for glanceable, context-aware interaction rather than full immersive computing. Unlike traditional Android apps, AI glasses experiences are projected extensions of mobile applications, operating within strict performance and interaction constraints. This essay aims to discuss the design and system architecture of AI glasses applications in Android XR, focusing on the projection-based model, UI framework, and performance constraints.</p><h4>Introduction</h4><p>Before the Android XR approach to AI glasses, augmented reality development on Android was largely built around a <strong>screen-first model</strong>. Applications were designed primarily for mobile devices, and even when AR capabilities were introduced through frameworks like ARCore, the experience still depended heavily on direct phone interaction. This meant users had to actively engage with their device, and AR features were often layered on top of traditional mobile UI patterns rather than being truly ambient or wearable-first.</p><p>This earlier approach introduced a few clear limitations. Experiences were typically:</p><ul><li>tightly bound to a single device (the phone),</li><li>dependent on manual, touch-based interaction,</li><li>and difficult to scale into lightweight, always-available wearable contexts.</li></ul><p>With the introduction of the Android XR SDK Developer Preview 3, this model changes in a meaningful way.</p><p>Instead of treating AR as an extension of a mobile screen, Android XR introduces a <strong>projection-based architecture</strong>, where a single application can extend across devices — especially AI glasses — as a lightweight, context-aware surface. In this model, the phone becomes the central compute and state owner, while the glasses serve as a projected interface designed for glanceable and ambient interaction. The Android XR runtime handles projection, session lifecycle, and synchronization between devices.</p><p>This approach is better than earlier models because it removes the need to build separate experiences for mobile and AR. Developers no longer have to duplicate logic or manage fragmented device-specific implementations. Instead, they can design a single experience that naturally adapts to context, input method, and device capability.</p><p>As a result, development shifts from building isolated AR features to designing <strong>continuous, real-world experiences that extend beyond the screen and integrate into the user’s environment in a more seamless way</strong>.</p><p>The following sections explain this model in detail, including its system architecture, UI structure, runtime behavior, and performance considerations.</p><h4>1. System Architecture (Projection-Based Model)</h4><pre>[ Android Phone ]<br>        ├── App Logic (Kotlin)<br>        ├── Compose UI (Mobile)<br>        ├── XR runtime (projection and session management)<br>        └── ARCore Services<br>                 │<br>                 ▼<br>        [ AI Glasses ]<br>        ├── Compose Glimmer UI<br>        ├── Voice / Touch Input<br>        ├── Sensor Access (Camera/Mic)<br>        └── Lightweight Rendering Surface</pre><p>The phone acts as the compute engine, while glasses function as a <strong>projected interaction surface</strong>.</p><h4>2. App Launch &amp; Projection Flow</h4><p>AI glasses experiences are launched through a <strong>projection-aware session context</strong>, not as standalone apps.</p><p>Flow:</p><ol><li>App runs on Android phone</li><li>XR runtime creates a projection session</li><li>An activity launched within an Android XR projected context</li><li>UI is rendered through the Android XR runtime (This manages projection, session lifecycle, and state synchronization between phone and glasses).</li><li>Input is synchronized back to phone</li><li>Session gracefully falls back if projection is lost</li></ol><h4>3. Core UI Structure (Compose Glimmer)</h4><p>UI is built using Jetpack Compose Glimmer, optimized for glanceable interaction.</p><h4>3.1 Projected Activity</h4><pre>class GlassesActivity : ComponentActivity() {</pre><pre>  override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)</pre><pre>        setContent {<br>            HomeScreen(<br>                isVisualUiEnabled = true,<br>                isGlassesDisplayAvailable = true<br>            )<br>        }<br>    }<br>}</pre><h4>3.2 Conditional UI (Core XR Pattern)</h4><pre>@Composable<br>fun HomeScreen(<br>    isVisualUiEnabled: Boolean,<br>    isGlassesDisplayAvailable: Boolean<br>) {<br>    if (isVisualUiEnabled &amp;&amp; isGlassesDisplayAvailable) {<br><br>Card {<br>            Text(&quot;Incoming Message&quot;)<br>            Button(onClick = { /* reply */ }) {<br>                Text(&quot;Reply&quot;)<br>            }<br>        }<br>    } else {<br>        Text(&quot;Voice-only mode active&quot;)<br>    }<br>}</pre><p>AI glasses UI must adapt dynamically between visual and audio-only modes.</p><h4>4. Runtime Behavior Model</h4><ul><li>Phone executes application logic</li><li>Glasses render projected UI</li><li>State is shared across devices</li><li>Projection can disconnect without terminating app</li><li>App continues seamlessly on phone</li></ul><h4>5. Interaction Model</h4><p>AI glasses interactions are intentionally minimal:</p><ul><li>Voice → primary input</li><li>Touch → quick selection</li><li>Context → location / motion / time triggers</li></ul><p>Design principle:</p><blockquote>UI must be action-driven, not navigation-heavy.</blockquote><h4>6. Spatial Computing Layer</h4><p>When enabled, ARCore for Jetpack XR provides:</p><ul><li>Head pose tracking</li><li>Geospatial anchoring (GPS + VPS)</li><li>Context-aware overlays</li></ul><h4>7. System Design Perspective (Lightweight but Important)</h4><p>AI glasses applications follow a <strong>distributed projection architecture</strong>:</p><ul><li>The <strong>phone is the system of record (compute + state ownership)</strong></li><li>The <strong>glasses are a stateless rendering + input surface</strong></li><li><strong>A Android XR runtime manages projection, session lifecycle, and state synchronization between phone and glasses</strong></li><li>Optional spatial services (ARCore) enrich context</li></ul><blockquote>AI glasses act as a lightweight rendering and interaction surface, while session state is primarily owned by the host device (phone).</blockquote><h4>Key architectural constraints:</h4><ul><li>UI must tolerate <strong>projection latency</strong></li><li>State must survive <strong>temporary disconnection</strong></li><li>Rendering must remain <strong>lightweight due to wearable limits</strong></li><li>Experiences must degrade gracefully to phone-only mode</li></ul><p>This makes AI glasses fundamentally different from traditional Android apps: they are <strong>not standalone clients but projected views of a single mobile system</strong>.</p><h4>8. Performance &amp; System Constraints</h4><p>AI glasses are constrained by design:</p><p><strong>Compute</strong></p><ul><li>No independent execution on glasses</li><li>Phone handles all processing</li></ul><p><strong>Battery</strong></p><ul><li>Wearable power limits require minimal rendering load</li></ul><p><strong>Display</strong></p><ul><li>Small field-of-view</li><li>High contrast, low-density UI required</li></ul><p><strong>Input Latency</strong></p><ul><li>Voice and projection introduce delay</li><li>UI must remain responsive under asynchronous input</li></ul><p><strong>Spatial Accuracy</strong></p><ul><li>ARCore tracking prioritizes stability over precision</li></ul><h4>9. Key Design Principles</h4><ul><li>Glanceable UI (&lt;2 seconds comprehension)</li><li>Minimal interaction depth</li><li>Context-driven behavior</li><li>Energy-aware rendering</li><li>Graceful fallback to phone experience</li></ul><p><strong>Failure Modes &amp; Graceful Degradation</strong></p><p>AI glasses experiences in the Android XR SDK Developer Preview 3 are designed to remain functional under partial system failure conditions.</p><p>Key failure scenarios include:</p><ul><li><strong>Projection session interruption</strong><br> → UI falls back to phone without terminating application state</li><li><strong>Glasses disconnection</strong><br> → Android XR runtime preserves session state on the host device</li><li><strong>Input loss (voice/touch unavailable)</strong><br> → System degrades to passive or notification-only mode</li><li><strong>Spatial tracking degradation (ARCore)</strong><br> → UI switches to non-anchored overlay mode</li></ul><p>Design principle:</p><blockquote>Experiences must remain usable even when XR capabilities degrade or partially fail.</blockquote><h4>Conclusion</h4><p>Android XR AI glasses development defines a <strong>projection-based mobile extension model</strong>, where:</p><ul><li>Phone = compute + state</li><li>Glasses = projected UI surface</li><li>XR layer = spatial context (optional)</li></ul><p>Using Jetpack Compose Glimmer and ARCore for Jetpack XR, developers build lightweight, context-aware experiences that extend Android into ambient computing environments.</p><p>The key shift is architectural:</p><blockquote><em>From building apps for screens → to designing systems for real-world presence.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d545496e3d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/building-ai-glasses-experiences-with-android-xr-3d545496e3d1">Building AI Glasses Experiences with Android XR</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Generative AI Software Projects Fail in Production]]></title>
            <link>https://medium.com/kayvan-kaseb/why-generative-ai-software-projects-fail-in-production-93f37e76beb7?source=rss-99c9fac0813d------2</link>
            <guid isPermaLink="false">https://medium.com/p/93f37e76beb7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kayvan Kaseb]]></dc:creator>
            <pubDate>Mon, 11 May 2026 10:09:41 GMT</pubDate>
            <atom:updated>2026-05-11T10:11:18.058Z</atom:updated>
            <content:encoded><![CDATA[<h4>An engineering perspective on reliability, scalability, and operational challenges in real-world AI systems</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8C_ro8XtjFsEMHtOIdhSHw.jpeg" /><figcaption>The picture is provided by <a href="https://unsplash.com/photos/person-holding-purple-and-white-card-OXmym9cuaEY">Unsplash</a></figcaption></figure><h4>Abstract</h4><p>Generative AI is becoming an important part of modern software engineering, enabling organizations to improve automation, productivity, and operational efficiency. However, many generative AI projects face significant challenges after deployment, particularly in areas such as system reliability, scalability, security, and integration with existing enterprise infrastructure. Unlike traditional software systems, generative AI applications introduce unpredictable behavior, evolving model performance, and complex operational dependencies that require new engineering approaches and continuous oversight. In many cases, organisations focus primarily on model capabilities while overlooking critical operational concerns such as monitoring, testing, lifecycle management, and infrastructure readiness. As a result, operational and engineering challenges have become a major reason why many AI initiatives struggle to achieve long-term success in production environments. This article aims to discuss the key operational factors that contribute to the failure of generative AI software projects and examine practical engineering approaches that can support more reliable and sustainable AI system delivery.</p><h4>Introduction</h4><p>Artificial Intelligence has become increasingly important in project management, especially within software engineering, as systems grow more complex and data-driven. Over time, it has shifted from a supporting tool for tasks like estimation and scheduling to a core driver of automation, efficiency, and decision-making. In modern software projects, AI helps teams manage complexity, improve productivity, and accelerate delivery across the development lifecycle. The rise of generative AI has further strengthened this role by enabling capabilities such as code generation, documentation support, and workflow automation. As a result, AI is now a key factor in how software projects are planned, executed, and optimized in practice. While many companies successfully develop prototypes and demonstrations, far fewer manage to operate generative AI systems reliably in production environments.</p><p>The primary reason is that most failures are not caused by the AI model itself. They occur at the operational level.</p><p>Many organisations underestimate the engineering complexity required to deploy and maintain AI systems at scale. Unlike traditional software, generative AI systems are probabilistic, data-dependent, continuously evolving, and operationally unpredictable. As a result, software engineering teams often encounter reliability, scalability, integration, security, and maintenance problems that traditional development approaches are not designed to handle.</p><p>A generative AI application may perform well during testing yet fail in production because:</p><ul><li>outputs become inconsistent,</li><li>infrastructure costs escalate,</li><li>APIs become unreliable,</li><li>hallucinations affect users,</li><li>or operational monitoring is insufficient.</li></ul><p>The challenge is therefore not simply building AI systems, but operating them safely, reliably, and sustainably within real software environments.</p><p>This article examines why generative AI software projects fail operationally and outlines practical engineering strategies teams can use to improve long-term success.</p><h4>1. Treating AI Projects Like Traditional Software Projects</h4><p>One of the most common operational mistakes is managing generative AI systems as if they behave like conventional deterministic software.</p><p>Traditional applications typically produce predictable outputs:</p><ul><li>the same input produces the same result,</li><li>business rules are explicitly coded,</li><li>and testing outcomes are stable.</li></ul><p>Generative AI systems behave differently. Outputs vary based on:</p><ul><li>prompts,</li><li>model behaviour,</li><li>training data,</li><li>system context,</li><li>and inference conditions.</li></ul><p>This creates operational uncertainty.</p><p>For example, an AI-powered customer support assistant may:</p><ul><li>provide accurate responses most of the time,</li><li>but occasionally generate misleading or fabricated information that bypasses standard validation processes.</li></ul><p>Engineering teams that rely solely on traditional testing and deployment approaches often discover these failures only after production release.</p><h4>Practical Engineering Response</h4><p>Teams should treat generative AI systems as continuously evolving operational services rather than static software products.</p><p>This requires:</p><ul><li>continuous monitoring,</li><li>iterative validation,</li><li>operational oversight,</li><li>and controlled deployment strategies.</li></ul><p>Successful AI projects operate more like managed production ecosystems than conventional software releases.</p><h4>2. Weak Integration with Existing Enterprise Systems</h4><p>Many AI projects fail because organisations focus heavily on the AI model while ignoring surrounding infrastructure.</p><p>In production environments, generative AI systems must interact with:</p><ul><li>legacy databases,</li><li>internal APIs,</li><li>authentication systems,</li><li>workflow engines,</li><li>enterprise applications,</li><li>and real-time operational data.</li></ul><p>Legacy systems often lack:</p><ul><li>scalable APIs,</li><li>modern security controls,</li><li>cloud-native architecture,</li><li>or real-time processing capabilities.</li></ul><p>As a result:</p><ul><li>AI responses become outdated,</li><li>integrations fail under load,</li><li>or operational latency increases significantly.</li></ul><h4>Practical Example</h4><p>A support chatbot connected to outdated internal documentation systems may provide inaccurate answers because:</p><ul><li>knowledge repositories are not synchronised,</li><li>APIs respond slowly,</li><li>or enterprise data pipelines cannot support real-time retrieval.</li></ul><p>The AI model itself may function correctly, but the surrounding operational architecture fails.</p><h4>Practical Engineering Response</h4><p>Engineering teams should:</p><ul><li>conduct infrastructure readiness assessments early,</li><li>introduce middleware layers,</li><li>isolate AI services through APIs,</li><li>and modernise integration points incrementally rather than attempting large-scale system replacement.</li></ul><p>Operational reliability depends more on surrounding architecture than model sophistication alone.</p><h4>3. Lack of Operational Monitoring and Observability</h4><p>Traditional software monitoring focuses on:</p><ul><li>uptime,</li><li>response latency,</li><li>CPU usage,</li><li>and infrastructure availability.</li></ul><p>Generative AI systems require additional operational visibility.</p><p>Without observability, engineering teams cannot detect:</p><ul><li>hallucinations,</li><li>prompt failures,</li><li>output degradation,</li><li>bias patterns,</li><li>or abnormal model behaviour.</li></ul><p>This becomes especially dangerous in enterprise environments where AI-generated outputs directly influence users or operational decisions.</p><h4>Practical Example</h4><p>An AI-powered code assistant may begin generating insecure authentication logic after a model update. Standard infrastructure monitoring may show all systems operating normally while the actual application quality deteriorates silently.</p><h4>Practical Engineering Response</h4><p>Engineering teams should implement AI-specific observability mechanisms such as:</p><ul><li>prompt tracing,</li><li>output quality monitoring,</li><li>hallucination tracking,</li><li>user feedback collection,</li><li>confidence scoring,</li><li>and anomaly detection.</li></ul><p>AI systems should be monitored not only for infrastructure health, but also for behavioral reliability.</p><h4>4. Inadequate Testing Strategies</h4><p>Many companies underestimate how difficult generative AI systems are to test.</p><p>Traditional unit tests cannot fully validate probabilistic outputs. A model may pass technical validation while still producing:</p><ul><li>misleading responses,</li><li>unsafe recommendations,</li><li>insecure code,</li><li>or inconsistent behaviour.</li></ul><p>AI systems also evolve over time, meaning outputs may change even when application code remains unchanged.</p><h4>Practical Example</h4><p>A software development assistant may initially generate secure API logic, but later begin producing vulnerable implementations after:</p><ul><li>prompt modifications,</li><li>model upgrades,</li><li>or training updates.</li></ul><p>Conventional regression tests may fail to detect these behavioural changes.</p><h4>Practical Engineering Response</h4><p>Effective AI testing requires multiple validation layers:</p><ul><li>prompt testing,</li><li>adversarial testing,</li><li>security testing,</li><li>regression evaluation,</li><li>and human review workflows.</li></ul><p>Engineering teams should also maintain benchmark datasets that allow comparison between:</p><ul><li>model versions,</li><li>prompts,</li><li>and deployment environments.</li></ul><p>Testing AI systems is an ongoing operational process rather than a one-time development phase.</p><h4>5. Vendor Dependency and External API Risks</h4><p>Most enterprise AI applications depend heavily on external providers.</p><p>This introduces operational risks including:</p><ul><li>API outages,</li><li>pricing instability,</li><li>rate limiting,</li><li>model deprecation,</li><li>and unpredictable behavioural changes.</li></ul><p>A production system can fail even when internal infrastructure remains healthy.</p><h4>Practical Example</h4><p>An AI-powered enterprise search tool may suddenly experience degraded response quality after a third-party model provider updates its inference behaviour without warning.</p><p>The engineering team may have no direct control over the change.</p><h4>Practical Engineering Response</h4><p>To reduce dependency risks, engineering teams should:</p><ul><li>build provider abstraction layers,</li><li>support multiple AI backends,</li><li>implement fallback mechanisms,</li><li>and avoid tightly coupling business logic to a single vendor ecosystem.</li></ul><p>Operational resilience requires architectural flexibility.</p><h4>6. Poor Cost and Scalability Planning</h4><p>Many AI prototypes perform well during limited testing but fail financially or operationally at scale.</p><p>Generative AI workloads are resource-intensive due to:</p><ul><li>GPU consumption,</li><li>token processing,</li><li>vector retrieval operations,</li><li>and real-time inference demands.</li></ul><p>As user adoption grows:</p><ul><li>infrastructure costs increase rapidly,</li><li>latency becomes unstable,</li><li>and operational performance degrades.</li></ul><h4>Practical Example</h4><p>An AI document assistant may function efficiently for a small internal pilot but become prohibitively expensive once deployed across thousands of enterprise users generating continuous inference requests.</p><h4>Practical Engineering Response</h4><p>Engineering teams should plan scalability from the beginning by:</p><ul><li>implementing usage monitoring,</li><li>optimising inference workloads,</li><li>introducing caching mechanisms,</li><li>controlling token consumption,</li><li>and using autoscaling infrastructure.</li></ul><p>Operational scalability is both a technical and financial engineering challenge.</p><h4>7. Security Vulnerabilities and Prompt Injection</h4><p>Generative AI systems introduce new security attack surfaces that many engineering teams are still learning to manage.</p><p>Common threats include:</p><ul><li>prompt injection attacks,</li><li>sensitive data leakage,</li><li>jailbreak attempts,</li><li>insecure generated code,</li><li>and malicious input manipulation.</li></ul><p>Unlike conventional software vulnerabilities, AI attacks often exploit model behaviour rather than application logic.</p><h4>Practical Example</h4><p>A malicious user may manipulate a chatbot into bypassing safety instructions and revealing confidential operational information embedded within enterprise prompts or internal retrieval systems.</p><h4>Practical Engineering Response</h4><p>Security controls should include:</p><ul><li>strict input validation,</li><li>prompt isolation,</li><li>access restrictions,</li><li>output filtering,</li><li>role-based permissions,</li><li>and AI-specific penetration testing.</li></ul><p>AI systems should be treated as high-risk operational components rather than simple user-facing features.</p><h4>8. Lack of Human Oversight</h4><p>Many companies attempt to automate critical workflows too aggressively.</p><p>Fully autonomous AI systems remain unreliable in many high-risk operational environments.</p><p>Without human oversight:</p><ul><li>hallucinations may propagate unchecked,</li><li>incorrect decisions may be executed automatically,</li><li>and operational failures may escalate rapidly.</li></ul><h4>Practical Example</h4><p>An AI-generated compliance recommendation may appear technically correct while violating internal regulatory requirements that the model cannot fully interpret contextually.</p><h4>Practical Engineering Response</h4><p>Successful engineering teams introduce human-in-the-loop workflows for:</p><ul><li>high-risk decisions,</li><li>approval processes,</li><li>exception handling,</li><li>and sensitive operational actions.</li></ul><p>The goal is not replacing engineers or operators entirely, but augmenting human decision-making safely.</p><h4>Conclusion</h4><p>Generative AI software projects rarely fail because the underlying models are incapable. Most failures occur because organisations underestimate the operational engineering complexity required to deploy AI systems reliably at scale.</p><p>The core challenge is not simply building AI functionality. It is managing:</p><ul><li>reliability,</li><li>infrastructure,</li><li>integration,</li><li>security,</li><li>observability,</li><li>scalability,</li><li>and operational governance continuously after deployment.</li></ul><p>Engineering teams that succeed with generative AI typically treat AI systems as evolving operational platforms rather than isolated software features. They combine:</p><ul><li>disciplined software engineering,</li><li>strong operational monitoring,</li><li>scalable infrastructure,</li><li>security-first architecture,</li><li>and continuous human oversight.</li></ul><p>As generative AI adoption accelerates, organizations that focus on operational resilience rather than short-term experimentation will be better positioned to build reliable, maintainable, and trustworthy AI systems in production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93f37e76beb7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kayvan-kaseb/why-generative-ai-software-projects-fail-in-production-93f37e76beb7">Why Generative AI Software Projects Fail in Production</a> was originally published in <a href="https://medium.com/kayvan-kaseb">Software Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>