<?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 Alperenkabadayi on Medium]]></title>
        <description><![CDATA[Stories by Alperenkabadayi on Medium]]></description>
        <link>https://medium.com/@alperenkabadayi0110?source=rss-1c536c2eb1b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DnzAtmACcY4dpR5R1iUWBw.jpeg</url>
            <title>Stories by Alperenkabadayi on Medium</title>
            <link>https://medium.com/@alperenkabadayi0110?source=rss-1c536c2eb1b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 23:32:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alperenkabadayi0110/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[Should I Use Abstract Classes Or Interfaces ?]]></title>
            <link>https://blog.stackademic.com/should-i-use-abstract-classes-or-interfaces-541399cb1b77?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/541399cb1b77</guid>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[abstract-class]]></category>
            <category><![CDATA[interfaces]]></category>
            <category><![CDATA[abstraction]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 08:01:20 GMT</pubDate>
            <atom:updated>2025-07-21T12:20:46.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>Should I Use Abstract Classes Or Interfaces ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yClnMvfUUV19PShk" /><figcaption>Photo by <a href="https://unsplash.com/@martijnbaudoin?utm_source=medium&amp;utm_medium=referral">Martijn Baudoin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I decided to write this post after I realize the difficulty of discrimination when I need to choose abstract classes or interfaces. This post is not going to be a long and confusing post. However, I will try to explain all vital concepts and use-case of abstract class and interfaces. Also, I will add some code examples at the end of the post.</p><p>From my perspective, to truly understand any concept you come across, it is important to know why the tool or solution was developed and which problem it aims to solve. We will be covering what problem abstract classes and interfaces solve and why we need them. Also, I will give you a some sort of plain roadmap that contains questions that ease you to understand when and where abstract classes or interfaces should be implemented.</p><p>Abstract classes describe a type hierarchy where subclasses share a common identity (is-a relationship), while interfaces represent capabilities or behaviours that a class can perform (can-do relationship). In this post, we’ll focus more on when to use them and what their differences are. I won’t go too deep into their definitions or detailed use cases. I’ll give some examples, but the main focus will be on the differences between abstract classes and interfaces. Now, let’s imagine we have a payment system that supports different types of payments, such as credit card payments and online payments. However, the system will need to support additional payment types later on, like bank transfers. Also, in this scenario, money is transferred from the buyer to the seller every time, which means we need to deduct taxes on every payment transaction.,</p><p>In this scenario, There is an “is-a” relationship on payment. However, it also “can-do” relationship too. We pay on all payment methods. Credit cards can pay, online payment can pay. Thus, how we are going to understand which abstraction method should we use ? (using interfaces is also an abstraction method). I had mentioned some question we need to ask when we can’t decide which one we are going to use. These questions are:</p><ol><li>Is it an “is-a relationship” or “can-do relationship” ?</li><li>Is there a common method that all classes inheriting from a certain base class need to implement?</li><li>Do your classes need to implement multiple “can-do” behaviours ?</li></ol><p>In our scenario, we have both is-a relationship and can-do relationship. However, let’s focus on is-a relationship first, after we answer the all question:</p><p>1- it is both. If there is an “is-a relationship” we need to implement an abstract class. If it is a “can-do” relationship, interfaces need to be implemented.</p><p>2- Yes. There is a common method that we need to implement. We have mentioned we need to deduct taxes for all payment types.</p><p>3- it can support. However, it is not necessary for now. (multiple inheritance is a speciality for interfaces)</p><p>After the consideration of the answers, it is clear that we absolutely need to implement an abstract class that deduct taxes for all payment types. The method that will be implemented on the abstract class is called <strong>template method pattern</strong>. However, we need to consider that tax percentage may change in the future. The tax percentage can be fetched from DB or from a model class. In this example, we will retrieve it from a data class. I will explain the code as we put them here.</p><pre>public interface ITaxService<br>{<br>    decimal GetCurrentTaxRate();<br>}</pre><p>This is an interface that we defined the GetCurrentTaxRate() method.</p><pre>public class TaxService : ITaxService<br>{<br>    public decimal GetCurrentTaxRate()<br>    {<br>        // This could later fetch from DB, API, or config<br>        return 0.18m;<br>    }<br>}</pre><p>We can update the value here when the tax percentage has been changed. Here, we just created a simple data class that inherits from an interface to save the abstraction architecture and use the benefit of dependency injection. If we decide to reach the function from the outside of the class, the other class doesn’t need to know what happens at the backside of the code.</p><pre>public abstract class Payment<br>{<br>    private readonly ITaxService _taxService;<br><br>    protected Payment(ITaxService taxService)<br>    {<br>        _taxService = taxService;<br>    }<br><br>    public void ProcessPayment(decimal amount)<br>    {<br>        var taxRate = _taxService.GetCurrentTaxRate();<br>        amount += amount * taxRate;<br>        Pay(amount);<br>    }<br><br>    protected abstract void Pay(decimal amount);<br>}</pre><p>This is the most important part of the code. Here in the abstract class, we injected TaxService container. Classes will need to override Pay method. However, we call ProcessPayment method when the payment is performed every time. This pattern is called “template method pattern”.</p><pre>public class CreditCardPayment : Payment<br>{<br>    public CreditCardPayment(ITaxService taxService) : base(taxService) { }<br><br>    protected override void Pay(decimal amount)<br>    {<br>        //Call payment api or service here for credit card<br>    }<br>}</pre><p>As I mentioned, we override the Pay method here in a protected method. Also, we need to pass taxService to Payment base abstract class through constructor.</p><pre>public class PayPalPayment : Payment<br>{<br>    public PayPalPayment(ITaxService taxService) : base(taxService) { }<br><br>    protected override void Pay(decimal amount)<br>    {<br>        //Call payment api for Paypal here<br>    }<br>}</pre><p>This is almost same with credit card class.</p><p>If we would like to use it by considering that DI is not managed automatically by the framework, we need to pass containers on the constructor methods and it should be like:</p><pre> ITaxService taxService = new TaxService();<br><br>        Payment creditCardPayment = new CreditCardPayment(taxService);<br>        creditCardPayment.ProcessPayment(100); <br>        // 118<br><br>        Payment payPalPayment = new PayPalPayment(taxService);<br>        payPalPayment.ProcessPayment(200); <br>        //236 with PayPal</pre><p>As you see, we call the ProcessPayment Method and we passed the Taxservice to instantiated classes.</p><p>In this post, we explored when should we use abstract classes or interfaces. Afterward, we demonstrated these concepts with practical code examples in a simple payment code snippets.</p><p>Thanks for your time and patient. I will see you in the next blog post :)</p><p><a href="https://buymeacoffee.com/alperenkbd">Alperen Kabadayi</a></p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏️<strong>️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/@InPlainEnglish"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://twitch.tv/inplainenglish"><strong>Twitch</strong></a></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=541399cb1b77" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/should-i-use-abstract-classes-or-interfaces-541399cb1b77">Should I Use Abstract Classes Or Interfaces ?</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication in React Native]]></title>
            <link>https://javascript.plainenglish.io/authentication-in-react-native-cd875454975a?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd875454975a</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[cross-platform]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 14:59:52 GMT</pubDate>
            <atom:updated>2025-07-21T11:19:36.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8sStLNvbtV6Msx8i" /><figcaption>Photo by <a href="https://unsplash.com/@brandsandpeople?utm_source=medium&amp;utm_medium=referral">Brands&amp;People</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before diving into implementation details, it’s important to first establish a clear understanding of what <strong>authentication</strong> is and why it plays a critical role in application development. Regardless of whether an app has ten users or millions, if it involves <strong>sensitive or user-specific data</strong>, implementing authentication is not optional, it’s essential.</p><p>At its core, authentication is the process of verifying a user’s identity. Typically, users register by providing credentials such as a username or email and a password, which are securely stored in the application’s database. During future visits, these credentials are used to verify the user’s identity. If the information provided matches what’s stored, the user gains access to the app. In its simplest form, this is how authentication works.</p><p>There are several methods for handling user authentication, and I’ve previously written about them in detail. If you’re interested, you can check out that post here:<br><a href="https://alperenkabadayi0110.medium.com/secure-application-development-concepts-that-you-must-know-at-the-era-of-ai-ecf19fbc39be"> <strong>Link to the post</strong></a></p><p>In this article, I’ll focus specifically on how to implement a <strong>login mechanism in a React Native application</strong>. We’ll cover what you need to know, the technologies and tools involved in the development process, and walk through the technical implementation with code snippets and examples.</p><p>Let’s dive in by taking a high-level look at how authentication works in the React Native ecosystem.</p><p>Before I will explain how authentication works on the React Native technically, I would like to visualize how Authentication looks like in the <strong>real life</strong> and how we solve the problems that are similar to Authentication.</p><p>Let’s say you work in a company that have lots of rooms which are controlled with RFID cards and have lots of different confidential files. Today is your first day in the office. When you arrive in the welcoming desk, probably a security officer will stop you and ask for your information and why you are there. After they confirm that this is your first day in the office. Most likely, they will direct you to the responsible person that will save your credentials on the workers database and provide an RFID card that allows workers to the rooms that they ought to reach. You will be needed to use the RFID card for accessing to the rooms after it is provided. In this scenario, the card is like your password. Somebody else may obtain this card and use it maliciously. Security officer is like a system of two-factor authentication. You already have an RFID card (password), however, If they suspicious from somebody, they will stop and ask for credentials. Rooms and files that are in the rooms are like the DB or sensitive information in the digital systems. In my opinion, to understand how Authentication works, this is a quite clear representation from real life scenario. Now let’s dive into the more technical part with React Native.</p><p>I have mentioned before what is authentication and what types of authentications are there on the digital systems before. However, I would like to mention them briefly here, before covering the authentication in React Native. Authentication is basically a mechanism for verifying a specific user that claims to register before in the digital system. The authentication is performed using the user’s email or phone number along with their password. Software systems use this mechanism because they are obligated to prevent unauthorized accesses to the system. Other reasons are securing users sensitive information and customization. There are some common authentication types, such as Single-Factor Authentication (SFA), which usually involves just a username and password. Two-Factor Authentication (2FA) combines a password with a second verification method like a code sent via SMS, email, or an authenticator app. Multi-Factor Authentication (MFA) includes two or more verification methods from different categories, such as a password, fingerprint, or security token. Biometric Authentication uses physical characteristics like fingerprints, facial recognition, or retina scans to verify identity. Token-Based Authentication involves issuing a token (such as a JWT) after a successful login, which is used in all subsequent requests to verify the user. OAuth allows users to log in through third-party services like Google or Facebook. Single Sign-On (SSO) enables a user to authenticate once and gain access to multiple connected systems without re-entering credentials.</p><p><strong>Oauth &amp; SSO</strong></p><p>OAuth and Single Sign-On (SSO) are also widely used in modern applications. <strong>OAuth</strong> allows users to log in to an application using an existing account from another platform, such as Google or Facebook. This way, users don’t need to create a new account or share their password with the new application. <strong>SSO</strong>, on the other hand, lets users sign in once and then access multiple related systems without having to log in again each time. This provides a more seamless user experience, especially in environments where several services are used under the same organization.</p><p>There are some simple differences between web and mobile app authentications. Let’s examine them in the table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*1PztZ-kyTuiEH482fxkpXg.png" /><figcaption>Fundamental differences between mobile and web in auth</figcaption></figure><p>After we cover how the access tokens and refresh tokens work in RN, we will be focusing in authentication more technically with examples of React Native.</p><p>When a user logs into the app using their email and password, the server responds with two important pieces: an <strong>access token</strong> and a <strong>refresh token</strong>. The access token is what we’ll use to make requests to the backend, but it usually has a short lifespan, maybe 15 or 30 minutes. The refresh token, on the other hand, lasts longer and helps us get a new access token when the first one expires. In the app, we store these tokens safely. The <strong>refresh token</strong> should go into secure storage, like the Keychain on iOS or the Keystore on Android. The <strong>access token</strong> can either be stored in memory or secure storage, depending on the structure of the app. Then, each time we want to make a request to the backend, we attach the access token to the request. If the token is still valid, the request goes through with no problem. But if the token has expired, we use the refresh token to ask the server for a new access token, all of this happens in the background without bothering the user. If that refresh process works, we update our tokens and continue. But if the <strong>refresh token has also expired</strong>, or the server rejects it, then we know the user’s session is no longer valid. At that point, we log the user out and ask them to log in again. This way, the user doesn’t have to log in every time they open the app, but we still keep things secure behind the scenes.</p><p><strong>Authentication in React Native</strong></p><p>Based on the story that I have mentioned before, we need to store a unique series of numbers for each user over the session as employee use their card to reach to office. It is called token. There are different ways of generating and storing a token. Store management libraries such as Redux, ZuStand should not be used for storing a token. They are more like for active using and frequently updating data. I will be explaining and exampling authentication in react native by using API Context. We will not be focusing on backend side of the application, will be examining just mobile part of the application.</p><p>I am adding a table which technology we are going to use for the example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*yDkL4CvRUHBzTBr1f8aIwg.png" /><figcaption>Tech stack</figcaption></figure><p>Let’s dive into more technical part:</p><p>I have created a template project with react native and published it as a template on the npm packages. After I explain what code does, I will be adding links at the end of the post.</p><p>First, I would like to add project structure and how context api manages data:</p><pre>src/<br>├── api/<br>│   └── firebase.js          # Firebase configuration and initialization<br>├── auth/<br>│   ├── AuthProvider.js      # Context provider for authentication state<br>│   ├── authActions.js       # Authentication actions (login, register, logout)<br>│   └── useAuth.js           # Custom hook for auth operations<br>├── components/<br>│   ├── CustomButton.js      # Reusable button component<br>│   └── CustomInput.js       # Reusable input component with validation<br>├── navigation/<br>│   ├── AppStack.js          # Navigation for authenticated users<br>│   ├── AuthStack.js         # Navigation for unauthenticated users<br>│   └── RootNavigator.js     # Main navigation controller<br>├── screens/<br>│   ├── HomeScreen.js        # Main app screen<br>│   ├── LoginScreen.js       # Login form<br>│   ├── ProfileScreen.js     # User profile and settings<br>│   └── RegisterScreen.js    # Registration form<br>├── utils/<br>│   ├── delay.js             # Rate limiting utilities<br>│   └── storage.js           # Secure storage utilities<br>└── App.js                   # Main app component</pre><p>In the useAuth.js under auth file we do some processes like below:</p><pre>  return {<br>    // State<br>    isAuthenticated: state.isAuthenticated,<br>    user: state.user,<br>    isLoading: state.isLoading,<br>    error: state.error,<br>    <br>    // Configuration status<br>    isFirebaseConfigured,<br>    <br>    // Actions<br>    login,<br>    register,<br>    logout,<br>    resetPassword,<br>    refreshToken,<br>    clearError,<br>    setLoading,<br>    <br>    // Helper computed values<br>    isLoggedIn: state.isAuthenticated &amp;&amp; state.user !== null,<br>    userEmail: state.user?.email || null,<br>    userId: state.user?.uid || null,<br>    userDisplayName: state.user?.displayName || &#39;&#39;,<br>    isEmailVerified: state.user?.emailVerified || false,<br>  };<br>};<br><br>export default useAuth; </pre><p>This is the return part of the useAuth.js. We manage some states, methods, and values. to understand how states and actions manage, you can check the GitHub page. This template has been built for OAuth authentication, it means it can work with firebase. Firebase manages some functions in the SDK for you such as refreshing the token, logging you in and more. Also I have created two different screen stack named AuthStack and AppStack. When users have the right of landing on the Appstack, users are routed on the appstack. If they do not have the token, they are routed on the AuthStack which contain login and register screen.</p><p>Auth Stack:</p><pre>const AuthStack = () =&gt; {<br>  return (<br>    &lt;Stack.Navigator<br>      initialRouteName=&quot;Login&quot;<br>      screenOptions={{<br>        headerShown: false,<br>        cardStyle: { backgroundColor: &#39;#FFFFFF&#39; },<br>        animationEnabled: true,<br>        gestureEnabled: true,<br>      }}<br>    &gt;<br>      &lt;Stack.Screen<br>        name=&quot;Login&quot;<br>        component={LoginScreen}<br>        options={{<br>          title: &#39;Sign In&#39;,<br>        }}<br>      /&gt;<br>      <br>      &lt;Stack.Screen<br>        name=&quot;Register&quot;<br>        component={RegisterScreen}<br>        options={{<br>          title: &#39;Sign Up&#39;,<br>          animationEnabled: true,<br>        }}<br>      /&gt;<br>    &lt;/Stack.Navigator&gt;<br>  );<br>};</pre><p>App Stack:</p><pre>const AppStack = () =&gt; {<br>  return (<br>    &lt;Stack.Navigator<br>      initialRouteName=&quot;MainTabs&quot;<br>      screenOptions={{<br>        headerShown: false,<br>        cardStyle: { backgroundColor: &#39;#FFFFFF&#39; },<br>      }}<br>    &gt;<br>      &lt;Stack.Screen<br>        name=&quot;MainTabs&quot;<br>        component={TabNavigator}<br>      /&gt;<br>      <br>      {/* Add additional screens here that should be accessible from tabs */}<br>      {/* Example:<br>      &lt;Stack.Screen<br>        name=&quot;Settings&quot;<br>        component={SettingsScreen}<br>        options={{<br>          headerShown: true,<br>          title: &#39;Settings&#39;,<br>        }}<br>      /&gt;<br>      */}<br>    &lt;/Stack.Navigator&gt;<br>  );<br>};</pre><p>Root Screen that we manage the authentication:</p><pre>const RootNavigator = () =&gt; {<br>  const { isAuthenticated, isLoading } = useAuth();<br><br>  // Show loading screen while determining auth state<br>  if (isLoading) {<br>    return &lt;LoadingScreen /&gt;;<br>  }<br><br>  return (<br>    &lt;NavigationContainer&gt;<br>      &lt;Stack.Navigator<br>        screenOptions={{<br>          headerShown: false,<br>          animationEnabled: true,<br>          cardStyle: { backgroundColor: &#39;#FFFFFF&#39; },<br>        }}<br>      &gt;<br>        {isAuthenticated ? (<br>          // User is authenticated - show app screens<br>          &lt;Stack.Screen<br>            name=&quot;AppStack&quot;<br>            component={AppStack}<br>            options={{<br>              animationTypeForReplace: &#39;push&#39;,<br>            }}<br>          /&gt;<br>        ) : (<br>          // User is not authenticated - show auth screens<br>          &lt;Stack.Screen<br>            name=&quot;AuthStack&quot;<br>            component={AuthStack}<br>            options={{<br>              animationTypeForReplace: &#39;pop&#39;,<br>            }}<br>          /&gt;<br>        )}<br>      &lt;/Stack.Navigator&gt;<br>    &lt;/NavigationContainer&gt;<br>  );<br>};</pre><p>To understand the code well, please check these links out:</p><p><a href="https://www.npmjs.com/package/@alperen06/react-native-login-template">Npm Link</a></p><p><a href="https://github.com/alperenkbd/React-Native-OAuth-Firebase-Login-Template">Github Link</a></p><p>In this post, we explored the concept of authentication using real-life examples. We discussed key terms such as <strong>tokens, verification, and authentication</strong>, explaining why they are essential in a mobile application. Afterward, we demonstrated these concepts with practical code examples in a React Native authentication project.</p><p>I hope this post helps others in their journey, and I look forward to sharing more insights in future posts. :)</p><p><a href="https://buymeacoffee.com/alperenkbd">Alperen Kabadayi</a></p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏️<strong>️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/@InPlainEnglish"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://twitch.tv/inplainenglish"><strong>Twitch</strong></a></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd875454975a" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/authentication-in-react-native-cd875454975a">Authentication in React Native</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Application Development: Concepts That You Must Know At the Era of AI]]></title>
            <link>https://alperenkabadayi0110.medium.com/secure-application-development-concepts-that-you-must-know-at-the-era-of-ai-ecf19fbc39be?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf19fbc39be</guid>
            <category><![CDATA[authenticity]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[trustworthy]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Thu, 22 May 2025 12:21:53 GMT</pubDate>
            <atom:updated>2025-05-25T21:25:57.691Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hHQMoxe90FGWdpYO" /><figcaption>Photo by <a href="https://unsplash.com/@scottwebb?utm_source=medium&amp;utm_medium=referral">Scott Webb</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>First things first, every developer should question their understanding of the definition of a secure application to be able to develop it. In this post, I will explain what a secure application is for me, what the potential risks are, and how we can mitigate them throughout application development; before, during, and after.</p><p>Most companies have a definition for a secure application. In my opinion, the concept of a secure application varies depending on the company’s culture. We will discuss the common understandings of application security and how we can implement prevention measures in our own applications. Let’s briefly look at the definitions.</p><h3><strong>Secure Application Definitions of Big Tech Companies:</strong></h3><h3>1. OWASP (Open Web Application Security Project)</h3><blockquote>“<strong>A secure application is one that effectively prevents the top risks outlined in the OWASP Top 10</strong>, including injection, broken access control, and sensitive data exposure.”</blockquote><h3>2. Microsoft</h3><blockquote>“A secure application is <strong>an application that is designed, developed, and deployed using security best practices and principles</strong> such as least privilege, defense in depth, and secure default settings.”</blockquote><h3>3. IBM</h3><blockquote>“A secure application is <strong>built to withstand malicious attacks, ensure data confidentiality and integrity, and protect user privacy</strong> through secure code, authentication, encryption, and ongoing vulnerability management.”</blockquote><h3>4. Cisco</h3><blockquote>“A secure application is one that has <strong>built-in protection against unauthorized access, data breaches, and exploits</strong>, achieved through secure architecture, encryption, and rigorous testing.”</blockquote><h3>5. Google (Cloud Security)</h3><blockquote>“A secure application is <strong>designed with zero trust principles</strong>, encrypts data in transit and at rest, enforces least privilege access, and uses automated scanning to detect vulnerabilities.”</blockquote><h3>6. NIST (U.S. National Institute of Standards and Technology)</h3><blockquote>“A secure application is <strong>an application that adheres to secure software development practices</strong>, minimizing exploitable vulnerabilities and resisting compromise in its operating environment.”</blockquote><p>Everyone may realize that there are some common qualities of a <strong>secure application </strong>according to definition of them in terms of big tech companies. These concepts are:</p><ul><li>User privacy</li><li>Trustworthiness</li><li>Risk-free</li><li>Testablity</li><li>Encryption</li><li>Data integrity</li><li>Data confidelity</li></ul><p>Then, if we know what a secure application is, let’s talk a little about the potential risks in a digital system. The system and its environment should be clearly defined in order to be debatable.</p><p>Let’s say we have a digital system that stores, sends, and receives data. This system also has inputs and outputs. Inputs come from users, and outputs go to the receivers. However, the data has a long journey before it reaches the receivers.</p><p>Let’s visualize this relationship:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*TRwTvY1FGKInikPpre2F9A.png" /><figcaption>Represents the simple server based data transfer system</figcaption></figure><p>Every element represented in the diagram may be source of potential vulnerability for data owners, such as the users of the application, users’ computers, the path the data follows, and the server. Each of these elements must be secured in order to claim that we have a secure application.</p><h3><strong>Secuirty of the Edge Users of the Systems:</strong></h3><p>Let’s discuss vulnerabilities and potential attack types on the system’s elements. The most vulnerable element of the system is, surely, the human. Tools keep developing as technology and AI evolve. However, hackers and their methods also adapt and change with these tools.</p><p>Most people don’t have general security knowledge to protect their personal devices and information. Therefore, the most common method used against people is <strong>social engineering</strong>. For example, they share pictures on social media that include documents with sensitive information. I’ve even seen people share their passports, where visitors to the application could easily read the passport number.</p><p>In that case, understanding how to protect personal information, and even hardware, becomes more important than we think. If you live in a shared flat and your landlord has the key to your home or room, you may potentially be under cyber attack. There are tons of tools that hackers can acquire effortlessly from e-commerce websites, and if they gain physical access to your device, they can easily listen in or compromise it, even remotely.</p><p>Therefore, we can say that the first and most important vulnerable element of the system is the <strong>human</strong> and their <strong>device</strong>.</p><p>We now have a general idea of personal security. However, this isn’t much different when we consider application security. Wherever we store the application, whether it’s on a server, in the cloud, or even on our personal computers, it must be secured not only physically but also at the software level.</p><p>There are sets of solutions for securing servers, but it depends on how developers, companies, or clients want to store their applications. This is not the main focus of this blog post, but I will mention them briefly.</p><p>There are six main options to store your application, but I’ll mention two: <strong>on-prem</strong>, <strong>cloud</strong>, and <strong>data centers</strong>, respectively.</p><p>Some organizations, such as government or military institutions, may require companies to store servers in their own buildings. In that case, they take full responsibility for physically securing those servers.</p><p>Other companies store applications in their own server rooms and must consider edge cases, like unauthorized access attempts to the server room, power outages, high temperatures, high humidity, fires, electromagnetic interference, and so on.</p><p>The other option is using the <strong>cloud</strong>. The solution here might involve creating an instance of your application, and the responsibility for server security lies with the cloud provider, not the developers. So, I’ll move past this method quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JviITTzIw8MMT0gu" /><figcaption>Photo by <a href="https://unsplash.com/@rayner?utm_source=medium&amp;utm_medium=referral">Rayner Simpson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Secuirty of Network:</h3><p>We discussed two vulnerable elements of the system together: the human and their devices. We also briefly mentioned the server. However, another essential element of the system is <strong>the path the data takes</strong> during transfer.</p><p>I’m not going to discuss this topic in detail because it involves things like HTTP/HTTPS, TLS, encryption methods, handshakes, TCP/IP, digital signatures, and so on. I might create a different blog post to explain those later. For now, I’ll focus on <strong>why it’s important</strong> and what the concept of <strong>end-to-end encryption (E2E)</strong> is. This will help us grasp the fundamentals of network security, even if just in a general sense.</p><p><strong>HTTP</strong> is a transfer protocol, as its name suggests. It means it’s designed for <strong>transferring</strong> data, not storing it.</p><p>To understand the concept more clearly, let’s say we’re chatting with one of our friends. We’re using our phone to type and hitting the send button. After that, the data follows an uncertain path to reach our friend’s phone. It might pass through several routers and servers along the way.</p><p>We’ve probably all seen that message on WhatsApp: <strong>“This chat has been encrypted end-to-end.”</strong> That means only you and your friend are allowed to read the messages, because they’re encrypted using the <strong>Diffie-Hellman key exchange</strong> method. Others on the network can’t read the messages, they only see the encrypted versions. This protects users from <strong>man-in-the-middle attacks</strong>.</p><p><strong>TLS</strong> is different from end-to-end encryption. TLS encrypts the data <strong>between the user and the server</strong>, while end-to-end encryption secures the data <strong>from user to user</strong>. This increases the overall level of security.</p><p>However, these services are often provided by commercial companies that <strong>store your data</strong>. They may encrypt it, but they can still understand what you’re typing by using various techniques. Even governments, like in China, try to bypass encryption by analyzing letter frequency or recognizing patterns in the encrypted data to reveal the message.</p><p>Anyway, that’s not our main topic here.</p><p>In general, we’ve briefly mentioned:</p><ul><li><strong>the security of the network</strong>,</li><li><strong>the concept of end-to-end encryption (E2E)</strong></li></ul><p>I wanted to add a video that discusses <strong>the security concerns of governments regarding E2E encryption</strong>, as well as another video that explains <strong>how E2E works in detail</strong>, right here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjkV1KEJGKRA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjkV1KEJGKRA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjkV1KEJGKRA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f51216935a26aaff4b7d3b2932a64ea/href">https://medium.com/media/4f51216935a26aaff4b7d3b2932a64ea/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDXv1boalsDI%3Fstart%3D266%26feature%3Doembed%26start%3D266&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDXv1boalsDI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDXv1boalsDI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a15946c7aa35492e24cd382cb0dbb44b/href">https://medium.com/media/a15946c7aa35492e24cd382cb0dbb44b/href</a></iframe><h3>Storing Apps Securely:</h3><p>We already covered the significance of physical server security at the beginning of this post, so I’m not going to keep this section too long.</p><p>The first concept I’d like to mention here is <strong>hashing sensitive data</strong>. We <strong>must hash</strong> the data if we store any sensitive information on the server. Hashing is a <strong>non-reversible</strong> encryption method used to store sensitive data such as passwords, personal information, and so on.</p><p>Another essential concept is <strong>designing a secure architecture</strong> on the server. There are endless things we can do to improve server security. We’ll cover some of them in the rest of the post.</p><h3><strong>Examples to the Most Common a </strong>Couple of <strong>Attack Types:</strong></h3><p><strong>Man in the Middle Attack:</strong></p><p>We visualized a simple network communication earlier in the post. If a malicious person, someone who wants to steal or alter information, listens to the network using certain techniques, it’s simply called a <strong>man-in-the-middle attack</strong>. There are also different methods of executing this type of attack, but I’m not going to explain them in detail here. You can check them out if you’re interested.</p><p><strong>Social Engineering:</strong></p><p>This broad concept refers to the use of <strong>manipulation techniques</strong> to extract sensitive information, which can then be leveraged to access protected systems or confidential data. There is no single determined way to execute this technique. However, there are some well-known methods used by hackers, such as <strong>phishing</strong>, <strong>baiting</strong>, <strong>and</strong> <strong>scareware</strong>.</p><h3>Some Security Concepts To Know</h3><p><strong>Authentication:</strong></p><p>Applications contain sensitive information on digital pages, and these pages must not be accessible by just any random user. First, the app needs to <strong>identify</strong> the user. Then, it should <strong>grant permission</strong> to access the information. Generally, applications use a <strong>username or email and password</strong> to identify users.</p><p>There are different types of authentication, but the most common method is <strong>password-based authentication</strong>. This method can be divided into two main approaches: <strong>cookie-based authentication</strong> and <strong>JWT (JSON Web Token) authentication</strong>.</p><p>In cookie-based authentication, the token or secret key is managed on the server and stored in a database. After verifying credentials, the app checks whether the web cookie matches the data stored in the database.</p><p>The method is similar in JWT authentication, but in this case, the token is stored on the <strong>client side</strong>. JWT also contains additional data such as <strong>expiration date</strong>, <strong>audiences</strong>, and more.</p><p>There are also other types of authentication. If you’re interested in how they work, here are some examples: <strong>SSO (Single Sign-On)</strong>, <strong>Certificate-Based Authentication</strong>, <strong>LDAP (Lightweight Directory Access Protocol) Authentication</strong>, and <strong>Passwordless Authentication</strong>, among others.</p><p>Before moving on to the <strong>authorization</strong> section, I’d like to briefly mention <strong>Two-Factor Authentication (2FA).</strong></p><p><strong>2FA:</strong></p><p><strong>Two-Factor Authentication (2FA)</strong> is a critical component of application security. It adds an extra layer of protection by requiring users to verify their identity using a second factor, even if their login credentials (username and password) are compromised. This ensures that the person attempting to access the account is the same person who originally entered the credentials.</p><p>2FA methods typically include sending a <strong>verification code via email or SMS</strong>, or prompting the user to approve a <strong>notification through an authenticator app</strong>. Without this second step, unauthorized users cannot gain access, even if they know the correct login details.</p><p>It’s highly recommended that users <strong>enable 2FA</strong> on any platform that supports it. Likewise, <strong>developers should implement 2FA in their applications</strong>, even for small-scale projects, as it significantly enhances overall security.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZXFYT-BG2So%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZXFYT-BG2So&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZXFYT-BG2So%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/efe1f652d9654311d54413b244d0ca30/href">https://medium.com/media/efe1f652d9654311d54413b244d0ca30/href</a></iframe><p><strong>Authorization:</strong></p><p>There are two fundamental approaches to <strong>authorization</strong> in application security: <strong>RBAC (Role-Based Access Control)</strong> and <strong>ABAC (Attribute-Based Access Control)</strong>.</p><p><strong>RBAC</strong> focuses on restricting access based on a user’s role within the system. For example, imagine a warehouse with multiple workers, including junior workers, senior workers, and team leads. If we were to build a simple document management app for this warehouse, each user should only be able to access documents relevant to their role. A junior worker shouldn’t be able to view the CEO’s responsibilities, while a team lead should be able to access documents related to their team. In RBAC, we define user roles and assign <strong>permissions</strong> to each role. Users then inherit permissions based on their assigned role — ensuring that everyone sees only what they’re authorized to access.</p><p><strong>ABAC</strong>, on the other hand, is a more dynamic and flexible model. It grants access based on <strong>attributes</strong> rather than just roles. Continuing with the same warehouse example, imagine a confidential document that should only be accessible to users who are:</p><ul><li>Located at a specific warehouse</li><li>Have the role of a manager</li><li>And were hired more than two years ago.</li></ul><p>ABAC allows us to define these kinds of <strong>rules based on attributes</strong> such as location, role, and employment duration. The system evaluates these attributes at the time of access using logical conditions (e.g., <em>if user.location == “Warehouse A” AND user.role == “Manager” AND user.hiredDate &lt; 2023</em>).</p><p>This attribute-driven approach offers more granular and contextual access control.<br> I’ve added a video below that clearly explains these concepts in more depth, I highly recommend you watching this video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrvZ35YW4t5k%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrvZ35YW4t5k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrvZ35YW4t5k%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/87648a3224b097bd4008700ea4638d42/href">https://medium.com/media/87648a3224b097bd4008700ea4638d42/href</a></iframe><p><strong>Input Handling:</strong></p><p>It may sound surprising, but <strong>input handling</strong> is one of the most critical concepts in application security, especially for developers learning the fundamentals. Why? Because it teaches one of the golden rules of secure development: <strong>never trust user input</strong>.</p><p>Even in seemingly simple applications, input handling can present significant challenges. Developers must always consider <strong>edge cases</strong>, as overlooking them can open the door to serious vulnerabilities. For example, although I won’t go into detail about <strong>SQL injection attacks</strong> here, it’s worth noting that an attacker can potentially <strong>drop your entire database</strong> with a single malicious input, <strong>if</strong> the application lacks proper validation and sanitization.</p><p>The first step in building secure input handling is to <strong>analyze the risks</strong>. Take real-world cases like names: users may have names like <em>Mike O’Leary</em> or <em>Janet Smith-Johnson</em>. If your application doesn’t account for special characters like apostrophes or hyphens, it could break functionality, or worse, introduce exploitable bugs.</p><p>In short, secure input handling is about:</p><ul><li><strong>Not trusting user input</strong></li><li><strong>Designing your application to operate reliably from start to finish</strong></li><li><strong>Using techniques like regular expressions (regex)</strong> to catch and handle edge cases effectively</li></ul><p>It’s a mindset shift, treat every input as potentially malicious unless proven otherwise.</p><p><strong>TLS 1.2:</strong></p><p>I was initially planning to dive deep into <strong>HTTP/HTTPS</strong>, <strong>SSL</strong>, and <strong>TLS, </strong>but I decided against it. Going into that level of detail would require discussing <strong>handshakes</strong>, <strong>ciphers</strong>, and other lower-level networking topics, which would take this blog post far beyond its intended scope.</p><p>That said, I still want to briefly mention <strong>TLS 1.2</strong> and a personal experience I had related to it.</p><p>To begin with, <strong>TLS (Transport Layer Security)</strong> is the modern, secure successor to <strong>SSL (Secure Sockets Layer)</strong>. The latest version is <strong>TLS 1.3</strong>, but <strong>TLS 1.2</strong> remains the most widely used version on the web today. The key difference between the two is the <strong>handshake process</strong>. TLS 1.2 requires <strong>six total steps</strong> to establish a connection, whereas TLS 1.3 reduces that to just <strong>three</strong>. This difference makes TLS 1.3 not only faster but also more <strong>resource-efficient</strong> and <strong>secure</strong>.</p><p>Now, onto the story.</p><p>I was working on a product that involved multiple API integrations. These APIs were responsible for exchanging <strong>large and sensitive data payloads</strong>. One day, one of the API endpoints stopped working unexpectedly. I began investigating by checking the logs and debugging network traffic. It turned out to be a <strong>network security issue</strong>.</p><p>At first, I assumed something had changed on our side, maybe a firewall rule, a server config, or a certificate issue. But everything looked normal. After further investigation, the owner of the API endpoint informed us that they had <strong>upgraded their TLS version</strong>, first from <strong>TLS 1.0 to 1.2</strong>, and then they <strong>deprecated TLS 1.2 entirely</strong>, requiring <strong>TLS 1.3</strong> for all connections.</p><p>This change broke our integration because our system was not yet compatible with TLS 1.3. We had to update our <strong>SSL certificates</strong>, tweak some <strong>TLS configuration</strong>, and refactor parts of our networking code to re-establish a secure connection. Eventually, the issue was resolved.</p><p>So here’s a question for you:<br> <strong>If you’re building long-lasting software systems that rely on external APIs, how can you design them to be robust, reliable, and resilient to such changes?</strong></p><p>One starting point is to implement <strong>active monitoring and automated health checks</strong> for API connectivity. Regularly test whether the TLS handshake is completing successfully and trigger alerts if it fails. This way, you can detect TLS-related changes early, <em>before</em> they cause production failures.</p><pre>bool TlsTest()<br>{<br> try<br> {<br> var client = new HttpClient();<br> var response = client.GetAsync(&quot;https://tls-check.AlperenWebsite.com/ping&quot;).Result;<br> return response.IsSuccessStatusCode;<br> }<br> catch (Exception ex)<br> {<br> LogHata(&quot;TLS connection is not success: &quot; + ex.Message);<br> return false;<br> }<br>}</pre><p>Do not use certain versions on your code. Instead of this:</p><pre>ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;</pre><p>Use this:</p><pre>ServicePointManager.SecurityProtocol = (SecurityProtocolType)0x00000FFF;</pre><p>This chooses the latest version of the TLS.</p><p>Also, we can implement logging and monitoring systems to trace the health of the application.</p><p><strong>Security Event Monitoring:</strong></p><p>This isn’t a proactive security technique in the traditional sense, but it’s still a <strong>critical part of maintaining secure systems</strong>. <strong>Monitoring</strong> is essential. Every system should have <strong>alerting mechanisms</strong> in place to detect abnormal behaviors, potential vulnerabilities, or performance degradations that could lead to <strong>catastrophic failures</strong> if left unaddressed.</p><p>In this context, I’m referring to <strong>Security Event Monitoring</strong>. It’s the process of collecting, analyzing, and acting on security-related events in real time. By setting up proper <strong>logging and alerting</strong>, teams can respond quickly to incidents and mitigate the damage.</p><p>To get a clearer understanding, I recommend checking out the <strong>sandbox tool provided by Sentry</strong>. It’s a great example of how monitoring tools can help track and respond to system-level issues effectively.<br> Here’s the link to explore:</p><p><a href="https://sandbox.sentry.io,/">https://sandbox.sentry.io</a></p><figure><img alt="Tracing" src="https://cdn-images-1.medium.com/max/1024/0*zyhbkpeDHL016AJi" /><figcaption>Tracing</figcaption></figure><p><strong>Testing:</strong></p><p>The last, and arguably the most important, topic in this blog is <strong>testing</strong>.</p><p>As developers, we strive to write clean, maintainable code. We follow object-oriented principles, apply design patterns, and build modular structures. But what’s the ultimate goal behind all of this effort? <strong>To ensure that our code works reliably and securely in real-world scenarios.</strong></p><p>Testing plays a crucial role in this process. Some of the key reasons for testing include:</p><ul><li>Ensuring the code meets functional and security expectations</li><li>Identifying bugs before they reach production</li><li>Verifying that updates don’t break existing features (regression prevention)</li><li>Increasing overall customer trust and satisfaction</li></ul><p>There are many types of testing; unit, integration, end-to-end, performance, security testing, and more. In fact, there’s even an entire development approach built around testing called <strong>Test-Driven Development (TDD)</strong>.</p><p>While the topic of testing deserves its own dedicated post, I didn’t want to conclude this blog without emphasizing its importance. A well-tested application is not just more reliable; it’s more secure, more scalable, and more professional.</p><p><strong>Yeeey! You’ve reached the end of the post.</strong><br> I truly hope you found it helpful and insightful.</p><p>Please feel free to leave a comment below and give the post a few claps if you enjoyed it, your feedback means a lot! You’re also welcome to connect with me on <a href="https://www.linkedin.com/in/alperen-kabadayi/">LinkedIn </a>or reach out via email anytime.</p><p>If you’d like to say thanks and support my work, here’s my <a href="https://buymeacoffee.com/alperenkbd"><strong>Buy Me a Coffee</strong></a> link, maybe you’ll share a virtual cup with me ☕</p><p>Thanks so much for your time and patience.<br> <strong>Stay safe, stay curious, and I hope to see you in the next blog post.</strong><br> <strong>Have a secure day :)</strong></p><p><a href="https://buymeacoffee.com/alperenkbd">Alperen Kabadayi</a></p><h3>References:</h3><p>Cisco. (n.d.). <em>What is application security?</em> Cisco. Retrieved May 11, 2025, from <a href="https://www.cisco.com/c/en/us/products/security/what-is-application-security.html">https://www.cisco.com/c/en/us/products/security/what-is-application-security.html</a></p><p>Google Cloud. (n.d.). <em>Application security in Google Cloud.</em> Google. Retrieved May 11, 2025, from <a href="https://cloud.google.com/security">https://cloud.google.com/security</a></p><p>IBM. (n.d.). <em>What is application security?</em> IBM. Retrieved May 11, 2025, from <a href="https://www.ibm.com/topics/application-security">https://www.ibm.com/topics/application-security</a></p><p>Microsoft. (n.d.). <em>Microsoft Security Development Lifecycle (SDL).</em> Microsoft. Retrieved May 11, 2025, from <a href="https://www.microsoft.com/en-us/securityengineering/sdl">https://www.microsoft.com/en-us/securityengineering/sdl</a></p><p>NIST. (2022). <em>Secure Software Development Framework (SSDF) Version 1.1.</em> National Institute of Standards and Technology. <a href="https://doi.org/10.6028/NIST.SP.800-218">https://doi.org/10.6028/NIST.SP.800-218</a></p><p>OWASP. (n.d.). <em>About the OWASP Top Ten Project.</em> OWASP Foundation. Retrieved May 11, 2025, from <a href="https://owasp.org/www-project-top-ten/">https://owasp.org/www-project-top-ten/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf19fbc39be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[TR] Bir yazılımcının en yakın dostu: DEBUGGING]]></title>
            <link>https://alperenkabadayi0110.medium.com/tr-bir-yaz%C4%B1l%C4%B1mc%C4%B1n%C4%B1n-en-yak%C4%B1n-dostu-debugging-050fe1d8944a?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/050fe1d8944a</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[debugger]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[soft-skills]]></category>
            <category><![CDATA[debug]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 00:32:34 GMT</pubDate>
            <atom:updated>2025-01-12T00:32:34.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FFgWFY-zVZbB3Zvg" /><figcaption>Photo by <a href="https://unsplash.com/@ziemer?utm_source=medium&amp;utm_medium=referral">Paulo Ziemer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Bir yazılımcı olarak akademik eğitim almış olsak dahi alaylı bir bakış açısına sahip olmazsak eğer pratik konularda geride kalabiliyoruz. Aslında etraftan hangi mesleği icra ediyor olursak olalım sürekli duyduğumuz “kendini geliştirmek” ve “hayat boyu öğrenmek” mottolarının yazılımcılar için en etkili ve yardımcı araçlarından biri olan debugging yapmanın önemi hakkında yazıyor olacağım bu yazıda. Etimoljik olarak incelenmesi veya ne zaman/nasıl başladığına dair detayları çok kolay şekilde wiki’den dahi bulabileceğimiz için ve yazıyı uzatmamak adına benim hayatımda ne gibi bir önemli etkisi oldu, Mesleğimin başında bana neler kazandırdı ve şu anda nasıl kullanıyorum bundan bahsediyor olacağım.</p><p>Genellikle iş hayatına başlamadan önce akademik kurumlarda veya hobi projelerimizde bir projenin mimarisini kendimiz oluşturuyoruz. Bu nedenle projenin genel yapısına hakim olabiliyoruz. Bir kod bloğunu değiştirdiğimizde genelde nerenin etkilenebileceğini ve nerelerin değişebileceğini çok uzun süre düşünmeden tahminleyebiliyor ve çıktılarının yapacağımız değişikliklerle birlikte neler olacağını öngörebiliyoruz. Bu nedenle küçük ölçekli projelerde ve sıfırdan başlanılan projelerde debugginge genelde ihtiyaç duyulmayabiliyor. Fakat e-ticaret, erp, crm gibi daha birçok ticari projelerde binlerce satır kod bulunuyor. Bu yapılar genelde sıfırdan kurgulamadığımız için daha önceden yazılmış olan kodların bulunduğu kod yapıları üzerine inşa edilmiş oluyorlar ya da biz sonradan dahil oluyoruz bu projelere. Bu aşamada bir projeyi anlamak için debugging inanılmaz yardımcı bir yöntem oluyor. Mesleğe başladığım ilk yılları hatırlıyorum ve bu yöntemi biliyor ve uygulayabiliyor olmanın kodlamadan öte yazılımın arkasındaki sistemlerin birbiriyle kurduğu ilişkiyi anlamlandırmama oldukça yardımcı olduğunu anımsıyorum. Aynı zamanda, ticari projeler genellikle(hatta her zaman) gerçek hayattaki bir problemi çözmek için geliştirilirler. Debugging sayesinde kodlarla hangi gerçek hayat problemini çözdüğünüzü anlamlandırmanız da oldukça kolay oluyor.</p><p>Debugging yapmanın ilkel ve modern birçok metodu vardır. İlkel metodlarını fark etmeden dahi olsa kesinlikle yeni başlayan hatta bir sır olmasa bile uzman bir yazılımcı dahi ara sıra ya da sık sık kullanıyor. Örneğin bir programda aralarda bu değişkenin hafızada aldığı değer ne diye merak edip aralara serpiştirdiğimiz “print(value)” da ilkel bir debugging yöntemi diyebiliriz. diğer ve daha efektif debugging yöntemi ise ide’lerin yazılımcıların işini kolaylaştırarak bir yardımcı araç olarak ortama entegre etmiş olduğu breakpoint kullanarak debugging yapmak da en yaygın yöntemlerden birisi. Bunun dışında monitoring ve logging toolarını yazılıma entegre etmek ve kullanmak da aslında modern yazılımlarda benim gözlemime göre üç ana yardımcı sebeple kullanılmakta. Birincisi bir problem olmadan önce verileri gözlemleme ve sorun oluşturabilecek noktalara müdahale etme ayrıcalığı vermek. İkincisi problemin oluştuğu veya oluşmak üzere olduğu noktalarda alerting mekanizmalarını devreye sokarak hatanın hızlı şekilde düzeltilebilmesini sağlamak. Üçüncüsü ise genelde çok karşılaşılmasa dahi alerting kurallarına takılmamış fakat hata gerçekleşmiş olmasına rağmen geriye dönük bir post mortem yapma ve hatanın kök nedenini bulabilme yetisini yazılımcıya sağlamak.</p><p>Bir yazılımcı, bir ekonomist, bir su tesisatçısı ve ticari iş yapan diğer bütün meslekler bir sorun çözmesi üzerine para kazanırlar. fakat şunu da göz ardı etmemeliyiz, bilgi sektöründe çalışan insanlar sorun çözme konusunda çok daha proaktif ve donanımlı olmalılar. Çünkü, problemler yaşanmış ve çözümü payaşılmış olsa dahi ürünler gelişmeye devam ediyor ve her geçen gün sorunlar da çeşitleniyor. Bu nedenle nasıl problemlerin tek bir çeşidi yoksa problemleri çözmenin de tek bir yöntemi yoktur. Debugging belirli problem uzayını çözümlemede oldukça yardımcı bir yöntem olsa dahi her problemi debugging ile çözmek de hiç mantıklı olmayacaktır. Yani bu noktada yapılacak çıkarım şu şekilde olmalı: Kavramlar, konseptler, araçlar her zaman değişiyor olacak. Bunlar konusunda fanatik olmamalıyız ve yeni gelen şeylere(adı konmamış gelecekteki tüm araç ve yöntemler) hızlıca adapte olup bir yarar zarar denge analizi yapıp nerelerde kullanılabileceğini anlayıp oralara entegre edebilir yetkinlikte olmalıyız. Belirli noktalarda debugging oldukça mantıklı olabiliyorken, eğer kod olması gerekenden çok çok daha karmaşık ve düzensizse yöntemin kullanılabilmesini engelleyen problemi(bu örnek için kodun karmaşık olması) ortadan kaldırmalıyız.</p><p>Ayrıca debugging bir ide’de breakpoint koyarak adım adım hatayı bulma veya kodun ne yaptığını anlamaktan daha geniş bir anlama sahip. Örneğin unit test, integration test gibi test yöntemler de debugging kavramı başlığı altında yer alıyor. Rubber duck debbuging denen kodu bir objeye veya bir çocuğa açıklar gibi incelemek de debbuging yöntemlerinden birisi. Yazılımda yaşanan kazalar bazen katastrofik olabiliyorlar. Mesela önemli sistemlerin kesilmesi inanılmaz maddi hasara hatta bazen hayati risklerin ortaya çıkmasına sebep olabiliyor. Örneğin google servislerine 2013 de 5 dakika kadar erişilememesinin bedeli google’a yaklaşık 500 bin dollar oldu. Piyasaya ise daha yüksek zararı olduğu tahmin ediliyor. Bu nedenle bir yazılımcının etik olarak en büyük sorumluluğu kaliteli bir yazılım ortaya koymaktır.</p><p><a href="https://www.businessinsider.com/google-goes-down-2013-8">Detaylı incelemek isterseniz bununla ilgili yazılmış olan makale için tıklayın</a></p><p>Tabiki debugging kavramı çok geniş bir kavram olduğu için bunu bir medium yazısında öğretmek veya detaylarıyla nasıl yapılacağını ele almak çok mümkün değil. Bu yazıyı yazmamın sebebi ise bazı kavramlara farkındalık kazandırmak ve mesleğimin başında hangi araçların/yöntemlerin bana yardımcı olduğunu sizinle paylaşmak. Bunu bir seri halinde ilerletmeyi düşünüyorum. Mesleğin başında yaşamış olduğum zorluklar nelerdi ve bunları nasıl çözümledim, hatta gerçek hayatta büyük bir yazılımda karşıma çıkan problemler nelerdi ve bunları nasıl çözdüğümle ilgili de yazılar paylaşacağım. Bir kişi bile farkındalık kazansa veya yararlansa pastayı paylaşmış olmaktan mutluluk duyacağım :) Diğer yazıları kaçırmamak ve beni desteklemek için beni mediumdan takip edebilirsiniz.</p><p>Sonuç olarak, yazılımda önemli sorun çözme yaklaşımlarından birisi olan debugging kavramlarını dilim döndüğünce, klavyem yazdığınca açıklamaya çalıştım. Herkese bugsız, bol bol para kazandığı ve bilgilerini paylaştığı günler diliyorum. Görüşmek üzere👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=050fe1d8944a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A short review on a weekend project]]></title>
            <link>https://alperenkabadayi0110.medium.com/a-short-review-on-a-weekend-project-5e2fc701f01e?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e2fc701f01e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[project-based-learning]]></category>
            <category><![CDATA[adaptability]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[boxing]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Sat, 16 Nov 2024 14:44:27 GMT</pubDate>
            <atom:updated>2024-11-16T14:44:27.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAGhDpyP7cqrXbUcxMyC2g.png" /><figcaption>Mike vs Paul</figcaption></figure><p>As everybody knows, M. Tyson and J. Paul organized a boxing match. One of the opponents is a veteran boxer who has won many prizes. The other is a famous entertainer, boxer, and actor. There is no doubt that this match will be a trending topic in the world. Also, we know they have already estimated what will happen, which is how much money they will make.</p><p>The mechanisms of the world and environment have been changing since humans existed. Human intelligence and consciousness are the most essential key reasons for this change. For instance, concepts of money, debt, management, and emotions have changed and will be changing until the world ends. Why I am mentioning that is these entertainers understand and also, keep pace with these changes. I am not discussing whether it is correct or not. However, they can do this successfully.</p><p>In my opinion, this match was a response that was raised by a request. They analyzed gaps in the sector and they organized this match, perfect or horrible, artificial or real. They implemented Darwin’s rules into their lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OiwX0tMJT0Lp0oUa" /><figcaption>finches</figcaption></figure><blockquote><strong>Adaptation</strong><br>This development of traits in organisms over successive generations better enables them to survive and reproduce in their environment, such as finches developing distinctive beak shapes to exploit available food sources. Such characteristics are ‘selected for’ and become more prevalent in the population.</blockquote><blockquote><strong>Survival of the Fittest </strong><br>Individuals who are better adapted to their environment, having acquired certain advantageous features, would survive better and have more offspring. With this, the process of evolution would speed up to promote the survival of traits that raise the convention of fitness.</blockquote><p>I attended a seminar called “ChatGPT” a rather useful seminar. Mr. Rob Miles was a lecturer at the seminar. We all accept that chatgpt has changed our lives and the changes go on. However, Mr. Miles emphasized an awesome issue. We are not going to protest these changes by going to city squares, nor are we going to accept them as they are. We must understand these systems to use them effectively and also ethically. Also, If someone who wants to change a system or to build a structure ignores them, would they be successful?</p><p><a href="https://www.robmiles.com/journal/2024/11/13/chatgpt-rather-useful-seminar">Click for seminar presentation</a></p><p>My first objective in creating this weekend’s hobby project was just to have fun and show myself that I can do that in a short with the support of AI (of course AI supported me, do not be naive). the second aim was to learn different technics or methodological aspects of AI. I did not pay attention to the structure of the project, maintainability, or some fancy technical concepts because I had just decided to develop a weekend hobby project. The outcome met with objectives.</p><p><a href="https://mike-paul.up.railway.app/">https://mike-paul.up.railway.app</a></p><p>It may be the grand boxing bout, it may be the evolution of ideas, or it may be the simple project of a weekend hobby, but running through them is the thread of progression: Tyson and Paul adjusting to the entertainment-driven economy, the finches to their natural environs, and I to the huge possibilities the AI opened to my creation. These are not isolated incidents but interrelated fragments of a world created by intelligence, creativity, and the will to survive. The message is simple yet deep: to make it in life, we have to whether it be in the ring, in our way of thinking, or our endeavors.</p><p>I would like to end my article with a sentence from a famous Turkish author.</p><blockquote>“Karanlıkları devirmek ve aydınlık bir çağın kapılarını açmak için en mükemmel silah kalemdir”</blockquote><blockquote>-Cemil Meriç</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e2fc701f01e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to upgrade expo sdk version]]></title>
            <link>https://alperenkabadayi0110.medium.com/how-to-upgrade-expo-sdk-version-b59d2939265?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b59d2939265</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[expo-sdk]]></category>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[expo]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Mon, 08 Aug 2022 23:11:01 GMT</pubDate>
            <atom:updated>2022-08-08T23:17:01.818Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ab2vsey3ChtjOWkF" /><figcaption>Photo by <a href="https://unsplash.com/@ffstop?utm_source=medium&amp;utm_medium=referral">Fotis Fotopoulos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Expo has announced that upgraded version for 46. After that If you have an application that is working on 43 or lower, need to upgrade the expo version to higher versions of the expo as developers. Actually, it is not a complicated operation, but it might be beneficial someone at somewhere. Firstly, if you don’t have expo cli, you can download it with this command:</p><pre>npm install -g expo-cli</pre><p>And then you need to check your expo cli version. You can use this code snippet:</p><pre>expo --version</pre><p>package.json has the information that includes you have which version expo sdk. You can upgrade your expo version to specific version SDK of ones. After work the code that is at below, all dependencies and expo sdk version will be calibrated to appropriate one.</p><pre>expo upgrade 46 =&gt; you can enter specific sdk number here</pre><p>Coming across with some package conflicts is possible in this step. Choosing correct package and version with the new expo version will be resolved the problem. Can find detailed blog posts by expo:</p><p><a href="https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/">https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/</a></p><p>That is all now. See again at the new blog post. HAVE BUGLESS CODES.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FQNFhOolVeCzPQ2Mx85%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FQNFhOolVeCzPQ2Mx85%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExOG5kMzd4aDI4dTlieTU4OTBqdm91N3R3a2dqN3U3dDIzc3Q3NzlvaSZlcD12MV9naWZzX2dpZklkJmN0PWc%2FQNFhOolVeCzPQ2Mx85%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="246" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c80ca27351469987bc3d3feda596cc5/href">https://medium.com/media/3c80ca27351469987bc3d3feda596cc5/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b59d2939265" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nesneye Yönelik Programlamada Temel Kavramlar]]></title>
            <link>https://alperenkabadayi0110.medium.com/nesneye-y%C3%B6nelik-programlamada-temel-kavramlar-d0d31db49eee?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d31db49eee</guid>
            <category><![CDATA[oop-temel-kavramlar]]></category>
            <category><![CDATA[nesne-yönelimli]]></category>
            <category><![CDATA[nesneye-yönelik-prog]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 13:21:39 GMT</pubDate>
            <atom:updated>2021-04-07T10:30:01.466Z</atom:updated>
            <content:encoded><![CDATA[<p>Nesneye yönelik programlamada çok sık söz edilen ve yazılımın test aşamasında kolaylık sağlayan temel nesne tabanlı tasarım kalıpları vardır. Bunları ifade ederken herkes her ne kadar farklı anlatım yöntemleri kullanılsa da aslında tek bir amaç ve tek bir anlam vardır. Ben de bunları tamamen kendi anlama ve anlatım şeklimi kullanarak ifade edeceğim. Yazı yazım sürecimde yapmış olduğum kaynak taraması aşamasında kullandığım kaynakları yazının sonuna ekleyeceğim. Şimdiden iyi okumalar. Encapsulation ile başlayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*0PiKOVy1HV8xnhMIrYNVrA.png" /><figcaption>Nesneye yönelik programlama konsepti</figcaption></figure><h3>Encapsulation</h3><p>Nesneye yönelik programlamada public field’lara ve metodlara başka bir classtan ulaşırken nokta kullanırız. fakat bir data tipi için access modifiers olarak private kullanılırsa ona sadece class içinden erişilebilir. Encapsulation da burdan sonra devreye giriyor. Eğer biz bir A sınıfı içersinde tanımladığımız private fielda, B sınıfından ulaşmak istersek encapsulation kullanabiliyoruz. A sınıfı içerisinde erişilmek istenen field için public <strong>Getter</strong> ve <strong>Setter</strong> propertyleri oluşturarak B sınıfından “.” belirteciyle ulaşabiliyoruz. İki tane farklı property yazmamızın sebebi ise; bu fielda read-only ve write-only propertyleri ile iki farklı şekilde ulaşmak daha güvenilir bir yöntem olduğu için. Eğer sadece okumak, ekrana basmak gibi işlemler için kullanılacaksa getter propertysini eğer işlem yapmak, değiştirmek gibi işlemler için kullanılacaksa setter propertysini kullanırız. Teknik olarak encapsulation’ın ne olduğundan bahsettik. Pratikte nasıl olduğunu da C# dilinde örneklemiş olalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b529f632c7ff3782878303c91fe7ec0/href">https://medium.com/media/2b529f632c7ff3782878303c91fe7ec0/href</a></iframe><h3>Inheritance</h3><p>Nesneye yönelik programlama konseptinde bir sınıftan fieldlar ve methodlar kalıtılabilir. Bunun gerekliliği olarak da iki tane kavram oluşuyor. Türetilmiş sınıf ve ana sınıf. Ana sınıf içerisinde temel fieldlar ve methodlar yazılır. Türetilmiş sınıf ise ana sınıftan kalıtılarak özelliklerini alıyor ve özelleştirilebilir bir sınıf temeli oluşturuyor. Nesneye yönelik programlamada dünyadaki nesneler üzerinden anlatım yapmak işi biraz daha kolaylaştırıyor. Çok fazla duyduğumuz ve javanın da dokümentasyonunda da bahsettiği bisiklet örneği bunu güzel örnekliyor. Mesela biz bunu bir kardan adam üzerinden örneklendirmeye çalışalım. kardan adam, kar ile yapılacağından dolayı bir kar sınıfı oluşturalım. Ve burda kar’ın genel özelliklerini yazalım. Örneğin rengi beyazdır. Sulu olursa kardan adam yapılamayacağı için karın sulu olmayacağını belirtelim ve karın üstüne basarsak çıkan ses kardan adamı ezersek de çıkacaktır, bunu belirten de bir method yazalım. Daha sonra da kardan kalıtılan kardan adam classına birkaç ek özellik ekleyerek örneklendirmeyi tamamlayalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27de07538dc67dda3f22f57816dd399d/href">https://medium.com/media/27de07538dc67dda3f22f57816dd399d/href</a></iframe><p>Tabiki çok çeşitli kalıtım yöntemleri var(hiyerarşik, hibrit vs. ). Biz sadece single inheritance’a bir örnek yaptık. Ve not olarak classlar sadece bir tane class extends edebilirler.</p><h3>Polymorphism</h3><p>Nesneye yönelik programlamada normal şartlarda isimleri birbirinden farklı metodlar üretmemiz gerekir. Eğer kalıtım yöntemiyle aynı isime sahip metodları çalıştırmaya çalışırsak beklendiği gibi bir durumla karşılaşmayız. Mesela bir sınıf üretmiş olalım. İsmi de A sınıfı olsun. A sınıfının içerisinde b isimli bir metod olsun. Ve yine bir C isimli sınıf oluşturup C sınıfını A sınıfından kalıtalım. Şimdi aynı zamanda C sınıfının içinde A sınıfındakiyle aynı imzaya sahip bir b metodu daha yazalım. A ve C sınıfından birer nesne oluşturup b metodlarını gerçeklersek sadece Base classtaki b metodu iki defa çalışmış olur. Kod olarak incelersek:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b21f1ecd0a85acb9ff16c1aacda43de7/href">https://medium.com/media/b21f1ecd0a85acb9ff16c1aacda43de7/href</a></iframe><p>örnekte de görüldüğü aynı isime ve imzaya sahip iki metodu çalıştırdığımızda bir diğerini yok sayarak çalıştığını gözlemliyoruz. Ve sonuç istediğimiz gibi çıkmıyor. Fakat bu bize aynı isme veya imzaya sahip metodları kullanamayacağımızı göstermez. Bu aşamada polymorphism denen nesneye yönelik programlama kalıbını devreye sokarak bu problemden kurtulabiliyoruz. Polymorphismi kullanırken <strong>overriding</strong> ve <strong>overloading</strong> yöntemlerini kullanırız. Fakat override kullanılırken base class da <strong>virtual</strong> veya abstract bir class olmalı. Abstractiondan da ilerde bahsedeceğim.</p><p><strong>overriding:</strong> Kalıtılan bir metodu aynı imzaya sahip aynı isimli başka bir metodla değiştirme.</p><p><strong>overloading:</strong> Farklı imzalı fakat yine aynı isme sahip birden fazla yöntem üretilmesi.</p><p><strong>virtual: </strong>Eğer bir sınıf için kullanıldıysa o sınıfın nesnesi direk olarak oluşturulamaz. Nesnenin oluşturulması için override edilmesi gerekir. Aynı kurallar virtual metodlar için de geçerlidir.</p><p>buradan yola çıkarsak yukarda verdiğimiz örnekteki problemi override sözcüğünü kullanarak çözüme kavuşturabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc9eac0bb1d170d68e415343cd34f56a/href">https://medium.com/media/fc9eac0bb1d170d68e415343cd34f56a/href</a></iframe><p>Peki neden böyle bir zahmete(!) katlanıyoruz. Bu durumda bunun iyi mi kötü mü bir durum olduğunu anlamak istersek yokluğunda ne gibi şeyler olacağını düşünebiliriz. Örneğin birden fazla benzer işler yapan sınıflar ve aynı işleri yapan metodları kullanacağımız bir yazılım düşünelim. Nasıl bir karmaşa ile karşılaşırız değil mi ? Örneğin bir banka yazılımında sürekli parakontrol1() , parakontrol2() gibi kendini tekrar eden ve test edilebilirlikten çok uzak bir program ile karşı karşıya kalırız. Böyle bir şeyi en azından kaliteli bir ürün ortaya çıkarmak isteyen hiçbir yazılımcı istememeli. Abstraction ile devam edelim.</p><h3>Abstraction</h3><p>Nesneye yönelik programlamada <strong>abstract sınıflar</strong> ve metodlar kullanarak sınıflar arası processler arası soyutlama sağlayabiliriz. Bazı hassas verilerle çalışacağımızda abstraction kullanırız. Biraz sihirbazlığa benziyor. Bir sihirbaz insanları şaşırtır, eğlendirir, bir hizmet sunar fakat asla numarasının arkasındaki sırrın bilinmesini istemez. Abstract classların içinde abstract olan veya olmayan metodlar tanımlanabilir. Abstract metodlar gövdesiz veya gövdeli olarak tanımlanabilir. Aynı zamanda abstract classlarda fieldlar tanımayabiliriz ve abstract classlar gerçekleştirilmek için başka bir class tarafından kalıtılmalılar. Diğer bir abstraction gerçekleştirme yöntemi ise <strong>interfaceler</strong> kullanmaktır. Interfaceler, abstract classlardan farklı olarak fieldlar içeremezler ve metodları gövdesiz olmak zorundadır. Peki ne zaman abstract classları ve ne zaman interfaceleri tercih etmeliyiz? Bunun çok katı bir yanıtı yok. Fakat bunu belirleyebileceğimiz bazı ipuçları var. Örneğin abstract classlar adından da anlaşılabileceği gibi tamamen class yapısından soyutlanmış abstraction yöntemleri değildir. Yani yapısı interfacelere göre biraz daha rahat olduğu için bir şeyler yapabilme yetisi vardır. Fakat interfacelerde bir şeylerin nasıl meydana getirileceği ile ilgili hiçbir yönerge yoktur. Sadece ne yapılacağını belirtir. Çeşitli senaryolarla birlikte tercih sebepleri de değişecektir böylelikle. Son olarak örnek kodları da anlaşılması açısından bırakayım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9054e73658e9b351e98b138c6e7af1bb/href">https://medium.com/media/9054e73658e9b351e98b138c6e7af1bb/href</a></iframe><h3><strong>Sonuç olarak</strong></h3><ul><li>Nesneye yönelik programlamanın temel yapısını oluşturan kavramları temel olarak inceledik.</li><li>Kodlar üzerinde örnekler vererek açıklamaya çalıştık.</li><li>Kullanım senaryoları hakkında örnekler verdik.</li><li>Benzer kavramlar arasındaki farklardan bahsettik.</li></ul><h3>Dipnot:</h3><p>Nesneye yönelik programlamadaki temel kavramlar her ne kadar iyi biliniyor olsa da kodlar ile haşır neşir olmadan anlaması zor bir kavram haline geliyor. Bu nedenle siz de GitHub da her bir örnek için gist oluşturarak benim oluşturduğum kodlardan daha detaylı örnekler yapabilirsiniz. Hatta bunu günlük hayattaki bir projeye uyarlayarak bir proje oluşturursanız iyi bir deneyim olur diye düşünüyorum.</p><p>kaynak:</p><ul><li>Daniel Liang -introdction to java programming</li><li><a href="https://www.w3schools.com/">https://www.w3schools.com/</a></li></ul><h3><strong>Teşekkürler</strong>💐</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d31db49eee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis Nedir? Node.js İle Nasıl Kullanılır?]]></title>
            <link>https://alperenkabadayi0110.medium.com/redis-nedir-node-js-i%CC%87le-nas%C4%B1l-kullan%C4%B1l%C4%B1r-43bbef52488b?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/43bbef52488b</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[fast]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Tue, 08 Sep 2020 06:55:29 GMT</pubDate>
            <atom:updated>2020-09-08T06:55:29.084Z</atom:updated>
            <content:encoded><![CDATA[<p>Bu yazıda, <strong>Redis</strong> teknolojisinin ne olduğu, ne gibi durumlara cevap vermek için ortaya çıktığı ve <strong>node.js</strong> ile kullanımının nasıl olacağı gibi konulara değineceğiz. Veritabanı çeşitleri ve node.js hakkında temel düzeyde bilgiye sahip olmanız anlamanızı daha kolaylaştıracaktır. Eğer konu hakkında temel düzey bilgiye sahip değilseniz daha önce <a href="https://medium.com/u/3ab194855afe">Rıdvan Akca</a>’nın veritabanları ile ilgili yazmış olduğu güzel bir yazıyı okuyabilirsiniz.</p><p><a href="https://medium.com/hardwareandro/sql-veritabanlar%C4%B1-vs-nosql-veritabanlar%C4%B1-14216d894539">Sql Veritabanları vs NoSql Veritabanları</a></p><p>Hadi başlayalım.</p><h3>Redis Nedir?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*H58rhZeWP2b06Uvs-1STMw.png" /><figcaption>redis ikonu</figcaption></figure><p>Redis aslında bir veritabanıdır. Ama sıradan bir veritabanı değildir :). Ne diyor bu arkadaş diyor olabilirsiniz ama gerçekten öyle. Durumu biraz şöyle açıklayalım. <strong>Redis(REmote Dİctionary Server)</strong>, genellikle veri yapıları ile <em>memory</em>de çalışan <em>key-value</em> yapısı kullanan bir veritabanıdır. Sıradan bir veritabanı değildir dememin sebebi ise Redis’in çeşitli data tiplerini kullanışlı şekilde tutabilmesi ve gerçekten hızlı olması diyebiliriz. Peki nedir bu data tipleri ?</p><ul><li>stringler, hashler, listeler, setler, sorted setler, bitmapler, hyperloglogler ve geospitals gibi veri tiplerini depolayabilirler.</li></ul><p>Bu gibi tipleri dinamik olarak tutabilmek oluşturduğumuz çözümlerde bizi gerçekten güçlü kılıyor. Sürekli <strong>hız</strong>dan bahsediyoruz, peki gerçekten ne kadar hızlı bu redis?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*NS5_Ueqi3rQYdjJJLB6Bxg.png" /><figcaption>NoSQL and SQL Response Performance Comparison</figcaption></figure><p>Tablo gecikme(latency), operasyon hızı ve operasyon kalitesini içermektedir. <em>Yiftach Shoolman</em> abinin söylediğine göre kurum içi yaptıkları testlerde <strong>Redis</strong> , <strong>MySQL</strong>’i performans(latency) açısından <strong>~100</strong> e katlamış. Yani ufak bir hesap yaparsak MySQL’in 1 saniyede yaptığı işi redis ile sadece 0,01 saniyede yapabiliyoruz. Tabi ki bu değerler yazılımcının veritabanını ve veritabanı ilişkisini nasıl tasarladığına da bağlı olarak değişir fakat tablo için ortalama değerlerin gösterildiğini var sayarsak büyük sistemlerde Redis’in performansı gerçekten göz kamaştırıcı. Bunu yapmasını sağlayan şey ise Redis’in kullandığı <strong>cache</strong> mantığıdır.</p><h3>Cache Mantığı Nedir ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*OqWSHYLSrGCLjFdeyH7irA.gif" /></figure><p><strong>Cache</strong>in ne olduğunu anlatırken gerçek hayattan örneklendirme yaparak anlatmaya çalışacağım. Örneğin ofiste olduğumuzu düşünelim. Susadığımızda yapacağımız şey ne olur? Öncelikle yerimizden kalkarız, su sebilinin yanına gideriz, bardağımızı hazırlarız suyu doldururuz, yerimize geçeriz, suyu içeriz ve su içme ihtiyacımızı gidermiş oluruz. Baktığımızda süreç normal işliyor ve uzun gibi gelmemiş olaiblir fakat günde 3 litre su içmemiz gerektiğini düşünürsek bu işlem bizden çok fazla zaman götürür. Buna alternatif olarak bir çözüm geliştirmek istersek suyu masamızda bulunan sürahiye doldururuz ve kaybettiğimiz zaman neredeyse minimize olur. Şimdi sonuca doğru yaklaşırsak(teşbihte hata olmaz) buradaki örnekte su sebilini <strong>diske</strong>, suyu <strong>veriye</strong>, su içme işlemini <strong>veritabanı işlemine</strong>, sürahiyi de <strong>memorye</strong> benzetebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQ5s_wqQf6-5Jbqhi-I8UQ.png" /><figcaption>redis caching mechanism</figcaption></figure><p>Redisin cache mekanizmasını kullanması çok büyük firmaların redisi tercih etmesine yardımcı olmuş. Redisi kullanan firmalar arasında <strong>Twitter</strong>, <strong>Github</strong>, <strong>Snapchat</strong> ve <strong>StackOverflow</strong> gibi büyük firmalar da yer alıyor. <strong>Pinterest</strong>’in redisi milyarlarca ilişki için nasıl ve nerelerde kullandığını anlatan güzel bir yazıyı ekleyeyim.</p><p><a href="https://tanzu.vmware.com/content/blog/using-redis-at-pinterest-for-billions-of-relationships">Using Redis at Pinterest for Billions of Relationships</a></p><p><strong>Redisin avantajlarını maddeler halinde toplarsak</strong></p><ul><li>Gerçekten hızlı olması</li><li>zengin veri türlerini desteklemesi</li><li>işlemlerin atomik olması (örneklendireceğiz)*</li><li>açık kaynak olması</li><li>community desteği</li></ul><p><strong>Redisin kullanım alanlarına örnekler verirsek</strong></p><ul><li>oturumların depolanması</li><li>kuyruk yapılarının kullanıldığı alanlar</li><li>LRU(least recently used) yapısının kullanıldığı yerler</li><li>leaderboardlar</li><li>lock mekanizmaları bulunduran yerler</li></ul><p>şeklinde maddeler halinde özetleyebiliriz. Redis hakkında bu bilgileri öğrendikten sonra artık yavaş yavaş redisin kurulumu ve kullanımı hakkında biraz bahsedelim. Windows kullanan kullanıcıları baz alarak kurulum işlemini anlatacağım. Diğer işletim sistemlerini kullananlar redisin websitesindeki downlaod adımlarını izleyerek kurulum yapabilirler.</p><ul><li>Redis github sayfasına gitmek için <a href="https://github.com/redis/redis"><strong>tıklayın</strong></a>.</li><li>Redis download sayfasına gitmek için <a href="https://redis.io/download"><strong>tıklayın</strong></a>.</li></ul><h3>Kurulum</h3><p>Windows kurulumunu yaparken Microsoft Archive den yaralanacağız.</p><p><a href="https://github.com/microsoftarchive/redis/releases">kurulum linki için tıklayın.</a></p><p>açılan sayfada <em>latest releases </em>a tıklayarak indirme sağlayın. İndirilen dosyaların içinde bulunan dosyalardan önce <strong>redis-server.exe</strong> yi daha sonra <strong>redis-cli.exe</strong> yi başlatın. daha sonra clientten <strong>PING </strong>mesajı gönderin. Eğer <strong>PONG</strong> geri dönütünü aldıysanız kurulumumuz tamaaam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*O4WVVGa4Aeexq2yMETohCw.png" /><figcaption>redis server-client communication</figcaption></figure><p>Rediste kullanılan tüm komutları inceleyebileceğiniz sayfa için <a href="https://redis.io/commands"><strong>tıklayın</strong></a>.</p><h3>Redisin Atomik Yapısının Örneklendirilmesi</h3><p>Atomiklik konusu bilgisayar bilimlerinde büyük önem taşır. Anlaşılması için bilgisayar komutlarnın memorye nasıl etki ettiğini bilmek gerekir. Bu kısımı anlatma sebebim Redis, atomik yapıyı kurup biz yazılımcıları atomik yapıyı kurarken karşılaşacağımız problemlerden uzak tutmuş ve kurtarmıştır. Eğer optimizasyonu sağlayamzsak büyük problemlerle hatta crashlerle karşı karşıya kalabiliriz. İşletim sistemleri de atomik yapıda olmalıdır. Bu yüzden işletim sistemleri de tasarlanırken atomik yapıya dikkat edilmelidir. Peki çok fazla atomik dedikten sonra :) bunu daha anlaşılır kılmak için redisin olası karşı karşıya kalabileceğimiz hangi problemi engellediğini örneklendirerek anlatalım.</p><pre>degisken = GET DBsayi     //veritabanındaki sayıyı degiskene atadık<br>degisken = degisken + 10     //degiskeni 10 artırdık<br>SET DBsayi degisken     //degiskeni veritabanına yolladık</pre><p>Buraya kadar bir problem yok. Fakat iki tane clientin(prosesin) aynı anda veritabanında bu değişikliği yapmak istemesiyle problem başlıyor. Diyelim ki veritabanındaki sayının değeri 100 olsun. Aynı anda clientlerin request yapması durumunda gerçekleşecek durumlara sırasıyla bakalım.</p><ul><li>Client-1 DBsayi degerini 100 olarak okur.</li><li>Client-2 DBsayi degerini 100 olarak okur.</li><li>Client-1 degiskeni 10 arttırır ve 110 olarak veritabanına yollar(set).</li><li>Client-2 degiskeni 10 arttırır ve 110 olarak veritabanına yollar(set).</li></ul><p>Durumda da görüldüğü gibi 120 olması beklenen degisken 110 olarak veritabanına yollanıyor. Bunu işletim sistemi düzeyinde çözmeye kalktığımzda mutexler ve semaphorelar gibi kavramlara hakim olmamız gerekir ki redis bizi bundan kurtarıyor. Tek yapılması gereken <strong>INCR </strong>komutunu kullanmak. Ve bu sayede race condition yaşanıp yaşanmayacağı hakkında düşünmemize bile gerek kalmaz.</p><h3>Redis İle Giriş Seviyesi Örnek</h3><p>Ben herhangi bir şeyi önce okuma yaparak daha sonra ise bol bol pratik yaparak öğrenmeyi düstur edinenlerdenim. Eğer buraya kadar okuduysanız Redis hakkında belli düzey bilgiye sahip olduğunuzu düşünüyorum. Fakat pratiğe dökülmemiş bilginin hiçbir şey ifade etmediğini Anton Çehov Şöyle açıklıyor.</p><blockquote>Knowledge is of no value unless you put it into practice.</blockquote><blockquote>-Anton Çehov</blockquote><p>Biraz hayata dair konuştuktan sonra şimdi tekrar redise dönelim :)</p><p>Daha önce bahsettiğimiz ve benim de Rediste en çok beğendiğim özelliklerden biri olan çeşitli yapılardaki verileri depolayabilme özelliği üzerinden bir örnek gerçekleştirelim. İlk önce redis serverını ayağa kaldıralım ve <strong>redis-cli </strong>açalım. Bir veri tabanında Sorted Set yapısını kullanarak kullanıcı isimlerini ve değerlerini tutalım ve ekranda görelim. Örneğin veritabanlarının isimlerini ve hızlarını(ms cinsinde) karışık olarak listeye ekleyelim ve sıralı olarak geri dönüt alalım. Kullanacağımız komutlar <strong>ZADD</strong> ve <strong>ZRANGE</strong> komutları. İsimlerinden de anlaşılacağı gibi ZADD komutu ile ekleme yaparız. ZRANGE komutu ile ise sorted seti bize geri döndürür. sırasıyla ZADD komutu ile aşağıdaki resimde bulunan adımları takip ederek ekleme işlemini yapalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*WkBbcSKcxqepbtOLJArFrQ.png" /><figcaption>sorted set ekleme işlemi</figcaption></figure><p>Databases keyini verdiğimiz alana önce milisaniye cinsinden temsili hızları sonra ise veritabanı ismini yazarak ekleme yapıyoruz. ZRANGE komutunu kullanırken ise <strong>key</strong>den sonra index vermemiz gerekiyor. ilk verdiğimiz index görmek istediğimiz aralığın başlangıcını belirten index olacak. ikinci index ise bitiş indexin değeri olacak. Fakat indexleri belirlerken negatif değerler kullanabiliyoruz. Bu ise sondan n. index manasına geliyor. Yani</p><blockquote>ZRANGE Databases 0 -1</blockquote><p>yazdığımızda diyoruz ki bana ilk değerden başlayarak sondan bir önceki indexe kadar bütün verileri getir. Umarım burası güzel anlaşılmıştır. Pratik yapmanızı tavsiye ediyorum. Eğer biz bütün değerleri görmek istersek. Aşağıda görünen resimdeki gibi bir görüntüyle karşılaşacağız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*INaw67oWxtslBAVn3MV_jA.png" /></figure><p>Sıralı bir şekilde bütün değerleri ekrana bastık. Eğer bir değer aralığı belirleyerek sonuçları görmek istersek ne yapacağız. Meslela ben sadece 0.2 milisaniye ile 10 milisaniye arasında hizmet veren veritabanlarını görmek istiyorum dersek. O zaman da <strong>ZRANGEBYSCORE Databases 0.2 10</strong> komutunu kullanırsak istediğimiz sonuca varırız. Sonuç olarak bir veri yığınını sıralı tutmanın bile çok kolay olduğunu gördük. Daha önce de paylaşmış olduğum redisin komutlarını dökümente ettiği sayfayı inceleyerek kendinizi daha fazla örneklere geliştirebilirsiniz. Ayrıca bahsetmek istediğim bir konu da windows kulanıcılarının arayüz kullanma alışkanlığından dolayı arayüz içeren bir uygulama edinmek isterseniz <strong>redis desktop manager</strong>i edinebilirsiniz. Websitesinden pricinge bakabilirsiniz. Daha fazla konuyu dağıtmadan Redisin Node.js ile nasıl kullanılacağına geçelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*S8vK1x4tXx4wvjG9ACnfDQ.gif" /></figure><h3>Node.js+Redis Kullanımı</h3><p>Buradaki örneği fikir vermesi amacıyla gerçekleştireceğiz. Temel amacımız redisi node.js e implement etmek ve temel seviyede bir örnek oluşturmak. Redisi Node.js e nasıl implemente edeceğimiz ile başlayalım. Öncelikle bir Node.js projesi oluşturalım. Ardından express kullanarak bir server kuralım. Taslak olarak aşağıdaki kodları ekleyebilirsiniz.</p><pre>const express = require(&#39;express&#39;);</pre><pre>const app = express();</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {</pre><pre>res.send(&#39;Selam Arkadas!&#39;);</pre><pre>});</pre><pre>app.listen(3000, () =&gt; {</pre><pre>console.log(&#39;REDIS için baslatildi...&#39;);<br>});</pre><p>ardından localhost:3000 de projenin sıkıntısız çalıştığını test ettikten sonra redis kütüphanesini ekleyelim. komut satırına:</p><pre>npm install redis      </pre><p>yazıp redis kütüphanesini ekledikten sonra geliştirmiş olduğumuz kodlara redisi implement etmek için aşağıdaki kodları ekleyelim.</p><pre>var redis = require(‘redis’);</pre><pre>var redisclient = redis.createClient();</pre><p>bunları da ekledikten sonra redis serverin sağlıklı çalışıp çalışmadığını kontrol etmek için aşağıdakileri de ekleyelim.</p><pre>redisclient.on(‘connect’, function () {</pre><pre>console.log(‘Redis baglandi’);</pre><pre>});</pre><pre>redisclient.on(‘error’, function () {</pre><pre>console.log(‘Redis saglikli calismiyor‘);</pre><pre>});</pre><p>Daha sonra redis-serveri ayağa kaldırıp bir deneme yaparsanız aşağıdaki gibi bir ekranla kaşılaşmanız gerekiyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*PxB_2rtBK3HDT04UzWe_Aw.png" /><figcaption>redis succeed connected</figcaption></figure><p>Daha önce yaptığımız redis örneğinde sortedsetleri örneklendirmiştik. Bu sefer ise listlerle ilgili bir örnek yapalım. Ben burada redise ekleme işlemini el ile yapacağım fakat siz bunu kendi projeniz için handle ederek kullanabilirsiniz. Databases keyi ile “redis” ve “memchaced” valuelarını ekleyelim. Daha fazla value da ekleyebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*RfJvsASfTrPpnuSEsfVAgQ.png" /><figcaption>a view on redis desktop manager</figcaption></figure><p>sonra node.js’e gelerek</p><pre>var databases= [];</pre><pre>redisclient.lrange(‘databases’, 0, -1, function(err, reply) {</pre><pre>console.log(reply); // [‘redis’, ‘memchaced’] From db</pre><pre>databases.push(reply);</pre><pre>});</pre><p>kod parçasını ekleyelim. Daha sonra yeni bir app.get ekleyerek “/redis” e gidildiğinde redisteki verileri ekranda görüntüleyen bir yapıyı tamamlamış olalım. Aşağıdaki kod parçasını da ekledikten sonra son adımı da tamamlamış oluyoruz.</p><pre>app.get(‘/redis’, (req, res) =&gt; {</pre><pre>res.send(databases);</pre><pre>});</pre><p>serverlarımızı ayağa kaldırıp gerekli adımları uyguladıktan sonra görmemiz gereken veriler aşağıdaki şekilde olmalı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*r2qbHLMyrLg7t6A3lWI2SQ.png" /></figure><p>Yaptıklarımızı özetlersek.</p><ul><li>Node.js server tasarladık</li><li>express pakedini import ettik</li><li>redis pakedini import ettik</li><li>redis bağlantısını kontrol ettik</li><li>manuel olarak bir list oluşturduk</li><li>redisteki verileri ekranda görüntüledik</li></ul><p>Burada yaptıklarımız sadece fikir vermesi açısından temel seviyede redis node.js kullanımının nasıl yapılacağını anlatan bir yapı oldu. çok daha optimize yapılar kurulabilir. Kodları incelemek isterseniz <a href="https://github.com/alperenkbd/Nodejs-Redis-practise/tree/master">tıklayın</a>. Böylece bu yazımızın da sonuna gelmiş olduk. Sabredip okuduğunuz için teşekkürler.</p><p><strong>Yararlanılan kaynaklar:</strong></p><ul><li><a href="https://redislabs.com/blog/the-proven-redis-performance/">https://redislabs.com/blog/the-proven-redis-performance/</a></li><li><a href="https://www.sitepoint.com/using-redis-node-js/">https://www.sitepoint.com/using-redis-node-js/</a></li><li><a href="https://redislabs.com/lp/node-js-redis/">https://redislabs.com/lp/node-js-redis/</a></li><li><a href="https://tanzu.vmware.com/content/blog/using-redis-at-pinterest-for-billions-of-relationships">https://tanzu.vmware.com/content/blog/using-redis-at-pinterest-for-billions-of-relationships</a></li><li><a href="http://www.borakasmer.com/nodejs-uzerinde-redis-kullanimi-ve-refactoring/">http://www.borakasmer.com/nodejs-uzerinde-redis-kullanimi-ve-refactoring/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43bbef52488b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codelabs İle Temel Kotlin]]></title>
            <link>https://alperenkabadayi0110.medium.com/codelabs-i%CC%87le-temel-kotlin-a35c7e7bc6b6?source=rss-1c536c2eb1b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a35c7e7bc6b6</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[google-code-labs]]></category>
            <category><![CDATA[codelab]]></category>
            <dc:creator><![CDATA[Alperenkabadayi]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 13:16:57 GMT</pubDate>
            <atom:updated>2020-08-23T13:16:57.339Z</atom:updated>
            <content:encoded><![CDATA[<p>Yazı boyunca Codelabs nedir? temel bir Kotlin ön bilgisi için Codelabs tercih edilmeli mi? Codelabs ile temel kotline giriş gibi akıl kurcalayan sorulara, ve merak edilen konulara cevap aramaya çalışacağız.</p><h4>Codelabs Nedir?</h4><p>Codelabs’i kendi github repolarındaki nedir bu başlığı altında tanımlamak gerekirse, Eğitime <strong>‘yaparak öğrenme’</strong> yaklaşımını benimseyerek küçük bir grup google çalışanı tarafından <strong>gönüllü</strong> olarak hayata geçirilmiş bir projedir şeklinde tanımlıyorlar. Bu tanımlama ile kendi deneyimlerimi karşılaştırdığımda yaparak öğrenme yaklaşımını gerçekten baştan sona hissettim. Fakat sadece doğru yaparak değil bazen yanlış yaparak da temel mantığı kavratmaya yönelik bir sistematik geliştirilmiş. Yani sonuç olarak Codelabs, <em>Android</em>’den <em>sanal gerçekliğe</em>, <em>makine öğrenmesi</em>nden <em>Flutter</em>’a kadar geniş yelpazede konuda ‘yaparak öğrenme’ yaklaşımını benimseyerek öğretmeyi hedef alan bir öğrenim platformudur. Konuları ve eğitimleri daha detaylı incelemeniz için web sitesi linkini ve github codelabs toolları linkini bırakıyorum.</p><p>Codelabs website: <a href="https://codelabs.developers.google.com/">tıklayın</a></p><p>Codelabs github tools: <a href="https://github.com/googlecodelabs/tools">tıklayın</a></p><h4>Codelabs iyi bir seçim mi?</h4><p><strong>Kotlin</strong> için codelabs’i kullanan biri olarak şunu açıkça söylemeliyim ki Codelabsin diğer kurslarını kullanmak için sabırsızlanıyorum. Fakat yazılıma ve yeni bir yazılım dili öğrenmeye başlayacak olan birisinin sıkça duyduğu <strong>ingilizce şart</strong> sözünün doğruluğunu bu platform için de söyleyebiliriz. Fakat Codelabs kodları ve görselleri açıkça paylaşmış olduğu için anlaşılır bir yapı sunuyor zaten. Bir yazıda çok fazla takıldığınızda sağ tıklayıp açılan <em>popup </em>menüde <em>türkçe diline çevir</em> seçeneğine tıklayarak okuyabilirsiniz. Fakat en makul çözümü tekrar dile getirmiş olalım ingilizce bilmek.</p><h4>Codelabs ile temel Kotlin</h4><p>Başlangıç için Codelabs’in <a href="https://codelabs.developers.google.com/">websitesi</a>ne gidiyoruz. Ve bizi karşılayan sayfada Search bölümüne <strong>Android kotlin</strong> yazıp entera basalım. Bizi 3 tane section karşılayacak. ilk iki kısım Android studio’nun indirilmesi ve kullanılması ile ilgili üçüncü olan ise bizim asıl ilgileneceğimiz kotlinin temellerinin anlatılıdığı kısım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*ebcBjBNf9VSureW5ur3o8w.png" /><figcaption>Codelabs karşılama sayfası</figcaption></figure><p>eğer android studio yüklü değilse ve daha önce android studioda proje oluşturmadıysanız 1 ve 2 yazan kısımda starta basarak sol tarafta yer alan modülleri takip ederek kurulumu kolayca yapabilirsiniz. Ben direk 3. de yer alan <em>Android Kotlin Fundamentals: Welcome to the course</em> kısımından bahsedeceğim. 3. kısımda starta tıkladığımızda bizi solda 3 tane bölmesi olan bir ekran karşılayacak. 1. bölme kurs hakkında bilgi veren bölüm 2. bölme kursun hangi konuları kapsadığını gösteren bölüm 3. ve son bölme ise kursa başlayacağımız bölüm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*jGGSLq02NJamzErCRA_6Yg.png" /><figcaption>Codelabs kotlin karşılama ekranı</figcaption></figure><p>2. butona tıkladığımızda kursun hangi konuları işlediğini göreceğiz. Geliştireceğimiz ilk uygulama bir zar atma uygulaması. bu uygulamada bir image kaynağının nasıl projeye dahil edildiğini ve bir zar atma mantığı için temel <strong>kotlin</strong> algoritmasının nasıl kurulacağını göreceğiz. Codelabs’in en güzel özelliklerinden birisi de bütün projelerini detaylı ve anlaşılır bir biçimde github’da paylaşması diyebiliriz. Örneğin benim gibi projeyi harddiske kaydederken bir aksilik yaşayıp projeyi kaybettiğinizde üzülmenize gerek yok. kodlar github’da yer alıyor. ilk proje için paylaşılan dosyaları github üzerinde incelemek için <a href="https://github.com/google-developer-training/android-kotlin-fundamentals-apps/tree/master/DiceRoller">tıklayın</a>. Bir konuyu uygulama geliştirerek öğreten Codelabs adım adım açıklayarak ve uygalatarak bir geliştirme deneyimi sağlıyor. Mesela Layouts konusu için geliştirme sağlanırken ilk önce bir giriş kısmı, ardından uygulamanın nasıl gözükeceği ile ilgili bilgiler veriyor. Daha sonra ise size görevler vererek uygulamanın tamamlanmasını istiyor. En sonunda ise kodun çözümünü vererek size yapılabilecek <strong>challange</strong>lar ve <strong>homework</strong>ler veriyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*_ZTu_Bczei7EAMumuu-CIQ.png" /><figcaption>Layouts konusu databinding bölümü genel görünüm</figcaption></figure><p>Github kodlarını Solution code yazan kısımdaki bölmeden bulabilirsiniz. Şimdi ise bir task’ in baştan sona nasıl tamamlandığını inceleyelim.</p><h4>Tasklere Genel Bakış</h4><p><strong>Lesson 2:Layouts</strong>’da bulunan <a href="https://codelabs.developers.google.com/codelabs/kotlin-android-training-constraint-layout/"><strong>2.3 Constraint layout using the Layout Editor</strong></a><strong> </strong>kısmının<strong> </strong><a href="https://codelabs.developers.google.com/codelabs/kotlin-android-training-constraint-layout/#7"><strong>8. Task</strong></a>ine bir bakış atalım. Bu taskte temel olarak özetlemek gerekirse bir <em>textview</em>a tıklanılabilirlik özelliğinin nasıl kazandırıldığı anlatılıyor. ilk önce <em>styles.xml</em> dosyasının içinde textviewlara ve arkaplana beyaz rengi atanıyor ve kullanıcı tıkladıkça gerçek renklerinin ortaya çıkması sağlanıyor. Arkaplana beyaz rengini eklemek için ise <em>styles.xml dosyasının içinde whitebox</em> stylenın içine</p><pre>&lt;item name=&quot;android:background&quot;&gt;@android:color/white&lt;/item&gt;</pre><p>kodu eklenerek sağlanıyor. Daha sonra ise <em>MainActivity.kt </em>içinde <em>onCreate()</em> fonksiyonundan sonra <em>View</em> parametresini kullanarak <em>makecolored()</em> adında bir fonksiyon oluşturuyoruz. Bu fonksiyonun içinde <em>when()</em> yapısını kullanarak viewlara yeni backgroundlarını atayacağız. when() fonksiyonuna bir de else yapısını ekleyerek herhangi bir id bulunamaması durumunda yapılacak olanı belirteceğiz.</p><pre>private fun makeColored(view: View) {<br>   when (view.id) {<br>      <br>       <em>// Boxes using Color class colors for the background</em><br>       R.id.box_one_text -&gt; view.setBackgroundColor(Color.DKGRAY)<br>       R.id.box_two_text -&gt; view.setBackgroundColor(Color.GRAY)<br>       R.id.box_three_text -&gt; view.setBackgroundColor(Color.BLUE)<br>       R.id.box_four_text -&gt; view.setBackgroundColor(Color.MAGENTA)<br>       R.id.box_five_text -&gt; view.setBackgroundColor(Color.BLUE) </pre><pre>       else -&gt; view.setBackgroundColor(Color.LTGRAY)</pre><pre>   }<br>}</pre><p>Fakat bunların uygulanabilmesi için <em>activity_main.xml</em> in içinde constraint layouta id eklememiz gerekiyor.</p><pre>android:id=&quot;@+id/constraint_layout&quot;</pre><p>Bunu yaptıktan sonra <em>MainActivity.kt</em>e gelerek viewların tıklanabilir olmasını sağlayacak <em>setListeners()</em> fonksiyonunu ekleyeceğiz.</p><pre>private fun setListeners() {<br><br>   val boxOneText = findViewById&lt;TextView&gt;(R.id.box_one_text)<br>   val boxTwoText = findViewById&lt;TextView&gt;(R.id.box_two_text)<br>   val boxThreeText = findViewById&lt;TextView&gt;(R.id.box_three_text)<br>   val boxFourText = findViewById&lt;TextView&gt;(R.id.box_four_text)<br>   val boxFiveText = findViewById&lt;TextView&gt;(R.id.box_five_text)<br><br>   val rootConstraintLayout = findViewById&lt;View&gt;(R.id.constraint_layout)</pre><pre>val clickableViews: List&lt;View&gt; =<br>       listOf(boxOneText, boxTwoText, boxThreeText,<br>              boxFourText, boxFiveText, rootConstraintLayout)</pre><pre>for (item in clickableViews) {<br>       item.setOnClickListener { makeColored(it) }<br>}</pre><p>En son ise yazdığımız fonksiyonun çalışabilirliğini sağlamak için setListener() fonksiyonumuzu onCreate()in içinde çağıracağız.</p><pre>override fun onCreate(savedInstanceState: Bundle?) {<br>...<br>   setListeners()<br>}</pre><p>Uygulamayı çalıştırdığımızda beyaz bir ekran bizi karşılayacak. Fakat viewlara tıkladıkça atadığımız renkleri gösterecekler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*sI2RgVyW_MDD9qJooK9Qzg.png" /><figcaption>task 8 son görünüş</figcaption></figure><p>Bir Taskin baştan sona temel olarak nasıl ilerlediğini de anladığımızı düşünüyorum. Bütün tasklari tamamladıktan sonra <em>coding challange</em>ları tamamlayarak konuyu tam manasıyla anlayıp anlamadığınızı test edebilirsiniz. Eğer hala konuyla ilgili hala eksiklerinizin olduğunu düşünüyorsanız Codelabsin önermiş olduğu <em>Learn More</em> bölmesindeki <strong>Udacity </strong>linkine giderek konu hakkında daha fazla fikir ve deneyim sahibi olabilirsiniz. <em>Homework</em>leri de tamamladıktan sonra ise bir sonraki codelaba geçebilirsiniz.</p><h4>Sonuç Olarak</h4><ul><li>Codelabs hakkında genel bir bilgi sahibi olduk</li><li>Kotlin için Codelabs ile ilerlemenin doğru bir seçim olup olmadığını sorguladık</li><li>Temel olarak bir taskin nasıl ilerlediği hakkında bilgi sahibi olduk</li></ul><p>Temel olarak mantığı kavradığımıza göre bize kalan bol bol practise yapmak ve diğer lessonları baştan başlayarak sona kadar tamamlamak.</p><p>Zaman ayırdığınız için teşekkürler.</p><h4>Kaynaklar:</h4><p>Codelabs websitesi: <a href="https://codelabs.developers.google.com/">tıklayın</a></p><p>Codelabs Github Toolları: <a href="https://github.com/googlecodelabs/tools">tıklayın</a></p><p>Android kotlin temel uygulamaların hepsi: <a href="https://github.com/google-developer-training/android-kotlin-fundamentals-apps">tıklayın</a></p><p>Udacity: <a href="https://www.udacity.com/">tıklayın</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a35c7e7bc6b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>