<?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 Hemant Chhonkar on Medium]]></title>
        <description><![CDATA[Stories by Hemant Chhonkar on Medium]]></description>
        <link>https://medium.com/@hemantchhonkar?source=rss-e17e1f767f20------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iEpXfUoKn5p072bw.</url>
            <title>Stories by Hemant Chhonkar on Medium</title>
            <link>https://medium.com/@hemantchhonkar?source=rss-e17e1f767f20------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:17:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hemantchhonkar/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[Angular internationalization: i18n]]></title>
            <link>https://medium.com/@hemantchhonkar/angular-internationalization-support-different-languages-d6eac24df1f3?source=rss-e17e1f767f20------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6eac24df1f3</guid>
            <category><![CDATA[internationalization]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular-cli]]></category>
            <dc:creator><![CDATA[Hemant Chhonkar]]></dc:creator>
            <pubDate>Sun, 23 Sep 2018 14:35:59 GMT</pubDate>
            <atom:updated>2018-09-23T15:47:29.889Z</atom:updated>
            <content:encoded><![CDATA[<p>These days, almost every website provides support for multiple languages.</p><p>In an angular application it is very easy to implement internationalization. There are multiple ways to do that, I am going to write the one I found best. I have shared the link for source code at the bottom of this tutorial.</p><p>Let’s start,</p><p>We are going to use <a href="https://github.com/ngx-translate">@ngx-translate</a>’s <em>core</em> and <em>http-loader modules.</em></p><p>run</p><blockquote><em>npm install @ngx-translate/core and</em></blockquote><blockquote>npm install @ngx-translate/http-loader</blockquote><p>We are all set to get hands dirty. Now lets create a configuration service.</p><pre><strong>import </strong>{ Injectable } <strong>from </strong>&#39;@angular/core&#39;;<br><strong>import </strong>{TranslateService} <strong>from </strong>&#39;@ngx-translate/core&#39;;<br><br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br><strong>export class </strong>I18nConfigService {<br><br>  currentLang = &#39;en&#39;;<br>  translateService: TranslateService;<br><br>  setSelectedLanguage(language) {<br>    <strong>this</strong>.currentLang = language;<br>    <strong>this</strong>.applyLanguage(<strong>this</strong>.currentLang);<br>  }<br>  <strong>private </strong>applyLanguage(language) {<br>    <strong>this</strong>.translateService.use(language);<br>  }<br>  getLanguages() {<br>    <strong>return this</strong>.translateService.getLangs();<br>  }<br>  <strong>constructor</strong>(translateService: TranslateService) {<br>    <strong>this</strong>.translateService = translateService;<br>  }<br><br>  setUpConf() {<br>    <strong>this</strong>.translateService.addLangs([&#39;en&#39;, &#39;fr&#39;]);<br>    <strong>this</strong>.translateService.setDefaultLang(<strong>this</strong>.currentLang);<br>    <strong>this</strong>.applyLanguage(<strong>this</strong>.currentLang);<br>  }<br>}</pre><p>Inside the setUpConf() function, first we are providing an array of language codes, then in the second line we are passing current language as default language code and at the last line we are applying the current selected language.</p><p>Now we need a component with a drop drop down to change languages.</p><pre><strong>import </strong>{ Component, OnInit } <strong>from </strong>&#39;@angular/core&#39;;<br><strong>import </strong>{I18nConfigService} <strong>from </strong>&#39;../service/i18n-config.service&#39;;<br><br>@Component({<br>  selector: &#39;app-language-selector&#39;,<br>  template: &#39;&lt;select class=&quot;form-input col-md-2&quot; style=&quot;display: block&quot; &#39; +<br>  &#39; #langSelect (change)=&quot;i18nConf.setSelectedLanguage(langSelect.value)&quot;&gt;\n&#39; +<br>  &#39;      &lt;option *ngFor=&quot;let lang of i18nConf.getLanguages()&quot; [value]=&quot;lang&quot; &#39; +<br>  &#39; [selected]=&quot;lang === this.i18nConf.currentLang&quot;&gt;{{ lang }}&lt;/option&gt;\n&#39; +<br>  &#39;    &lt;/select&gt;\n&#39;,<br>  styles: []<br>})<br><strong>export class </strong>LanguageSelectorComponent <strong>implements </strong>OnInit {<br>  i18nConf: I18nConfigService;<br>  <strong>constructor</strong>( i18nConf: I18nConfigService) {<br>    <strong>this</strong>.i18nConf = i18nConf;<br>    <strong>this</strong>.i18nConf.setUpConf();<br>  }<br><br>  ngOnInit() {<br>  }<br><br>}</pre><p>I am using in line HTML to display language drop down. On select we are changing the current language in I18nConfigService.</p><p>Now we need to configure provider in app.module.ts file.</p><pre><strong>import </strong>{ BrowserModule } <strong>from </strong>&#39;@angular/platform-browser&#39;;<br><strong>import </strong>{ NgModule } <strong>from </strong>&#39;@angular/core&#39;;<br><br><strong>import </strong>{ AppComponent } <strong>from </strong>&#39;./app.component&#39;;<br><strong>import </strong>{ LanguageSelectorComponent } <strong>from </strong>&#39;./language-selector/language-selector.component&#39;;<br><strong>import </strong>{ HomeComponent } <strong>from </strong>&#39;./home/home.component&#39;;<br><strong>import </strong>{AppRoutingModule} <strong>from </strong>&#39;./app-routing.module&#39;;<br><strong>import </strong>{HttpClient, HttpClientModule} <strong>from </strong>&#39;@angular/common/http&#39;;<br><strong>import </strong>{TranslateHttpLoader} <strong>from </strong>&#39;@ngx-translate/http-loader&#39;;<br><strong>import </strong>{TranslateLoader, TranslateModule} <strong>from </strong>&#39;@ngx-translate/core&#39;;<br><br>npm install @ngx-translate/core<br>// AoT requires an exported function for factories<br><strong>export function </strong>HttpLoaderFactory(httpClient: HttpClient) {<br>  <strong>return new </strong>TranslateHttpLoader(httpClient);<br>}<br><br>@NgModule({<br>  declarations: [<br>    AppComponent,<br>    LanguageSelectorComponent,<br>    HomeComponent<br>  ],<br>  imports: [<br>    BrowserModule,<br>    AppRoutingModule,<br>    HttpClientModule,<br>    TranslateModule.<em>forRoot</em>({<br>      loader: {<br>        provide: TranslateLoader,<br>        useFactory: HttpLoaderFactory,<br>        deps: [HttpClient]<br>      }<br>    })<br>  ],<br>  providers: [],<br>  bootstrap: [AppComponent]<br>})<br><strong>export class </strong>AppModule { }</pre><p>Now you need to create Json files for different language inside <strong><em>assets </em></strong>directory. Mind it, file names should be with the languages codes that we provided in configuration service. for example <strong><em>en.json</em></strong> and <strong><em>fr.json.</em></strong></p><p>en.json</p><pre>{<br>    &quot;HOME&quot; : {<br>      &quot;H1&quot; : &quot;Welcome to Angular internationalization!&quot;,<br>      &quot;H2&quot; : &quot;Here are some links to help you start: &quot;,<br>      &quot;A1_LABEL&quot; : &quot;Tour of Heroes&quot;,<br>      &quot;A2_LABEL&quot; : &quot;CLI Documentation&quot;,<br>      &quot;A3_LABEL&quot; : &quot;Angular blog&quot;<br>    }<br>}</pre><p>fr.json</p><pre>{<br>  &quot;HOME&quot; : {<br>    &quot;H1&quot; : &quot;Bienvenue à l&#39;internationalisation angulaire!&quot;,<br>    &quot;H2&quot; : &quot;Voici quelques liens pour vous aider à démarrer:&quot;,<br>    &quot;A1_LABEL&quot; : &quot;Tour des Héros&quot;,<br>    &quot;A2_LABEL&quot; : &quot;Documentation CLI&quot;,<br>    &quot;A3_LABEL&quot; : &quot;Blog angulaire&quot;<br>  }<br>}</pre><p>Now, just add <strong><em>&lt;app-language-selector&gt;&lt;/app-language-selector&gt; </em></strong>on the component where you want the language drop down.</p><pre>&lt;div&gt;<br>  Select Language : &lt;app-language-selector&gt;&lt;/app-language-selector&gt;<br>&lt;/div&gt;</pre><p>There you go. We are done. Simple, isn’t it ? :-p</p><p>Thanks for reading. You can download the source code here. <a href="https://github.com/hemant231/angular-internationalization">https://github.com/hemant231/angular-internationalization</a></p><p>Thanks for reading. Cheers !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6eac24df1f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Microservices]]></title>
            <link>https://medium.com/@hemantchhonkar/this-article-mainly-focuses-on-the-basics-about-microservices-be1917ddaaf1?source=rss-e17e1f767f20------2</link>
            <guid isPermaLink="false">https://medium.com/p/be1917ddaaf1</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Hemant Chhonkar]]></dc:creator>
            <pubDate>Sat, 11 Aug 2018 13:26:16 GMT</pubDate>
            <atom:updated>2018-08-12T08:15:02.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hTgjOY-BYkqx48V5y3_kgw.png" /><figcaption>Introduction to Microservices</figcaption></figure><blockquote>Introduction to Microservices</blockquote><blockquote><em>This article mainly focuses on the basics about microservices. I will be covering more advance concepts in subsequent articles.</em></blockquote><p><em>Microservices have been talked about a lot these days. Everybody is talking and writing microservices.</em></p><p><em>So</em></p><p><em>What exactly are they?</em></p><p><em>What do they really mean when they talk about microservices?</em></p><p><em>Why do consider using them ? Do we use it or do we not use it?</em></p><p>Let’s see what is the difference between traditional monolithic and micrservices architecture.</p><blockquote>Monolithic application means you have got various capabilities, various things you wanna provide and you put them in a single application and you think it of a one thing.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*L2Bomx21CyFGE7LHuOQrew.png" /><figcaption>Monolithic architecture</figcaption></figure><blockquote>And microservice approach is you break each of the capability and put them in to separate processes instead of having one process having this network of communication.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*q80NDIOz5Ht5gNXcQpIe3Q.png" /><figcaption>Microservice architecture</figcaption></figure><p>It also has consequence of distribution. If you have got a monolith you scale it by copying the whole application and put them into multiple machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*apJrdbqxYfVRyFNo8viqQg.png" /><figcaption>Monolithic scalling</figcaption></figure><p>But with microservice you have got more flexible approach because you can put different services on different machines so if some services get more load than another you can out them on more machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*vgLfYnYuiCzfuzO6oPHpXg.png" /><figcaption>Microservice scalling</figcaption></figure><p>As, in above picture, you can see the service represented by green triangle is scaled on multiple machines as it will get more load.</p><p>So with microservices you have complete control over each service.</p><h3>Characteristics of Microservices</h3><p>We can not say that there is a formal definition of the microservices architectural style. However, all microservices architectures share some common characteristics, as following figure illustrates</p><p><strong>Do one thing well or single responsibility: </strong>A microservice is designed to perform a set of capabilities and focuses on specific business domain. It serves one purpose and does it well.</p><p><strong>Decentralized data: </strong>Unlike monolith where every capability or service shares the same database schema, microservices are distributed systems with decentralized data management. Each service has their own database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*_jCPKsatQDHZA8kIL0Xk5Q.png" /></figure><p><strong>Polyglot: </strong>All the teams are independent and free to choose tools and technologies they want to use for their specific problems. As a consequence, microservices architectures take a heterogeneous approach to operating systems, programming languages, data stores, and tools. This approach is called polyglot persistence and programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*5AxL9_A-QPm6ItJ3YwsjEw.png" /></figure><p><strong>Share nothing or Black boxed: </strong>If you think about a well designed class in an object oriented model, it encapsulates a particular concept by defining private and public data and methods. External users of the class only see the public methods. Developers are free to fiddle with the private stuff as long as the contract defined by the public members is maintained.</p><p>Similarly, microservices are designed as black box, that is, they hide details of their complexity from other components They have a public APIs in the form of REST/SOAP endpoints, message queues, etc., as well as internal state. Anything inside the the microservice may be changed or updated, as long as those public contracts are maintained. Any communication between services happens via well- defined APIs to prevent implicit and hidden dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmLnKsqGJYM8U1CcpImC4w.png" /></figure><p><strong>Monitored: </strong>If it isn&#39;t monitored, it doesn&#39;t exist.” This is especially true with microservices. Without proper monitoring, it would be very easy for a sick microservice to go unnoticed in the crowd of applications. Its very important to keep a track of the health of your all running microservices.</p><p><strong>Automated or DevOps: </strong>Automation is the key principle while designing microservices. It is very hard to build, test and deploy microservices manually. So the concept of continuous integration and continuous delivery comes in to picture.</p><p>Since we are not discussing Continuous Integration and Continuous Delivery we will call attention to just a couple of key features here. We want as much confidence as possible that our software is working, so we run lots of automated tests. Promotion of working software ‘up’ the pipeline means we automate deployment to each new environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*71G8Ab7yFwdbIIP0f9dKvw.png" /></figure><p><strong>Designed for failure: </strong>· A consequence of using services as components, is that applications need to be designed so that they can tolerate the failure of services. Any service call could fail due to unavailability of the supplier, the client has to respond to this as gracefully as possible.</p><h3>Benefits of microservices</h3><blockquote>· Shorten development time.</blockquote><blockquote>· Reliable and faster deployment</blockquote><blockquote>· Enable frequent updates</blockquote><blockquote>· Increased uptime</blockquote><blockquote>· Faster issue resolution</blockquote><blockquote>· Highly scalable and better performance</blockquote><blockquote>· Better ownership and knowledge</blockquote><blockquote>· Right technology</blockquote><blockquote>· Automated build piplines</blockquote><h3>Design principles</h3><p><strong>High Cohesion</strong></p><blockquote>Single focus and responsibility</blockquote><blockquote>Modeled around business domain</blockquote><blockquote>Encapsulation principles</blockquote><p><strong>Autonomous</strong></p><blockquote>A microservice should not subject to change because of external system it interacts with.</blockquote><blockquote>Loose coupling between the microservice and the clients/microservices that use it. Means a change to service A or a client should not force to change microservice B.</blockquote><blockquote>Honor contracts and interfaces, means input and output formats should not change between versions.</blockquote><blockquote>Stateless.</blockquote><blockquote>Independently changeable and deployable.</blockquote><blockquote>Concurrent/ automated deployment.</blockquote><p><strong>Business domain centric</strong></p><blockquote>Service should represent business functions.</blockquote><blockquote>Bounded context from DDD (Domain Driven Design)</blockquote><blockquote>Identify boundaries</blockquote><blockquote>Response to business change.</blockquote><p><strong>Resilience:</strong></p><blockquote>Embrace failure (another service, specific connection, third-party system, exceptions, delay, unavailability, input validations etc.)</blockquote><blockquote>Degrade functionality</blockquote><blockquote>Multiple instances</blockquote><p><strong>Automated</strong></p><blockquote>Infrastructure automation</blockquote><blockquote>Automated testing and integrations (Continuous Integration)</blockquote><blockquote>Automated build and deployment pipelines (Continuous Delivery)</blockquote><p><strong>Observable</strong></p><blockquote>System health (Status, logs, errors)</blockquote><blockquote>Centralized monitoring and logging.</blockquote><blockquote>Thanks for reading. I hope it gives you a good understanding about microservices.</blockquote><blockquote>In the next article I will be covering the complexities which comes with microservices and how to solve them.</blockquote><blockquote>Cheers, happy reading.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be1917ddaaf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>