<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Blog - Janaka Dombawela]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>https://blog.janaka.tech/</link><image><url>https://blog.janaka.tech/favicon.png</url><title>Blog - Janaka Dombawela</title><link>https://blog.janaka.tech/</link></image><generator>Ghost 3.2</generator><lastBuildDate>Mon, 11 May 2026 10:53:06 GMT</lastBuildDate><atom:link href="https://blog.janaka.tech/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[My thoughts on clean architecture after an year]]></title><description><![CDATA[<p>I have been using the clean architecture by Uncle Bob (Robert C. Martin) for over an year. It is something we use everyday for our development of micro services.</p><h3 id="what-is-clean-architecture">What is clean architecture?</h3><p>Clean architecture is software development concept and practice for separating the business domain with application logic. The</p>]]></description><link>https://blog.janaka.tech/my-thoughts-on-clean-architecture-after-an-year-with-it/</link><guid isPermaLink="false">5ff7f8d70e4438001e124533</guid><category><![CDATA[Tech]]></category><dc:creator><![CDATA[Janaka Dombawela]]></dc:creator><pubDate>Mon, 25 Oct 2021 03:42:21 GMT</pubDate><media:content url="https://res-1.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/luca-bravo-XJXWbfSo2f0-unsplash.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://res-1.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/luca-bravo-XJXWbfSo2f0-unsplash.jpg" alt="My thoughts on clean architecture after an year"><p>I have been using the clean architecture by Uncle Bob (Robert C. Martin) for over an year. It is something we use everyday for our development of micro services.</p><h3 id="what-is-clean-architecture">What is clean architecture?</h3><p>Clean architecture is software development concept and practice for separating the business domain with application logic. The idea behind this is that the business logic rarely changes while the application logic and the other external entities of the application might change over the time.<br>There are three different sections in clean architecture. Those are the business logic, application logic and external entities (such as 3rd party APIs, databases and other libraries).<br>If there is a change requirement for application or external entities, clean architecture will help to keep the existing business logic intact while you can make any changes to the other sections. Clean architecture also helps to write strong unit tests to business logic expecting it to pass every time other section is changing (given that business logic does not change over time)<br>Clean architecture uses other practices such as dependency inversion from SOLID.</p><h3 id="how-we-do-it">How we do it</h3><p>On our organization we use our own approach for the practice. We load the external entities as class instances and inject them into the business logic at the constructor. The business logic can work on their own as long as dependencies fulfill their duty as constructor parameters.<br>Usually the business logic works on its own even with the drastic changes like database change or changing the application framework entirely(like changing entire database from MySQL to MongoDB).<br> I'm not going to jump onto code level stuff, so I will stop it here.</p><h3 id="pros">Pros</h3><p>I am not here to show you how to do clean architecture and stuff, but to give my experience about it. There are couple of practical pros we experienced the throughout our development phases. Some of them are:<br><br>1. <strong>Maintainable solid clean code base</strong><br>We know the structure of the code base, where does the database connections, API calls, repositories, adapters, controllers and models resides. We know how each of the above terms connects and communicates with each other. We know if something is in the wrong place. In other words we know which goes where, when and which. All thanks to clean architecture enforcement. This ease up the effort of code reviews and quality standards.<br><br>2. <strong>We have lot of reusable components</strong><br>Since clean architecture separates external entities, we have lot of components such as adapters at our disposal that we don't have to write again.</p><h3 id="cons">Cons</h3><p>Unfortunately I see lot of Cons instead of Pros in this manner. Let me note down the disadvantages of clean architecture</p><ol><li><strong>Lot of boilerplate code</strong><br>Unfortunately to get up and running a clean architecture you need to write lot of boiler plate code. When comparing to picking up a MVC vs using clean architecture on top of a framework, clean architecture requires lot of pre programming before actually implementing something.</li><li><strong>There are no IDE voodoo magic</strong><br>I could not find any plugin to VS code or JetBrains IDEs that support clean architecture apart from directory structure generation. The support we get for well-known frameworks and libraries are awesome. But there are no such support for clean architecture.</li><li><strong>Clean architecture works best with some specific use cases</strong><br>Well, certainly it is not the swiss army knife of programming paradigm. There are lot of scenarios where we can safely build without using clean architecture. The whole idea of "business logic rarely changes" is not applicable to all the problems.</li><li><strong>Technology evolves so fast that maintainable code base is not actually worth it</strong><br>This is very personal opinion of mine, so take it with grain of salt. But there are lot of discussions built around this (Ex: Apple phones and Nokia phones, 2001 vs 2021). I personally believe any system that we build today will be a legacy system after the next 5 years. So we need to reengineer it to keep it up to date with the latest technology. With that, rapidly developed working software is more important than maintainable, debt-free code base.</li></ol><h3 id="conclusion">Conclusion</h3><p>Will I use clean architecture in the future? Yes, but not for everything. It actually depends on the requirement and its factors like scalability and size of the scope.</p><p>But I would not use if for all the applications that I would build in the future.</p>]]></content:encoded></item><item><title><![CDATA[Blogs and the Ghost]]></title><description><![CDATA[<h3 id="blogs"><strong>Blogs</strong></h3><p>A blog is a collection of articles that appear on a website. These articles can be anything. Majority of the blogs pick a subject and most of its articles stick to that subject. Most take the form of a diary or a journal which records the date it was</p>]]></description><link>https://blog.janaka.tech/blogs-and-the-ghost/</link><guid isPermaLink="false">5ecba0200866d5001e4314d2</guid><category><![CDATA[Tech]]></category><dc:creator><![CDATA[Janaka Dombawela]]></dc:creator><pubDate>Fri, 29 May 2020 10:09:56 GMT</pubDate><media:content url="https://res-4.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/thought-catalog-505eectW54k-unsplash.jpg" medium="image"/><content:encoded><![CDATA[<h3 id="blogs"><strong>Blogs</strong></h3><img src="https://res-4.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/thought-catalog-505eectW54k-unsplash.jpg" alt="Blogs and the Ghost"><p>A blog is a collection of articles that appear on a website. These articles can be anything. Majority of the blogs pick a subject and most of its articles stick to that subject. Most take the form of a diary or a journal which records the date it was published and walk through writers’ experiences.</p><h3 id="blog-vs-cms"><strong>Blog vs. CMS</strong></h3><p>CMS stands for content management system. Those are built for people who do not want to develop a website on their own. They can simply grab a CMS, install it and update its content while changing the look and feel with a graphical user interface. A blog can reside inside the content managed website, as the CMSs can facilitate the blog as well.</p><p>But some people want a blog only. Since CMSs provides an easy to use interface and a lot of community support, people stick to CMSs even if they want just a blog.</p><figure class="kg-card kg-image-card"><img src="https://res-3.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/green-chameleon-s9CC2SKySJM-unsplash.jpg" class="kg-image" alt="Blogs and the Ghost"></figure><h3 id="cmss"><strong>CMSs</strong></h3><p>The most common CM systems today are WordPress, Joomla and Drupal. All of these are written in PHP. They are well known for having huge community support which includes plenty of themes and plugins to turn a CMS into an ecommerce website or a booking engine.</p><p>There are free hosted solutions too. Such as Blogger, Tumblr and WordPress.</p><p>Selecting a CMS framework for blog site development is a bit complicated as most of them have different approaches even though all of them do the same thing. I was a wordpress developer some time ago. It was a very tedious process to develop a wordpress website because wordpress deviated from most of the software development practices today. For example wordpress does not adapt common database modelling patterns. It has its own database structure and it is not easy to use as a traditional relational database approach. And most importantly it does not have taken the object oriented approach seriously.</p><p>Drupal on the other hand has the most complex workflow. You have to create placeholders and views to accommodate custom theme code.</p><h3 id="ghost"><strong>Ghost</strong></h3><p>Ghost is a CMS written in Node.JS. Currently it's in third version. Ghost is identified as headless CMS, which means that you can have your own application for the front end while Ghost handles the data.</p><h3 id="why-ghost"><strong>Why Ghost?</strong></h3><p>Ghost is the most popular Node.JS CMS solution and I love Node.JS. It has a cleaner codebase than other CMS software. It’s fast, reliable and very flexible. That's why I picked it. <br></p><p>Feel free to comment what you think below.</p>]]></content:encoded></item><item><title><![CDATA[How to make a simple portfolio website]]></title><description><![CDATA[<p>Creating your own portfolio is beneficial in many ways. With a good portfolio you can show off your skills while showcasing your creativity.</p><p>I created my portfolio in three days (around twenty hours). I will guide through the process of creating the website. You can see the website <a href="http://www.janaka.tech">here</a>.</p><h2 id="tldr-source-github">TLDR;</h2>]]></description><link>https://blog.janaka.tech/how-to-make-a-simple-portfolio/</link><guid isPermaLink="false">5ec539e222aaa9001eefa74d</guid><category><![CDATA[Walkthroughs]]></category><dc:creator><![CDATA[Janaka Dombawela]]></dc:creator><pubDate>Fri, 22 May 2020 03:48:02 GMT</pubDate><media:content url="https://res-5.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/main.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://res-5.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/main.jpg" alt="How to make a simple portfolio website"><p>Creating your own portfolio is beneficial in many ways. With a good portfolio you can show off your skills while showcasing your creativity.</p><p>I created my portfolio in three days (around twenty hours). I will guide through the process of creating the website. You can see the website <a href="http://www.janaka.tech">here</a>.</p><h2 id="tldr-source-github">TLDR; Source:<a href="https://github.com/janakad/portfolio-template"> Github</a></h2><p></p><p>First thing I did was listing down sections and pages I was hoping to put. I went with the home page, about me page and contact me page. (I added a blog, but that comes later). My home page has the following sections except header and footer.<br></p><ul><li>Hero section</li><li>Introduction</li><li>Experiences</li><li>Skills</li><li>Projects</li><li>Contact information<br></li></ul><p>The About me page contains simple text. Contact me page has two sections. Description and contact form. For this template I left form action blank as you can decide how to manage the form action.</p><p>Then I sketched how those sections were going to line up on the page. I like to have a constant color scheme. So I selected four colors. Which are the main colors of Dota 2. I just went with two font families as I like to keep a minimal look and feel.</p><h3 id="colors-">Colors:<br></h3><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-1.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/untitled.png" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Colors</figcaption></figure><h3 id="fonts-">Fonts:</h3><ul><li>Allerta</li><li>Inconsolata<br></li></ul><p>Finally I decided the tech stack I am going to use. You can see the details below.<br></p><h3 id="main-stack-">Main stack:</h3><ul><li>React.js with react routes, axios and moment.</li><li>Bootstrap as react-bootstrap.</li><li>FontAwesome for icons.</li><li>Animate on scroll for animations.</li><li>SCSS for css.</li></ul><p>I didn’t use any state management library or framework as the functionalities of this website are not that much complicated.</p><p>You can get the files from above <a href="https://github.com/janakad/portfolio-template">github</a>. I will guide what each file does and the purpose of each directory.</p><p>File structure:</p><!--kg-card-begin: markdown--><pre><code>│   .gitignore
│   package.json
│   README.md
│   yarn.lock
│
├───public
│   │   favicon.ico
│   │   index.html
│   │   logo192.png
│   │   logo512.png
│   │   manifest.json
│   │   robots.txt
│   │
│   └───assets
│       └───images
│               logo-small.png
│               logo.png
│               profile-reduced.jpg
│
└───src
    │   App.js
    │   App.test.js
    │   index.js
    │   serviceWorker.js
    │   setupTests.js
    │
    ├───assets
    │   └───css
    │    	   style.css
    │    	   style.css.map
    │    	   style.scss
    │
    ├───Data
    │       Companies.js
    │       Projects.js
    │       Skills.js
    │
    └───View
        ├───Page
        │       About.js
        │       Contact.js
        │       Home.js
        │
        └───Partials
            │   ContactMe.js
            │   Footer.js
            │   Header.js
            │
            ├───Project
            │       SingleProject.js
            │
            ├───SkillBar
            │       SkillBarItem.js
            │
            └───Timeline
                    TimelineBadge.js
                    TimelineItem.js
                    TimelineRow.js
