<?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 Dewni Samarakoon on Medium]]></title>
        <description><![CDATA[Stories by Dewni Samarakoon on Medium]]></description>
        <link>https://medium.com/@thakshilad2018?source=rss-85882c630668------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YFnKYbglJbD6DX4drjrSAA.jpeg</url>
            <title>Stories by Dewni Samarakoon on Medium</title>
            <link>https://medium.com/@thakshilad2018?source=rss-85882c630668------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:35:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thakshilad2018/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[What is Clean Architecture?]]></title>
            <link>https://medium.com/@thakshilad2018/what-is-clean-architecture-07b1da8e3cf8?source=rss-85882c630668------2</link>
            <guid isPermaLink="false">https://medium.com/p/07b1da8e3cf8</guid>
            <dc:creator><![CDATA[Dewni Samarakoon]]></dc:creator>
            <pubDate>Tue, 20 May 2025 06:29:18 GMT</pubDate>
            <atom:updated>2025-05-20T06:29:18.818Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Clean Architecture</strong> is a software design philosophy introduced by <strong>Robert C. Martin (Uncle Bob)</strong> that promotes a separation of concerns, making systems <strong>independent of frameworks, databases, UIs, and external agencies</strong>. The goal is to <strong>make code more maintainable, testable, and adaptable to change</strong> over time.</p><p>It is often illustrated as a series of concentric circles, each representing a different layer of the application, with dependencies only pointing <strong>inward</strong>.</p><h3>Core Goals of Clean Architecture</h3><ul><li>Independence from UI frameworks (e.g., Angular, React)</li><li>Independence from databases (e.g., SQL, MongoDB)</li><li>Independence from external services or tools</li><li>Testability at every level of the system</li><li>Clear separation of business rules from delivery mechanisms</li></ul><h3>Key Principles</h3><ol><li><strong>Separation of Concerns</strong><br> Keep the system’s business logic isolated from presentation, persistence, and infrastructure.</li><li><strong>Dependency Rule</strong><br> <strong>Source code dependencies must always point inward</strong>. Inner layers shouldn’t depend on outer layers.</li><li><strong>SOLID Principles</strong><br> Clean Architecture adheres to the SOLID principles:</li></ol><ul><li>S: Single Responsibility</li><li>O: Open/Closed</li><li>L: Liskov Substitution</li><li>I: Interface Segregation</li><li>D: Dependency Inversion</li></ul><h3>Clean Architecture Layers (Concentric Circles)</h3><h3>1. Entities (Enterprise Business Rules)</h3><ul><li><strong>Core layer</strong> with high-level business rules</li><li>Contains enterprise-wide rules (e.g., User, Invoice)</li><li>Independent of frameworks and technologies</li></ul><blockquote><em>Example: </em><em>User, </em><em>Order, </em><em>Product with logic like &quot;an order cannot exceed $5000&quot;</em></blockquote><h3>2. Use Cases (Application Business Rules)</h3><ul><li>Contains application-specific rules and workflows</li><li>Orchestrates entities to solve problems</li><li>Knows nothing about UI, DB, or frameworks</li></ul><blockquote><em>Example: </em><em>CreateOrderUseCase, </em><em>LoginUserUseCase</em></blockquote><h3>3. Interface Adapters</h3><ul><li>Contains controllers, gateways, and presenters</li><li>Converts data from external layers into formats the use cases understand</li><li>Implements interfaces defined in inner layers</li></ul><blockquote><em>Example: </em><em>OrderController, </em><em>UserPresenter, </em><em>UserRepositoryImpl</em></blockquote><h3>4. Frameworks and Drivers (Infrastructure Layer)</h3><ul><li>Outer layer with actual implementations of DBs, web frameworks, UI, etc.</li><li>Examples: MySQL, Django, Spring, REST APIs</li></ul><blockquote><em>Example: A REST controller that accepts user login and calls the use case</em></blockquote><h3>Flow of Control</h3><ul><li>The <strong>control flows inward</strong> from UI → Interface Adapters → Use Cases → Entities</li><li><strong>Dependencies go only inwards</strong>, allowing flexibility and testability</li></ul><h3>Example in Real Life (Login Feature)</h3><ul><li><strong>Entities</strong>: User</li><li><strong>Use Case</strong>: LoginUserUseCase</li><li><strong>Interface Adapter</strong>: UserController and UserRepositoryImpl</li><li><strong>Framework Layer</strong>: REST API with Spring Boot or Express.js</li></ul><p>Here, the UI layer calls the controller, which calls the use case, which uses the User entity. All database calls are handled via interfaces, so the logic is decoupled from persistence.</p><h3>Benefits of Clean Architecture</h3><ul><li><strong>Independent Deployability</strong>: Changes in UI/DB won’t affect business logic.</li><li><strong>Testability</strong>: Easy to test core logic without UI or DB.</li><li><strong>Maintainability</strong>: Each part of the system has a clear responsibility.</li><li><strong>Flexibility</strong>: Easy to switch UI or database technology.</li><li><strong>Reusability</strong>: Business logic can be reused across different interfaces (Web, Mobile, CLI).</li></ul><h3>Criticisms &amp; Challenges</h3><p><strong>Initial Complexity</strong>: Overhead in smaller projects.</p><p><strong>Overengineering Risk</strong>: Might be too much for simple CRUD applications.</p><p><strong>Learning Curve</strong>: Requires a good understanding of abstraction and interfaces.</p><h3>Best Use Cases</h3><ul><li>Large-scale enterprise applications</li><li>Systems expected to evolve over time</li><li>Applications requiring long-term maintainability and testability</li></ul><h3>Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*XeW_k3izOlx10AhrHX6x9Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07b1da8e3cf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering Sri Lanka’s Small-Scale Farmers with Open-Source Innovation]]></title>
            <link>https://medium.com/@thakshilad2018/empowering-sri-lankas-small-scale-farmers-with-open-source-innovation-a8cfa506d2be?source=rss-85882c630668------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8cfa506d2be</guid>
            <dc:creator><![CDATA[Dewni Samarakoon]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 16:22:02 GMT</pubDate>
            <atom:updated>2025-01-29T16:22:02.663Z</atom:updated>
            <content:encoded><![CDATA[<p>Agriculture is the backbone of Sri Lanka’s economy, employing nearly 27% of the workforce and contributing significantly to the country’s GDP. However, small-scale farmers, who make up the majority of this sector, continue to face critical challenges that hinder their productivity and income. Unlike large-scale farmers, who receive technological support from corporate agribusinesses , small-scale farmers often lack access to real-time data, crop insights, and weather forecasts that are crucial for decision-making.</p><p>To bridge this gap, <strong>AgriSense</strong> is designed specifically for Sri Lanka’s small-scale farmers, providing them with affordable, technology-driven solutions to improve their crop choices, mitigate risks, and adapt to changing weather patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dKqr0IeUKfEPW7g9DzOWQ.png" /></figure><h3>Challenges Faced by Small-Scale Farmers in Sri Lanka</h3><p>Smallholder farmers in Sri Lanka (those cultivating less than 2 hectares of land) struggle with:</p><p>1. Lack of Accurate Crop Recommendations</p><p>Many small farmers rely on traditional knowledge or word-of-mouth advice to choose which crops to plant. While this experience is valuable, it does not always align with changing climate conditions, soil fertility, or market demand. As a result, farmers may invest time and resources into growing crops that are less profitable or unsuitable for their region.</p><p>2. Unpredictable Weather and Climate Risks</p><p>Sri Lanka has a monsoon-based climate, making small-scale farmers highly vulnerable to droughts, floods, and unexpected rainfall patterns. Without real-time weather forecasts, farmers may struggle to plan planting, irrigation, and harvesting schedules, leading to crop failures and income losses. Large agribusinesses have access to high-end weather tracking systems, but small farmers rely on local radio broadcasts or traditional weather observations, which are often insufficient.</p><p>3. Limited Access to Digital Agricultural Tools</p><p>Most existing smart farming solutions in Sri Lanka are designed for large-scale agribusinesses or export-oriented farms. Solutions like precision agriculture tools, satellite imaging, and AI-driven analytics are too expensive or complex for small-scale farmers who lack digital literacy.</p><p>4. Market and Price Fluctuations</p><p>Even when small farmers grow suitable crops, they often lack access to real-time market prices or demand insights, leading them to sell their produce at low profits. They have little control over pricing and must rely on middlemen who often take advantage of their lack of market awareness.</p><h3>The Solution Tailored for Sri Lanka’s Small Farmers</h3><p><strong>AgriSense</strong> is an open-source web application that directly addresses these issues by providing crop recommendations and weather-based insights in a simple, user-friendly format. Unlike high-tech solutions designed for industrial-scale farming, <strong>AgriSense</strong> focuses on smallholder farmers who need practical and accessible tools.</p><h3>How AgriSense Helps Small Farmers in Sri Lanka</h3><p>✅ Crop Recommendations Based on Location &amp; Climate</p><ul><li>Farmers can select their region using a dropdown menu.</li><li>The system suggests best crops based on climate data, soil type, and historical agricultural trends.</li><li>This helps farmers grow crops that are better suited for their land, improving yields and reducing losses.</li></ul><p>✅ Weather Forecasts &amp; Alerts</p><p>Integrates the OpenWeatherMap API to provide:</p><ul><li>Real-time weather updates.</li><li>7-day weather forecasts to help farmers plan ahead.</li><li>Extreme weather alerts (e.g., heavy rain, drought risks) to minimize losses.</li></ul><p>This ensures that farmers are prepared for climate variations and can adjust their farming activities accordingly.</p><p>✅ Simple, User-Friendly Dashboard</p><ul><li>Displays crop suggestions, weather data, and farming insights in a clear and understandable format.</li><li>Unlike complex agricultural apps, <strong>AgriSense</strong> is designed to be easy to use, even for farmers with limited digital experience.</li></ul><p>✅ Lightweight, Low-Cost, and Open-Source</p><ul><li>Developed with ASP.NET Core (Backend) and Blazor (Frontend), making it efficient and scalable.</li><li>Uses a small SQLite database or a CSV file, making it affordable and accessible even in rural areas with limited internet connectivity.</li><li>Completely open-source, meaning that developers and agricultural experts can collaborate, improve, and expand the platform.</li></ul><h3>Why Focus on Small-Scale Farmers?</h3><p>Most Agritech innovations in Sri Lanka cater to large-scale, export-driven farms, supported by corporate agribusinesses. While these businesses benefit from AI-driven precision agriculture, smallholder farmers are often left behind due to cost barriers and technological limitations.</p><p>By focusing exclusively on small-scale farmers, <strong>AgriSense</strong> ensures that affordable, practical, and region-specific solutions are available to the farmers who need them the most.</p><h3>Key Benefits for Small Farmers in Sri Lanka</h3><ul><li>Increases profitability by recommending crops that grow well in their specific region.</li><li>Reduces risks associated with unpredictable weather patterns.</li><li>Bridges the technology gap by providing a simple and accessible tool.</li><li>Encourages sustainable agriculture by promoting climate-resilient crop choices.</li></ul><h3>Future Enhancements</h3><p><strong>AgriSense</strong> is just the beginning. The platform is designed to evolve with additional features such as:</p><p>🔹 Yield Predictions Using AI — Helping farmers estimate expected harvest quantities.<br> 🔹 Mobile App Version — Making <strong>AgriSense</strong> even more accessible to rural farmers.<br> 🔹 Market Price Integration — Showing real-time crop prices to improve sales decisions.<br> 🔹 Soil Quality &amp; Pest Analysis — Expanding beyond weather data to include AI-powered soil health monitoring.</p><h3>Join the AgriSense Movement!</h3><p>We believe that technology should empower every farmer, not just large agribusinesses. By making <strong>AgriSense</strong> open-source, we invite developers, agricultural researchers, and NGOs to contribute and help build a smarter future for small-scale farmers in Sri Lanka.</p><p>👩‍🌾 Are you a farmer? Try AgriSense and share your feedback!<br> 🌱 Are you passionate about agriculture? Join us in scaling this initiative!</p><p>🌾 Let’s empower Sri Lanka’s farmers with <strong>AgriSense</strong>. Together, we can cultivate a brighter future! 🌱</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8cfa506d2be" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>