<?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 Priyashi Singh on Medium]]></title>
        <description><![CDATA[Stories by Priyashi Singh on Medium]]></description>
        <link>https://medium.com/@priyashisingh1?source=rss-c3499245d38c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GDPS_jrBH7q5WzmDjlkS_Q.jpeg</url>
            <title>Stories by Priyashi Singh on Medium</title>
            <link>https://medium.com/@priyashisingh1?source=rss-c3499245d38c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:29:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@priyashisingh1/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[Design Patterns: Building Better Software]]></title>
            <link>https://priyashisingh1.medium.com/design-patterns-building-better-software-ef8aa9e937bf?source=rss-c3499245d38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef8aa9e937bf</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Priyashi Singh]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 07:49:37 GMT</pubDate>
            <atom:updated>2023-09-06T07:49:37.344Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*0--gp2Iv4USlVckT0QtVSA.png" /></figure><p>Imagine design patterns as proven blueprints in the toolkit of skilled software developers. These patterns are like well-travelled paths, macadamize by experienced programmers to solve common coding puzzles.</p><h4><strong>Cracking the Code of Design Patterns:</strong></h4><p>Design patterns are like treasure maps leading to solutions for common software challenges. These solutions have been refined over time by countless developers, making them dependable solutions to frequent problems.</p><h3><strong>Meet the Gang of Four (GOF):</strong></h3><p>Back in 1994, four authors — Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — unveiled the concept of design patterns through their book “Design Patterns — Elements of Reusable Object-Oriented Software.”</p><p>This squad, fondly known as the Gang of Four (GOF), laid out key design principles:</p><p><strong><em>Coding by Interface, Not Implementation:</em></strong></p><p>Think of this as speaking a common language with your code. Instead of talking to specific parts, you chat with the whole crew, making your code more adaptable and versatile.</p><ul><li><em>Everyday Example:</em> Imagine you’re driving a car, and you need to change a flat tire. Instead of knowing the details of how each car model’s tire-changing process works, you have a universal tool kit that fits all cars. This tool kit represents an interface, a common way to interact with different car types.</li><li><em>In Code:</em> In your code, you create a function that uses this universal tool kit (interface) to change a tire without worrying about the specific car implementation details. This way, your code is adaptable to various car models.</li></ul><p><strong><em>Crafting with Composition:</em></strong></p><p>It’s like building with Lego blocks. Rather than building off an existing structure, you put together new ones, making your code adaptable and easy to modify.</p><ul><li><em>Everyday Example:</em> Think of creating a sandwich. Instead of having a single pre-made sandwich with everything inside, you start with individual ingredients like bread, cheese, and lettuce. You compose your sandwich by selecting and arranging these ingredients based on your preferences.</li><li><em>In Code:</em> Instead of building a complex class by inheriting properties and methods from another class (inheritance), you create smaller, reusable components (objects) and combine them to build your final class. This approach makes your code more flexible and easier to modify since you can change individual components without affecting the entire structure.</li></ul><h4><strong>Unveiling the Magic of Design Patterns:</strong></h4><p>Design patterns are like secret weapons for developers in two main ways:</p><p><strong>Shared Developer Language:</strong></p><p>Imagine if everyone spoke the same coding language. Design patterns provide this common ground, giving everyone a specific way to solve particular problems.</p><p><strong>Guiding Lights for Newbies:</strong></p><p>Design patterns have evolved over time, and they’re like the seasoned travelers’ guidebook. Following these guides helps newcomers to learn software development quickly and efficiently.</p><h4><strong>Three Categories, Endless Possibilities:</strong></h4><p>Design patterns fall into three camps, each with its own speciality:</p><blockquote><strong>Creational Patterns</strong> — Giving Birth to Objects:</blockquote><p>These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new operator. This gives program more flexibility in deciding which objects need to be created for a given use case. These patterns are like creative birth certificates for objects. They make sure that when you need something new, you get exactly what you need — no more, no less.</p><p><em>Few types of Creational Patterns:</em></p><p>Singleton: The “only one” manager — makes sure there’s just one captain steering the ship.</p><p>Factory Method: The master creator — makes things without revealing all the secrets.</p><p>Abstract Factory: The family planner — creates groups of related objects.</p><blockquote><strong>Structural Patterns </strong>— Building Strong Foundations:</blockquote><p>These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities. Imagine creating structures out of building blocks. These patterns help you combine different blocks in clever ways to build stronger, more flexible software.</p><p><em>Few types of Structural Patterns:</em></p><p>Adapter: The bridge builder — connects things that speak different languages.</p><p>Decorator: The creative decorator — adds new features without breaking what’s already there.</p><p>Composite: The whole package — treats individual and grouped items as equals.</p><blockquote><strong>Behavioral Patterns </strong>— Choreographing Object Dance:</blockquote><p>These design patterns are specifically concerned with communication between objects. Think of objects as dancers at a party. Behavioral patterns make sure they’re all in sync, dancing together harmoniously.</p><p><em>Few types of Behavioral Patterns:</em></p><p>Observer: The messenger — lets objects tell each other when things change.</p><p>Strategy: The adaptable strategist — lets you switch tactics on the fly.</p><p>Command: The request keeper — packages requests into neat bundles.</p><h4><strong>Wrapping Up the Design Adventure:</strong></h4><p>Design patterns are like seasoned mentors for developers, offering tried-and-true solutions to common programming puzzles. Thanks to the Gang of Four (GOF), we have guiding principles that encourage flexible coding and smart composition. By understanding these patterns, you’re equipping yourself to create efficient, organized, and adaptable software. Now, it’s your turn to let these patterns guide you towards coding success. Happy coding, adventurer!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef8aa9e937bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An interactive combined Highcharts on Angular]]></title>
            <link>https://priyashisingh1.medium.com/an-interactive-combined-highcharts-on-angular-6e1e0ba99062?source=rss-c3499245d38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e1e0ba99062</guid>
            <category><![CDATA[earnings]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[highcharts]]></category>
            <category><![CDATA[spending]]></category>
            <category><![CDATA[charts]]></category>
            <dc:creator><![CDATA[Priyashi Singh]]></dc:creator>
            <pubDate>Fri, 04 Jun 2021 09:53:21 GMT</pubDate>
            <atom:updated>2021-06-04T09:53:21.734Z</atom:updated>
            <content:encoded><![CDATA[<p>Show your spend data on the chart with average earnings and average spending on yearly basis by using HighCharts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*qluyws_z1kSb4JLF0LmDQg.png" /></figure><p>First, let’s integrate Highcharts with Angular:</p><p>Open command prompt/terminal in your current Angular project directory path.</p><p>Install Highchart library:</p><pre>npm install - save highcharts</pre><h3><strong>Steps:</strong></h3><h3><strong>1. Import the HighStocks and HighCharts in app.component.ts file </strong>in your application<strong>.</strong></h3><p>Access local HTML alias inside app.component.ts file</p><pre>@ViewChild(&#39;spendChart&#39;) spendChartEl: ElementRef;</pre><p>Import Highcharts types:</p><pre>import * as HighStocks from &#39;highcharts/highstock&#39;;</pre><pre>import { Options, SeriesAreaOptions } from &#39;highcharts/highstock&#39;;</pre><pre>import * as HighCharts from &#39;highcharts&#39;;</pre><h3><strong>2. Create a div with the chart ID in your app.component.html file.</strong></h3><pre>&lt;div id=”spendChart”&gt;&lt;/div&gt;</pre><h3><strong>3. Implement the “areaspline” chart with the dynamic series in ngOnInit() function.</strong></h3><pre>ngOnInit() {</pre><pre>this.spendChart = {</pre><pre>chart: {</pre><pre>renderTo: &#39;spendChart&#39;,backgroundColor: &#39;#ffffff&#39;},</pre><pre>navigation: {bindingsClassName: &#39;tools-container&#39;},</pre><pre>credits: {enabled: false},</pre><pre>rangeSelector: {enabled: false},</pre><pre>legend: {enabled: false},</pre><pre>responsive: {</pre><pre>rules: [{</pre><pre>condition: {maxWidth: 700},</pre><pre>chartOptions: {legend: {layout: &#39;horizontal&#39;}}</pre><pre>}]</pre><pre>},</pre><pre>series: [</pre><pre>{</pre><pre>name: &#39;Spend Analysis&#39;,</pre><pre>type: &#39;areaspline&#39;,</pre><pre>fillColor: {</pre><pre>linearGradient: {x1: 0,y1: 0,x2: 0,y2: 1},</pre><pre>stops: [</pre><pre>[0, HighCharts.getOptions().colors[0]],</pre><pre>[1,HighCharts.color(HighCharts.getOptions().colors[0]).setOpacity(0.get(&#39;rgba&#39;).toString()]</pre><pre>]</pre><pre>},</pre><pre>data: [</pre><pre>{ x: Date.UTC(2021, 0, 1), y: 35000 },</pre><pre>{ x: Date.UTC(2021, 1, 1), y: 48000 },</pre><pre>{ x: Date.UTC(2021, 2, 1), y: 25000 },</pre><pre>{ x: Date.UTC(2021, 3, 1), y: 48000 },</pre><pre>{ x: Date.UTC(2021, 4, 1), y: 60000 }</pre><pre>]</pre><pre>}</pre><pre>],</pre><pre>plotOptions: {</pre><pre>area: {showInLegend: false},</pre><pre>series: {</pre><pre>states: {inactive: {opacity: 1}}</pre><pre>}</pre><pre>},</pre><pre>xAxis: {</pre><pre>min: Date.UTC(2021, 0, 0),</pre><pre>max: Date.UTC(2021, 4, 1),</pre><pre>type: &#39;datetime&#39;,</pre><pre>labels: {</pre><pre>formatter: function() {</pre><pre>return HighCharts.dateFormat(&#39;%b&#39;, this.value);</pre><pre>}</pre><pre>},</pre><pre>crosshair: {width: 1,color: &#39;#E77817&#39;,dashStyle: &#39;ShortDash&#39;},</pre><pre>gridLineWidth: 1,</pre><pre>gridLineColor: &#39;transparent&#39;,</pre><pre>visible: true</pre><pre>},</pre><pre>scrollbar: { enabled: false },</pre><pre>yAxis: {</pre><pre>offset: 40,</pre><pre>gridLineColor: &#39;transparent&#39;,</pre><pre>visible: false</pre><pre>},</pre><pre>navigator: {enabled: false}</pre><pre>};</pre><pre>HighStocks.stockChart(&#39;spendChart&#39;, this.spendChart);</pre><pre>}</pre><p>This should result as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*mZKcFcZBD0OeG9xst65IdA.png" /></figure><h3>4. Add a line chart for average earnings and average spending with respective values.</h3><p>Below code represents code for the first line chart. Repeat code for other line charts.</p><pre>spending: any = 25000;</pre><pre>{name: &#39;Average spending&#39;,</pre><pre>color: &#39;#898B90&#39;,</pre><pre>type: &#39;line&#39;,</pre><pre>dashStyle: &#39;Dash&#39;,</pre><pre>enableMouseTracking: false,</pre><pre>data: [</pre><pre>{ x: Date.UTC(2021, 0, 1), y: this.spending },</pre><pre>{ x: Date.UTC(2021, 1, 1),</pre><pre>dataLabels: {</pre><pre>enabled: true,</pre><pre>formatter: function() {</pre><pre>return &#39;Average spending ₹&#39; + this.y.toLocaleString(&#39;en-IN&#39;);</pre><pre>},</pre><pre>color: &#39;#898B90&#39;,</pre><pre>style: {</pre><pre>fontSize: &#39;10px&#39;,</pre><pre>textOutline: &#39;0px&#39;,</pre><pre>fontWeight: &#39;light&#39;}},y: this.spending},</pre><pre>{ x: Date.UTC(2021, 2, 1), y: this.spending },</pre><pre>{ x: Date.UTC(2021, 3, 1), y: this.spending },</pre><pre>{ x: Date.UTC(2021, 4, 1), y: this.spending }],</pre><pre>lineWidth: 1,</pre><pre>marker: {</pre><pre>enabled: false,</pre><pre>symbol: &#39;circle&#39;,</pre><pre>radius: 0,</pre><pre>states: {hover: {enabled: false}}</pre><pre>}}</pre><p>You can refer to the Stackblitz link:</p><p><a href="https://stackblitz.com/edit/angular-ivy-kifqqa?file=src/app/app.component.ts">angular-ivy-kifqqa - StackBlitz</a></p><p>Hope this article helps you !</p><p>Thank you =)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e1e0ba99062" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>