</code></pre>
<!--kg-card-end: markdown--><p>This is a react app created with create-react-app. I used yarn as my package manager.</p><p>The public directory holds the default react files and the images I used for the website.</p><p>The src directory holds all the default source I wrote. First of all I added the style.scss to the assets directory inside src, and imported the generated css file in App.js</p><p>Data directory contains the data objects of the website. It does not require a back end system as the website is not going to hold a lot of information and it won't be updated frequently.</p><p>Inside the view directory there are some sub directories. Page takes care of the skeleton of the home, about and contact pages.</p><p>Partials are commonly used components such as header, footer and contact section. The sub directories inside the Partials are related to templates in the home page. </p><p>The Project has a single project item which is iterated and called on the home page.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-4.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/projects.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Projects view</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-2.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/single-project.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Single Project</figcaption></figure><p>SkillBar and Timeline components function like the single project as well.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-3.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/skills.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Skills view</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-1.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/single-skill.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Single Skill</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-4.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/stories.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Stories view</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://res-3.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/single-story.jpg" class="kg-image" alt="How to make a simple portfolio website"><figcaption>Single story</figcaption></figure><p>So that's it. If you think this is a good portfolio, check the github repository.</p>]]></content:encoded></item><item><title><![CDATA[Hello World.]]></title><description><![CDATA[<p>I am Janaka Dombawela. A full stack developer based in Sri Lanka.</p><p>I just started a blog as part of my portfolio website so I can share my knowledge and thoughts with the world.</p>]]></description><link>https://blog.janaka.tech/hello-world/</link><guid isPermaLink="false">5ec39da429c2cf001edd464c</guid><category><![CDATA[Random]]></category><dc:creator><![CDATA[Janaka Dombawela]]></dc:creator><pubDate>Tue, 19 May 2020 08:50:52 GMT</pubDate><media:content url="https://res-3.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/andrew-neel-K7JEYFDictM-unsplash--1-.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://res-3.cloudinary.com/hfiunu10y/image/upload/q_auto/v1/ghost-blog-images/andrew-neel-K7JEYFDictM-unsplash--1-.jpg" alt="Hello World."><p>I am Janaka Dombawela. A full stack developer based in Sri Lanka.</p><p>I just started a blog as part of my portfolio website so I can share my knowledge and thoughts with the world.</p>]]></content:encoded></item></channel></rss>