<?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 Kaushal Shubhank on Medium]]></title>
        <description><![CDATA[Stories by Kaushal Shubhank on Medium]]></description>
        <link>https://medium.com/@KaushalShubhank?source=rss-7f6d7b9f105b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GGI5J2YThMLeo9sm.jpeg</url>
            <title>Stories by Kaushal Shubhank on Medium</title>
            <link>https://medium.com/@KaushalShubhank?source=rss-7f6d7b9f105b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:43:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@KaushalShubhank/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[God speaks to us in various ways… we should know how to parse all of it]]></title>
            <link>https://medium.com/roposo-engineering/god-speaks-to-us-in-various-ways-we-should-know-how-to-parse-all-of-it-1d6d207d532a?source=rss-7f6d7b9f105b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d6d207d532a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Kaushal Shubhank]]></dc:creator>
            <pubDate>Tue, 30 May 2017 09:30:45 GMT</pubDate>
            <atom:updated>2017-05-30T17:12:17.397Z</atom:updated>
            <content:encoded><![CDATA[<p>As we have been discussing in our posts, we have so far built the server side of Roposo with Play Framework. In the beginning, we were using the Scala templates for front end and we hadn’t yet launched our mobile apps.</p><p>So guess what, NO APIs! All the html was formed in backend and sent across to browsers.</p><p>We started working on APIs when we started developing our android app. We thought of different approaches that would help us follow best practices in API development. At the time, we had only two people developing the app (one of them being a founder). So any time spent on repetitive things was very costly.</p><p>The idea of individual visual cards that bunched together make a screen was picking up. Most android apps had implemented modular and consistent design with <a href="https://material.io/guidelines/components/cards.html#cards-usage">cards</a>.</p><p>We couldn’t, however, find examples of apps that were using a modular card-like way of sending card information in the backend APIs.</p><p>When sending data for these cards, we wanted our app to be able to simply draw infinite types of screens with infinite cards instead of treating different screens as totally different views that had to be put together. We wanted to be able to draw an array of cards on different types of views without any extra effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2yEkbGD41FW4KxQCiQQPg.jpeg" /></figure><p><em>The API examples that we saw at the time could be categorised in two :</em></p><ol><li><em>The app knew what cards were to be drawn on a given screen. All the data for a screen was being sent in one API call. The app drew cards after picking the required information from such API calls.</em></li><li><em>The app knew what cards were to be drawn on a given screen. Data for different cards was being sent in different API calls. The app drew cards sequentially after getting data from different APIs.</em></li></ol><p><em>The common problem with both these approaches was that the app needed to be aware of the structure of the screen. So any change in the arrangement of cards was only possible with changes in the app. We wanted the control to be with backend, so we could try different things in one release and also personalize views for users.</em></p><p>We decided to make JSON blocks for every card type. These blocks contained all the data that would be required to draw that card.</p><p>The response to draw the above screen would be something like this:</p><pre>{<br>  &quot;blocks&quot;: [<br>    {<br>      &quot;title&quot;: &quot;Superhero #OOTW&quot;,<br>      &quot;creator&quot;: {&quot;n&quot;: &quot;Batman&quot;, &quot;alias&quot;: &quot;Bruce Wayne&quot;}<br>    },<br>    {<br>      &quot;title&quot;: &quot;a&quot;,<br>      &quot;creator&quot;: {&quot;n&quot;: &quot;Batman&quot;, &quot;alias&quot;: &quot;Bruce Wayne&quot;}<br>    }<br>  ],<br>  &quot;next&quot;: &quot;/featured?start=2&amp;count=2&quot;<br>}</pre><p>As we can see in the example above, there are two batmen (but at one time, like God there should be only one batman). With bigger responses, there was a lot of repetition. To optimize this, we broke the blocks into a dictionary kind of formation — <em>blocks</em> and <em>det — blocks keep the keys of the cards in a sorted fashion and det are the details for that key. </em>The response would become something like this.</p><pre>{<br>  &quot;blocks&quot;: [<br>    {<br>      &quot;title&quot;: &quot;Superhero #OOTW&quot;,<br>      &quot;creator&quot;: &quot;ID&quot;<br>    },<br>    {<br>      &quot;title&quot;: &quot;a&quot;,<br>      &quot;creator&quot;: &quot;ID&quot;<br>    }<br>  ],<br>  &quot;det&quot;: {&quot;ID&quot;: {&quot;n&quot;: &quot;Batman&quot;, &quot;alias&quot;: &quot;Bruce Wayne&quot;}},<br>  &quot;next&quot;: &quot;/featured?start=2&amp;count=2&quot;<br>}</pre><p>We modified everything to send similar responses to all APIs.</p><p>A bitter-sweet moment came when we saw our <em>feed</em> coming in our <em>shop </em>section! Happened because of a stupid bug where responses were being overwritten across two controllers (epic fail). But our feed worked flawlessly with infinite scroll and ATM (all time modifiable) views ;).</p><p>We also modified our tabs APIs to make them modifiable without app releases. Any response could give information about tabs, details about each tab and flag for the current tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAyAXFeJf1qI4Hq43gxpJA.png" /><figcaption>Tabs in the Profile View</figcaption></figure><p>We optimized this further by sending the data in <em>det-blocks</em> for the current tab to save an API call. It was now effortless to create a tabbed view within a view based on the response.</p><pre>{<br>  &quot;ontab&quot;: 1,<br>  &quot;tabs&quot;: [<br>    {<br>      &quot;link&quot;: &quot;/url/to/posts&quot;,<br>      &quot;title&quot;: &quot;Posts&quot;<br>    },<br>    {<br>      &quot;link&quot;: &quot;/url/to/reposts&quot;,<br>      &quot;title&quot;: &quot;Reposts&quot;<br>    },<br>    {<br>      &quot;link&quot;: &quot;/url/to/activities&quot;,<br>      &quot;title&quot;: &quot;Activities&quot;<br>    },<br>    {<br>      &quot;link&quot;: &quot;/url/to/lists&quot;,<br>      &quot;title&quot;: &quot;Lists&quot;<br>    },<br>    {<br>      &quot;link&quot;: &quot;/url/to/liked/posts&quot;,<br>      &quot;title&quot;: &quot;Likes&quot;<br>    }<br>  ]<br>}</pre><p>We recently introduced Roposo chat via XMPP. Guess what, the responses (or messages) follow our dictionary <em>det-block</em> pattern as well. So we can send any kind of view cards not only through http APIs, but also XMPP messages and push notifications!</p><h4>Days of future past</h4><p>We are now planning to send commands, status, other meta via these blocks of information in addition to viewable cards. For example, a message or response could be sent to the app to refresh feed (which may not be the current view of the user) and notifies the user of the availability of the new content.</p><p>We could send such messages bundled with some other API’s response. For example, in the response for one profile’s data, we could slip in a block (that the app knows is a non-viewable command-block) and avoid extra chatter between the app and backend server.</p><p>In conclusion, this approach has helped us in A/B testing and increased efficiency in app development. With very little effort, we can create a generic app that needs to be told only the first API to hit and can then draw multiple complex screens from a combination of very few types of cards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d6d207d532a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roposo-engineering/god-speaks-to-us-in-various-ways-we-should-know-how-to-parse-all-of-it-1d6d207d532a">God speaks to us in various ways… we should know how to parse all of it</a> was originally published in <a href="https://medium.com/roposo-engineering">Roposo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Plug and Play]]></title>
            <link>https://medium.com/roposo-engineering/plug-and-play-26ca06c6bf22?source=rss-7f6d7b9f105b------2</link>
            <guid isPermaLink="false">https://medium.com/p/26ca06c6bf22</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[play-framework]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Kaushal Shubhank]]></dc:creator>
            <pubDate>Wed, 26 Apr 2017 12:56:55 GMT</pubDate>
            <atom:updated>2017-04-26T12:58:02.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b359xifQJT8hcjBBrVLffw.jpeg" /></figure><p>So here we are with our next tech blog just one week (plus one year) after our <a href="https://medium.com/roposo-engineering/skeleton-first-muscles-later-6786acab37b0">first one</a>.</p><p>We mentioned earlier that Play Framework is the calcium for our architecture skeleton. This time, we will dive deeper into how Play has been enabling us to build the Roposo that our users have come to love so much.</p><p>When choosing a framework, two years back, we <em>oscillated</em> over the idea of Spring for a while, but we were soon <em>game</em> with the idea of Play (feel the puns?). There are hundreds of comparisons and suggestions on which java framework to use. But we were just starting up — the anti-establishment hormone was pumping in our blood and Play felt just right.</p><p>Play Framework 1.2.4 had everything we needed at the time. It had easy DB access, mailer module, press modules for CSS, JS minification and obfuscation. We were also building a monilithic application for <a href="https://www.giveter.com/">Giveter</a> and Play supported us completely.</p><blockquote>The swiftness with which we were able to start from scratch and went full throttle on developing our application reminded us of the good mid-90s when Jayasuriya and Kaluwitharana used to rocket launch Sri Lankan innings.</blockquote><p>As <a href="https://www.roposo.com/">Roposo</a> grew, we had to build more components: notifications, image processing, recommendation and search. Play 2.2 was released around that time and it was again a perfect fit. The framework was now leaner and SBT helps us with different maven dependencies for different modules seamlessly while being lighter than maven.</p><p>Over the course of time we worked with different IDEs: Eclipse which was <em>shadowed</em> by Netbeans which was eventually <em>outsmarted</em> by Intellij; and Play Framework modules were very easily setup with all of them.</p><p>Our love for the exotic functional language paradigm also biased us towards Play, as we can interchangeably use scala or java in the same application. So few controllers have been written utilizing the functionalities of scala.</p><p>There are various other handy functionalities in Play 2.2 that make it great. Listing down a few that have been particularly helpful :</p><h4>Routes</h4><p>The routes read each incoming HTTP request and direct them to a method. To define a route in play, one has to write just one line which contains the HTTP method, the URI pattern and the method definition. So effortless!</p><h4><strong>Session Sharing</strong></h4><p>We have multiple instances of several services running at the same time — feed, image processing, search, notifications, etc. some of which lie in different sub-domains. Play enables us to share the sessions of the users among all of these. And doing this is a matter of a single configuration entry.</p><h4>No container required</h4><p>Deploying a spring application using Tomcat requires a fair bit of plumbing. In comparison, configuring and deploying on Play is a breeze because of the bundled Netty web server.</p><h4>Thread management</h4><p>Play is a lightweight, stateless, non-blocking framework that uses a fully asynchronous model built on top of akka<em>. </em>That meant we had to write almost zero boilerplate code while getting to utilise the power of highly concurrent and resilient akka. Modules that need hundreds of parallel thread processing events triggered by social activity on Roposo rely heavily on akka for failure resistance.</p><h4>Hot Reload</h4><p>Play’s feature to hot reload changes helped us develop new features and make changes very quickly. The developer productivity increases ten-fold when you get to code-refresh-view-repeat.</p><p>Two years since we decided on our brand of calcium, and having built both monolithic and mini-service oriented architecture on Play, we vouch for its flexibility and stability.</p><p><em>There are still a lot of power features in Play which we have not explored completely and would add to its utility. We believe we will be Playing for long.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26ca06c6bf22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roposo-engineering/plug-and-play-26ca06c6bf22">Plug and Play</a> was originally published in <a href="https://medium.com/roposo-engineering">Roposo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>