<?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[Xebia Engineering Blog - Medium]]></title>
        <description><![CDATA[The Xebia Engineering Blog - Medium]]></description>
        <link>https://medium.com/xebia-engineering?source=rss----e63b5e12385d---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Xebia Engineering Blog - Medium</title>
            <link>https://medium.com/xebia-engineering?source=rss----e63b5e12385d---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 02:56:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/xebia-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS Step Functions]]></title>
            <link>https://medium.com/xebia-engineering/aws-step-functions-6bffa4c7e6e7?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/6bffa4c7e6e7</guid>
            <dc:creator><![CDATA[Prabhu Selvaraj]]></dc:creator>
            <pubDate>Thu, 26 May 2022 07:59:03 GMT</pubDate>
            <atom:updated>2022-05-26T07:59:03.528Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. AWS Step Functions</h3><blockquote>Step Functions are serverless orchestration services that combine <a href="https://aws.amazon.com/lambda/">AWS Lambda</a> functions and other AWS services to build business-critical applications.</blockquote><blockquote>Through Step Functions’ graphical console, we can see the output of the application’s workflow as a series of event-driven steps.</blockquote><p><strong>Step Functions are based on state machines and tasks.</strong></p><ul><li>A state machine is a workflow.</li><li>A task is a state in a workflow that represents a single unit of work that another AWS service performs.</li><li>Each step in a workflow is a state.</li><li>With Step Functions’ built-in controls, It will be easy to examine the state of each step in the workflow to make sure that the application runs in order and as expected. Depending on the use case, Step Functions can call AWS services, such as Lambda, to perform tasks.</li></ul><p><strong>Step Functions can</strong></p><ul><li>Create workflows that process and publish machine learning models.</li><li>Control AWS services, such as <a href="https://aws.amazon.com/glue/">AWS Glue</a>, to create an extract, transform, and load (ETL) workflows.</li><li>Creates a long-running, automated workflow for applications that require human interaction.</li></ul><p>Since it is a serverless orchestration server, it allows developers to create and manage multi-step application workflows in the cloud. It also helps to convert each task into visual workflows, which in turn helps to build and update the step function quickly.</p><p>This article will talk about AWS Step Function features and limitations in Lambda and how to overcome that effectively.</p><p>The topics covered in this specific article are:</p><ul><li>Understanding of AWS Step Functions</li><li>Step Function Express vs Standard</li><li>Use Case Demo</li><li>API Gateway with Step Function.</li></ul><h3>2. Limitations of Lambda</h3><p>Lambda is a relatively tiny block of code that will be integrated with AWS services and set to run for a limited period (i.e., 15 minutes as default). Also, it has storage limitations inside as well. Suppose I want to do the following items in the lambda function to implement critical business logic but the answer would be NO at this stage.</p><ul><li>To sequence the functions of lambda</li><li>To run lambda function in parallel</li><li>To select function based on data</li><li>To retry the same functions</li><li>To try/catch/finally block</li><li>To maintain the state of the lambda function and pass the state to the next lambda function. Based on the result of lambda function A, I wanted to call either B or C.</li><li>To do orchestrations, transformation, and routed based on some condition</li></ul><h3>3. Benefits of Step Functions</h3><p>AWS Step Functions is a low-code, visual workflow service that developers use to build distributed applications, automate IT and business processes, and build data and machine learning pipelines using AWS services. Workflows manage failures, retries, parallelization, service integrations, and observability so developers can focus on higher-value business logic.</p><ul><li>Easy to connect with workflow editor and hence less code would be written</li><li>Easy to integrate with other AWS services like SNS, SQS, batch, Fargate, etc.</li><li>Automatic scaling</li><li>Manage state checkpoints and restarts to make sure the application executes in order</li><li>It can handle errors, rollback, and retries</li><li>Logs each state and it is easier to work</li></ul><h3>4. Step Function State Types</h3><p>Step Functions are based on the concepts of <strong><em>state machines</em></strong> and <strong><em>tasks</em></strong>. A <strong>state machine</strong> is a collection of states, the relationship between those states, their input, and output.</p><p><strong>States</strong> are the individual elements of a state machine. Each state can make decisions based on its input, perform actions, and pass output to other states. A state is referred to by its name, which can be any string, but has to be unique within the scope of the entire state machine.</p><p><strong>Tasks</strong> are how the states get work done. They can perform work by using an activity, a lambda function, or by-passing parameters to the API actions of other services.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d883066d63351baee4be2710befe85f/href">https://medium.com/media/3d883066d63351baee4be2710befe85f/href</a></iframe><h3>5. Types of Step Function: Express &amp; Standard</h3><p>A state machine can be created as either Standard (default) or Express <strong>Type</strong> and both of them use Amazon States Language(ASL) to build the step functions. <br>The state machine executions will behave differently, depending on the Type selected. <strong>The selected type cannot be changed after the state machine has been created</strong>.</p><p>As mentioned, step Functions have two workflow types i.e., Standard workflows and Express workflows. The Standard workflows have exactly once workflow execution and can run for up to one year, the Express workflows have at-least-once workflow execution and can run for up to five minutes</p><p><strong>Standard Workflows</strong> are ideal for long-running, durable, and auditable workflows. It can run for up to a year and it can retrieve the full execution history using the <a href="https://docs.aws.amazon.com/step-functions/latest/apireference">Step Functions API</a>, for up to 90 days after it completes the execution. Standard Workflows employ an <strong>exactly-once</strong> model, where the tasks and states are never executed more than once unless it has been specified with Retry behaviour in ASL. This makes them suited to orchestrating non-idempotent actions, such as starting an Amazon EMR cluster or processing payments. Standard Workflow’s executions are billed according to the number of state transitions processed.</p><p><strong>Express Workflows</strong> are ideal for high-volume, event-processing workloads such as IoT data ingestion, streaming data processing and transformation, and mobile application backends. They can run for up to five minutes. Express Workflows employ an <strong>at-least-once</strong> model, where there is a possibility that an execution might be run more than once. This makes them ideal for orchestrating idempotent actions such as transforming input data and storing it via PUT in Amazon DynamoDB. Express Workflow executions are billed by the number of executions, the duration of execution, and the memory consumed.</p><p><strong>Standard and Express</strong> Workflows can automatically start in response to events such as HTTP requests via Amazon API Gateway (fully-managed APIs at scale), IoT Rules, and over 140 event sources in Amazon EventBridge.</p><p><strong>Standard vs Express Workflows</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsheetsu.com%2Ftables%2F4425b808d4&amp;dntp=1&amp;display_name=Sheetsu&amp;url=https%3A%2F%2Fsheetsu.com%2Ftables%2F4425b808d4&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=sheetsu" width="700" height="1137" frameborder="0" scrolling="no"><a href="https://medium.com/media/25faafa066f2fad965f90982bbb48abd/href">https://medium.com/media/25faafa066f2fad965f90982bbb48abd/href</a></iframe><p>Step Functions integrates with multiple AWS services. To combine Step Functions with these services, use the following service integration patterns:</p><h3>6.1. Request a response (default)</h3><ul><li>Call service and let Step Functions progress to the next state after it gets an HTTP response.</li></ul><h3>6.2. Run a job (.sync)</h3><ul><li>Call service and have Step Functions wait for a job to complete.</li></ul><h3>6.3. Wait for a callback with a task token (.waitForTaskToken)</h3><ul><li>Call service with a task token and have Step Functions wait until the task token returns with a callback.</li></ul><p>The table below shows the available service integrations and service integration patterns for Step Functions. <br>Standard Workflows and Express Workflows support the same integrations but do not support the same integration patterns.</p><ul><li><strong>Standard Workflows Integrations:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*3Wf_gZ2IB3owafcBBoUNIg.png" /></figure><ul><li><strong>Express Workflows Integrations:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*g83Gaw1Rg3Z-YEL3ZL9MSQ.png" /></figure><p>Express Workflows do not support Run a Job (.sync) or Wait for Callback (.waitForTaskToken). Optimized integrations pattern support is different for each integration.</p><h3>7. Use Case Demo for Express and Standard</h3><h3>7.1. Standard Workflow</h3><p>Create a standard workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*NQARpoBGnVqo0lonJRndOg.png" /></figure><p><strong>Note</strong>: Also, it provides an option to select which one to be selected either standard or Express based on the requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGgdbbav5T5XQ-n-2_SqMw.png" /></figure><p>Once the standard type is selected, the below screen will appear, and in that, based on the business logic select the Action and Flow to create state machines like below.</p><p>In the below screenshot, Choice State has been selected to invoke the corresponding Lambda function which satisfy the condition</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1GdNJXi9eIbn87QXoFOBw.png" /></figure><p>In the below screenshot, Click on each action like “Lambda Invoke(1)” in the workflow (below) and configure the lambda function’s ARN. Similarly for the other “Lambda Invoke” Action as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NCniaPZM6FvjE4FGMt8VvQ.png" /></figure><p>Select the “Choice State” and configure the different rules and conditions to satisfy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fySs9Lf-1xOAdXcjGzgj8Q.png" /></figure><p>The same graphical editor code can be written in the Definition section. Can be viewed by clicking the <strong>definition</strong> section on the right-hand side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLrRINJgpbaNs749CgA9ig.png" /></figure><p>The state function can be executed by clicking on Start Execution by providing the input message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSCJG_57GgdAobmsBpYZJw.png" /></figure><h3>7.2. Express Workflow</h3><p>Similarly, Express workflow can be created by selecting the option while creating the state machine and the rest of the other process would be the same as mentioned in the above section (Standard section).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frURxKmhPHdMeoY-S8Zgjw.png" /></figure><p>But while running the express state workflow there would be two options given and which will be discussed below in detail in the next sections.</p><p>a. run as <strong>Synchronous</strong></p><p>b.<strong> </strong>run as<strong> Asynchronous</strong>.</p><h3>7.3. Express Workflow with Synchronous and Asynchronous option</h3><p>There are two types of Express Workflow are available to choose at the time of executing the express state machine.</p><ul><li><strong>Synchronous</strong> Express Workflows start a workflow, wait until it completes, and then return the result. Synchronous Express Workflows can be used to orchestrate microservices and allows the development of applications without the need to develop additional code to handle errors, retries, or execute parallel tasks. Synchronous Express Workflows can be invoked from Amazon API Gateway, AWS Lambda, or by using the <strong>StartSyncExecution </strong>API call.</li><li><strong>Synchronous Express execution API</strong> calls do not contribute to the existing account capacity limits. Step Functions will provide capacity on-demand and will automatically scale the sustained workload. Surges in workload may be throttled until capacity is available.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stYRjSUCkCuek6_GRjV0pw.png" /></figure><p>After execution, the output would be <strong>Synchronous</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nA8pods5-MSRiPfKgWfZVw.png" /></figure><ul><li><strong>Asynchronous Express Workflows</strong> return confirmation that the workflow was started, but do not wait for the workflow to complete. To get the result, the Client app must poll the service’s CloudWatch Logs. Asynchronous Express Workflows can be used where the immediate response output is not required, such as messaging services, or data processing that other services don’t depend on. Asynchronous Express Workflows can be started in response to an event, by a nested workflow in Step Functions, or by using the <strong>StartExecution</strong> API call.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KGZzXCd6RvRmTxbxaUyxw.png" /></figure><p>After execution, the output would be <strong>Asynchronous. Output won’t be returned quickly; the client application must poll the CloudWatch log to see the output by passing the “</strong>executionArn”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaFX7SkURP3IxhFrHyjzOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWPHSLQ9oePQQ6L53ujZ_g.png" /></figure><h3>8. Integrate API Gateway with Step function</h3><p>The below example shows how to invoke a standard step function (asynchronous express workflow) with the action “StartExecution” action</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfSqR38ddEX-TqhNGAS8tQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*OviEs7Tp8SKZw69UFS8IXA.png" /></figure><p><strong>Note</strong>:</p><ul><li>StartExecution action is not idempotent and hence it will not be supported for EXPRESS WorkFlows</li><li>Use DescribeExeuction action to get the output by passing the ExecutionArn value to poll the output logs from the cloudwatch.</li><li>StartSyncExecution is not available for STANDARD workflows, and it will be supported for EXPRESS workflows</li></ul><h3>9. Pricing of Step Functions</h3><h3>9.1. Standard Workflows</h3><p>Step Functions count <strong>state transition</strong> each time a step of the workflow is executed. It will be charged for the total number of state transitions across all the state machines, including retries and error <strong>handling</strong>. The Free Tier account includes 4,000 free state transitions per month. All charges are metered daily and billed monthly.</p><p><em>E.g.: </em><strong><em>$0.025</em></strong><em> per 1,000 state transitions execution per month, which means </em><strong>$0.000025</strong> per state transition execution.</p><p>The billing is for the number of state transitions per month above the free tier usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5vEluIhu-jR90zcR-P0aA.png" /></figure><h3>9.2. Express Workflows</h3><p>With Step Functions Express Workflows, it is like pay as you go. It will be charged based on the number of requests, a workflow executes, and its duration.</p><p>Step Functions Express Workflows count as a request each time it starts executing a workflow, and the charges will be for the total number of requests across all the workflows. This includes tests from the console.</p><p>Duration is calculated from the time the workflow begins executing until it completes or otherwise terminates, rounded up to the nearest 100ms, and the amount of memory used in the execution of the workflow will be billed in 64 MB chunks.</p><p>Memory consumption is based on the size of a workflow definition, the use of a map or parallel states, and the execution (payload) data size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0OrrIEogpzEz4ZlvaNU9g.png" /></figure><h3>9.3. Additional Charges</h3><p>There is an additional charge if the operation of the application workflow utilizes other AWS services or transfers data. For example, if the application workflow invokes an AWS Lambda function, then it will be billed for each request and the duration of each Lambda function.</p><p>Data Transfer — External data transfer to and from Amazon EC2</p><p>AWS Lambda Price — Request and duration</p><p>Amazon EC2 pricing — On-Demand, Reserved, and Spot instances</p><h3>10. References:</h3><p>1. <a href="https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html#welcome-integrations">What are AWS Step Functions? — AWS Step Functions (amazon.com)</a></p><p>2. <a href="https://aws.amazon.com/step-functions/pricing/">AWS Step Functions Pricing | Serverless Microservice Orchestration | Amazon Web Services</a></p><p>3. <a href="https://docs.aws.amazon.com/step-functions/latest/apireference/API_Operations.html">Actions — AWS Step Functions (amazon.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bffa4c7e6e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/aws-step-functions-6bffa4c7e6e7">AWS Step Functions</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automation of the code structure]]></title>
            <link>https://medium.com/xebia-engineering/automation-of-the-code-structure-c6b2d75813ae?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/c6b2d75813ae</guid>
            <dc:creator><![CDATA[brijesh pant]]></dc:creator>
            <pubDate>Thu, 05 May 2022 04:07:04 GMT</pubDate>
            <atom:updated>2022-05-05T04:07:03.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8pIV1SPSkIFt7NypFM4drQ.png" /></figure><p>The coding standards are the heart of any tech organization. To keep the standards high you need to have common tooling across different projects. Also to ensure the same repetitive tasks are not duplicated in different projects, you need to set a standard template around the development that you foresee within the organization. these templates can be customized basis the requirements of the project. This can help in the following ways</p><p>1: You can start the project or new functionality in the existing project, right away without wasting the time writing the boilerplate code to initiate the new repositories or the modules</p><p>2: Instead of researching from a fresh, you can utilize the existing knowledge from other projects</p><p>3: Resource movement from one project to the other can be made easy. If the developer moving into a new project can see the same project structure, it will be easy for him/her to start contributing to the project goals instead of understanding the code structure</p><p>In this post, I will share some of my experiences of different projects with different clients and how we made our life easy by defining the templates and generating the code automatically from the given template</p><p><strong><em>Use case1</em></strong>:</p><p>In one of my projects, we needed to build multiple microservices.</p><p>When a new microservice had to be created, each time we encountered the same problems.</p><p>every microservice requires a new module, with dependencies and configuration related to database, elastic search, external API, etc. also it required the Kubernetes configuration files(deployment, secretes, virtual service, etc.) for deployment to different environments.</p><p>Every time a new micro-service has to be created, our developers tend to duplicate the existing module and then modify the module according to their use cases. because of these copy and past thingies often the modules ended up having the useless and the duplicate code and the dependencies. Also while deploying the services it often required multiple fixes before a successful attempt. Essentially creation and minimal deployment of a new micro-service required at least a day or two and off-course followed by the actual development time for specific functionality.</p><p><strong>Learning:</strong> We knew every new service requires mostly the same set of configurations, what if we could have automated tasks that can generate a minimal code from a template for a new module. So we thought of creating a template-based Gradle task, which can let us create a new service, with a dummy API with automatic deployable configuration.</p><p>We needed to have a spring boot-based module, with some varying dependencies. All of the micro-services comprised of one or more requirements such as connecting to DB, audit logging, updating documents on elastic, and connecting to external APIs.</p><p><strong>How template could be of help:</strong></p><p>We defined a Gradle-based task that runs the code to generate the modules. Based on the arguments, it can generate a new module.</p><p>We created different modules for generic configurations for audit logging, external API access, error handling, elastic connectivity, etc. In our Auto generator, we added the configuration to add the specific modules based on the requirements(passed as the argument )</p><p>In our template, we defined the structure of a module comprising all the code that was required to create a new service. all the dynamic parts such as file names, module names, deployment configuration, etc., we kept as the placeholder.</p><p>whenever we needed to create a new service, it was just away from the execution of a Gradle task. you could deploy it right away. This helps us reduce the dev effort for at least 1 day for each service implementation.</p><p><strong><em>Use case2: </em></strong>In one of my other projects, we needed to develop the modules for micro-services, Kafka consumer, producer, AWS lambda, etc. We could encounter the same problem. But this time we did start with the same solution and already defined different templates for each of our use cases. based on the requirement the Gradle task could generate the different modules. As a developer you need to just implement the functionality of all the configurations, and set up was already taken care of by the templates.</p><p><strong>Conclusion:</strong> Apart from the functional requirements there could be more quality check requirements in the projects such as architectural styles, code coverage, check styles, etc. if at the organization-level same practices have to be followed, it is certainly a good idea to have the template-based code generation. which can generate the code for any project within the organization.</p><p>In the next post, I will show you how we can create the code from the template.</p><p>stay tuned and happy coding…..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b2d75813ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/automation-of-the-code-structure-c6b2d75813ae">Automation of the code structure</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SKP’s Thoughts : The Pains of Monolithic Architecture-Part 01]]></title>
            <link>https://medium.com/xebia-engineering/skps-thoughts-the-pains-of-monolithic-architecture-part-01-88358b834c0e?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/88358b834c0e</guid>
            <category><![CDATA[n-tier-architecture]]></category>
            <category><![CDATA[j2ee-development]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Sumith Puri]]></dc:creator>
            <pubDate>Thu, 06 Jan 2022 04:14:35 GMT</pubDate>
            <atom:updated>2022-01-06T04:14:35.783Z</atom:updated>
            <content:encoded><![CDATA[<h3>SKP’s Thoughts: The Pains of Monolithic Architecture-Part 01</h3><h3>About this Article Series</h3><p>Through this article series, I will discuss and present the shortcomings of monolithic architecture. Our first objective will be to understand monolithic architecture in-depth, and then we’ll explore its disadvantages, pitfalls, and shortcomings. Later, this article series will diverge into another series of articles on <em>Microservices Architecture</em>.<em> SKP’s Thoughts </em>presents my views on Software Architecture, Software Design, Software Processes, Innovative Product Design, and Software Development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQonGgGo1PeoA375wLA6aw.jpeg" /><figcaption>Fig.0: Utah Monolith (Real-World Mystery, Used Symbolically Here)</figcaption></figure><h3>Explanation of a Typical Monolithic Architecture</h3><p>The most common Software Architecture that, one can safely say, has been in existence ever since software development started is the <em>Monolithic Architecture</em>. There have been many forms of monolith over the ages. A single block of Software (such as Desktop), Distributed Architectures such as 2-Tier, 3-Tier, N-Tier are all examples of Monolithic Architecture. For the sake of this book, we will use the most common and standardized example of a 3-Tier Monolithic Architecture. Prior to the Microservices world, most enterprise systems would have chosen a 3-Tier for their implementation.</p><h4>Tier vs Layer</h4><p>Before we delve into the details of monolithic architecture, I think this will be an interesting topic to discuss. We look at the difference between a Tier and Layer from the perspective of a 3-Tier or N-Tier Web Application. Tiers are physical separations of groups, of similar or dissimilar kinds of layers, that run on the same physical infrastructure. Layers are logical or functional groupings while tiers are physically separated units. For example, the User Interface renders on browser — hence, it qualifies as a disparate existence (physical) with a specific concern (logical) — the <em>Client Tier</em>. Next, the <em>Web Layer</em> or <em>Presentation Layer</em> might exist along with a <em>Business Layer, </em>with each of them on a <em>Web Server</em> (<em>Web </em>or <em>Presentation Tier</em>) and <em>Application Server</em> (<em>Business Tier</em>) respectively. They may also be deployed together on an <em>Application Server</em> (<em>Presentation Layer</em> runs in the <em>Web Container</em> and <em>Business Layer</em> runs in the <em>Application Container</em>). Hence, this qualifies as a single grouping of deployments (physical) having different concerns (logical) — the <em>Middle Tier</em>. Next, the <em>Database Schema</em> (logical) will be on a <em>Database Tier</em> or <em>Enterprise Information Systems</em>-EIS<em> Tier</em> (physical). Hence, you must note that a tier is different from a layer. Note that in some web development textbooks or in practical usage — the web or presentation tier might be shown as the first one, ignoring the client tier. The user interface is rendered on the client tier by this presentation tier. The presentation tier prepares the user interface for rendering based on the data that is returned by the business tier, which gets it from the database tier. From this introduction, you can understand that tiers are physical deployments of logical layers. Groups of layers, similar or dissimilar, that operate on the same infrastructure are also said to divide into tiers.</p><h4>Client Tier</h4><p>Let us now get into a detailed explanation of each important tier in the 3-Tier architecture. First is the <em>Client Tier.</em> Now, the client tier is, physically, entirely on the client-side. In other words, it is the user interface of the application. Typically, this is rendered by the web container as in the below diagram. The end-user will interact with the application through this user interface rendered on the client tier. Our explanation is based on a web (DHTML) user interface rendered on the browser on a personal computer.</p><p>In the below diagram, the client container can be considered as a desktop user interface or a technology that renders within the specifics of that container (for the web applications, the browser can be thought of as a container). Mostly, the simple validations, filling forms, printing, viewing, simple logic are the kind of [operations] performed on a browser rendered user interface. The technologies can be HTML, CSS, JavaScript, Angular, JavaFX, GTK, Qt,…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*sRdTUcfFDyFnnuuzkSdoPw.png" /><figcaption><strong>Fig. 01</strong>: Typical Three-Tier Architecture (Source: IBM)</figcaption></figure><h4>Middle Tier</h4><p>Moving to the Middle Tier. In the J2EE world, we can also think of this as the J2EE Business Layer. Traditionally, this has 2 main layers — hosted in the web container and the application container (EJB container). Additionally, a layer with the purpose of accessing data can exist, usually called the <em>Data Access Layer.</em> Here, once again we can appreciate the difference between layers and tiers.</p><p>The web container or web layer will hold the web rendering components of the application. You may also visualize it as a different physical deployment on a web server. The examples of technologies in this layer and container are JSP, Servlet, Struts (MVC), JAX-RS (REST), JAX-WS (SOAP), Spring (MVC), ASP.NET, PHP,…</p><p>The EJB container can be visualized as the Core Application or Business Logic Container of any application. This is an independent layer of deployment. Even though in the below diagram it is mentioned as EJB Container, You may call it as the Application Container or Service Layer or Business Layer. All the Brain/Heart/Logic of an Application will always lie in this Layer — Loosely, this can be termed as the Application itself. Its primary functions include interacting with Databases, Processing Business Logic, and sending data/objects to the Web Container. Examples of technologies in this layer and container are EJB, Spring (Remoting/POJO), [Windows Service*], Core Java (POJO),…</p><p>You must understand that the Service Layer need not always be an Application Server — It might be that a web technology such as JAX-RS (REST), JAX-WS (SOAP) may be used for this purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*ycDwcBDSK43yj3nHA_Iv3Q.png" /><figcaption><strong>Fig. 02</strong>: <em>Typical J2EE Architecture</em> (Source: Oracle)</figcaption></figure><p>(About Figure: Three-Tier (3-Tier) with Layer Separation into Web and EJB Containers, Note that the Web Container will render UI and EJB Container will Process Business Logic and Access Database)</p><h4>Database Tier</h4><p>Moving to the <em>Database Tier </em>or <em>EIS Tier.</em> This may also be referred to as the Database Server or Database Layer. The purpose is clear and easily deduced from the naming — it is used to store the data — for the purpose of this book, you may visualize it as RDBMS or Database. The database may have various schemas, tables that store the application data. Some of the flavors of RDBMS are Oracle, MySQL, PostgreSQL, DB2, … You must note some authors may call this EIS Tier (Enterprise Information Services Tier). You must understand that data may not always reside in an RDBMS — it may exist in a NoSQL DB, other <em>Web Services (Data Sources), Streaming Data Sources, Connected Devices, Unstructured Data, File Systems,</em> or any other form of data that is required to be accessed/processed by an application. The Database Tier is usually accessed from the Middle Tier.</p><p>In the next article in this series, we will discuss and dig into the disadvantages of Monolithic Architecture, one by one. Also, we will try to briefly present the possible remedial measures or better alternatives.</p><p>If you’re interested in Microservices Architecture, you may want to consider purchasing my book [Microservices Architecture, Booklet #01: The Decision Maker]. It is a must-read for all Decision Makers involved in <em>Microservices Adoption</em> or in a transition from <em>Monolithic to Microservices Architecture</em>. The ideal audience is CEOs/CTOs, VPs, Directors, Architects, and managers who are currently working or plan to work in these areas.</p><p><em>Buy on Amazon Prime: </em><a href="https://rebrand.ly/skp-msa-tdm-amazon-prime">https://rebrand.ly/skp-msa-tdm-amazon-prime</a><br>Buy on Flipkart India: <a href="https://rebrand.ly/skp-msa-tdm-flipkart-india">https://rebrand.ly/skp-msa-tdm-flipkart-india</a><br>Buy from Notion Press: <a href="https://rebrand.ly/skp-msa-tdm-notion-press">https://rebrand.ly/skp-msa-tdm-notion-press</a></p><p>(Use Exclusive Coupon Code at Checkout on <em>Notion Press</em>, <strong>SKPXEBIA</strong>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88358b834c0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/skps-thoughts-the-pains-of-monolithic-architecture-part-01-88358b834c0e">SKP’s Thoughts : The Pains of Monolithic Architecture-Part 01</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving N+1 Select Problem In JPA Using Entity Graph]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/xebia-engineering/solving-n-1-select-problem-in-jpa-using-entity-graph-a71dea0fc808?source=rss----e63b5e12385d---4"><img src="https://cdn-images-1.medium.com/max/1400/0*dYXI1WsG5WAAyaYa" width="1400"></a></p><p class="medium-feed-snippet">I was watching a video from SpringOne 2021 on a topic Building Fast and Scalable Persistence Layers with Spring Data JPA by Thorben&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/xebia-engineering/solving-n-1-select-problem-in-jpa-using-entity-graph-a71dea0fc808?source=rss----e63b5e12385d---4">Continue reading on Xebia Engineering Blog »</a></p></div>]]></description>
            <link>https://medium.com/xebia-engineering/solving-n-1-select-problem-in-jpa-using-entity-graph-a71dea0fc808?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/a71dea0fc808</guid>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[spring-data-jpa]]></category>
            <category><![CDATA[hibernate]]></category>
            <category><![CDATA[query-optimization]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Amit Kumar]]></dc:creator>
            <pubDate>Thu, 07 Oct 2021 09:35:12 GMT</pubDate>
            <atom:updated>2024-11-04T19:33:28.361Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Web Application development with DWR(direct web remoting) and Spring Boot]]></title>
            <link>https://medium.com/xebia-engineering/web-application-development-with-dwr-direct-web-remoting-and-spring-boot-b7cde7747bd2?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7cde7747bd2</guid>
            <category><![CDATA[ajax]]></category>
            <dc:creator><![CDATA[Nitish Sati]]></dc:creator>
            <pubDate>Tue, 20 Jul 2021 05:42:25 GMT</pubDate>
            <atom:updated>2021-07-20T05:42:24.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*EH-jAjnJ_MuEQafO" /></figure><p>DWR is a Java library which allows JavaScript functions to call Java methods and Java methods to call JavaScript functions(reverse ajax). It dynamically generates the JavaScript library of service class or servlet class to allow web browsers to call java code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*03O1d0dPrAxU5n4d" /></figure><p><strong>DWR has two main parts:</strong></p><ol><li>Java servlet or Java service which is running on the server that accepts requests and sends responses back to the client.</li><li>JavaScript library which is running on the web browser that sends requests to the server and receives the response to update the page.</li></ol><p>It provides integration with servlets and popular frameworks such as Spring, Hibernate, Struts and others. It is open source.</p><p>Having a basic understanding of DWR, let us move to the code area where we will build web applications using spring boot and DWR.</p><p><strong>Following are steps for configuring DWR in spring boot project</strong></p><ol><li><em>In the first step create a spring boot project with the following dependency.</em></li></ol><pre>&lt;dependency&gt;</pre><pre>&lt;groupId&gt;org.directwebremoting&lt;/groupId&gt;</pre><pre>&lt;artifactId&gt;dwr&lt;/artifactId&gt;</pre><pre>&lt;version&gt;3.0.2-RELEASE&lt;/version&gt;</pre><pre>&lt;/dependency&gt;</pre><p>2. Add spring.xml to the resource folder to configure dwr scanning.</p><pre>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;</pre><pre>&lt;beans xmlns=”http://www.springframework.org/schema/beans&quot;</pre><pre>xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&quot;</pre><pre>xmlns:dwr=”http://www.directwebremoting.org/schema/spring-dwr&quot;</pre><pre>xsi:schemaLocation=”http://www.springframework.org/schema/beans <a href="http://www.springframework.org/schema/beans/spring-beans.xsd">http://www.springframework.org/schema/beans/spring-beans.xsd</a></pre><pre><a href="http://www.directwebremoting.org/schema/spring-dwr">http://www.directwebremoting.org/schema/spring-dwr</a> http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd&quot;&gt;</pre><pre>&lt;dwr:annotation-config/&gt;</pre><pre>&lt;dwr:annotation-scan scanRemoteProxy=”false” base-package=”<em>com.dwr.test</em>”/&gt;</pre><pre>&lt;dwr:configuration/&gt;</pre><pre>&lt;/beans&gt;</pre><p>3. Configure spring boot startup main class to load spring.xml</p><pre>@SpringBootApplication</pre><pre>@ImportResource(“classpath*:spring.xml”)</pre><pre>public class DwrDemo {</pre><pre>public static void main(String[] args) {</pre><pre>SpringApplication.run(DwrDemo.class, args);</pre><pre>}</pre><pre>}</pre><p>4. If the project is based on servlets then dwr.xml is used for configuration but in case of spring boot we need to add configuration with java code.</p><pre>@Configuration</pre><pre>public class DwrConfig {</pre><pre>/**</pre><pre>* Join the DWR servlet, which is equivalent to configuring in xml</pre><pre>* @return</pre><pre>*/</pre><pre>@Bean</pre><pre>public ServletRegistrationBean servletRegistrationBean() {</pre><pre>DwrSpringServlet servlet = new DwrSpringServlet();</pre><pre>ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, “/dwr/*”);</pre><pre>// Set to true to enable DWR to debug and enter the test page.</pre><pre>registrationBean.addInitParameter(“debug”, “true”);</pre><pre>//pollAndCometEnabled set to true to increase the loadability of the server, although DWR has a mechanism to protect the server from overload.</pre><pre>registrationBean.addInitParameter(“pollAndCometEnabled”, “true”);</pre><pre>registrationBean.addInitParameter(“activeReverseAjaxEnabled”, “true”);</pre><pre>registrationBean.addInitParameter(“maxWaitAfterWrite”, “60”);</pre><pre>return registrationBean;</pre><pre>}</pre><pre>}</pre><p>5. In the final step we have to create a service class which will be used for writing business logic.</p><pre>import java.util.LinkedList;</pre><pre>import java.util.List;</pre><pre>import org.directwebremoting.annotations.RemoteMethod;</pre><pre>import org.directwebremoting.annotations.RemoteProxy;</pre><pre>import org.springframework.stereotype.Service;</pre><pre>@Service</pre><pre>@RemoteProxy // The annotation of spring is equivalent to exposing the service</pre><pre>public class Message {</pre><pre>@RemoteMethod</pre><pre>public List&lt;String&gt; getOptionList() {</pre><pre>List&lt;String&gt; option = new LinkedList&lt;&gt;();</pre><pre>for (int i = 0; i &lt; 5; i++)</pre><pre>option.add(“field_” + i);</pre><pre>return option;</pre><pre>}</pre><pre>}</pre><p>6. Final step integration with html</p><pre>&lt;!DOCTYPE html&gt;</pre><pre>&lt;html&gt;</pre><pre>&lt;head&gt;</pre><pre>&lt;title&gt;DWR test&lt;/title&gt;</pre><pre>&lt;meta charset=<em>&quot;utf-8&quot;</em>&gt;</pre><pre>&lt;meta name=<em>&quot;viewport&quot;</em> content=<em>&quot;width=device-width, initial-scale=1&quot;</em>&gt;</pre><pre>&lt;link rel=<em>&quot;stylesheet&quot;</em></pre><pre>href=<em>&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css&quot;</em>&gt;</pre><pre>&lt;script</pre><pre>src=<em>&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;</em>&gt;&lt;/script&gt;</pre><pre>&lt;script</pre><pre>src=<em>&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js&quot;</em>&gt;&lt;/script&gt;</pre><pre>&lt;script type=<em>&#39;text/javascript&#39;</em> src=<em>&#39;/dwr/engine.js&#39;</em>&gt;&lt;/script&gt;</pre><pre>&lt;script type=<em>&#39;text/javascript&#39;</em> src=<em>&#39;/dwr/interface/Message.js&#39;</em>&gt;&lt;/script&gt;</pre><pre>&lt;script type=<em>&quot;text/javascript&quot;</em> src=<em>&quot;/dwr/util.js&quot;</em>&gt;&lt;/script&gt;</pre><pre>&lt;script&gt;</pre><pre>$(document).ready(<strong>function</strong>() {</pre><pre>dwr.util.useLoadingMessage();</pre><pre>update();</pre><pre>});</pre><pre><strong>function</strong> update() {</pre><pre>Message.getMessage(<strong>function</strong>(data) {</pre><pre>dwr.util.setValue(&quot;divResponse&quot;, data);</pre><pre>dwr.util.setValue(&quot;text&quot;, data);</pre><pre>});</pre><pre>getList();</pre><pre>}</pre><pre><strong>function</strong> getList() {</pre><pre>Message.getOptionList(<strong>function</strong>(data) {</pre><pre>fillDropDown(data);</pre><pre>fillWithDwrUtil(data);</pre><pre>});</pre><pre>}</pre><pre><strong>function</strong> fillDropDown(options) {</pre><pre><strong>var</strong> select = document.getElementById(&quot;optionList&quot;);</pre><pre><strong>for</strong> (<strong>var</strong> i = 0; i &lt; options.length; i++) {</pre><pre><strong>var</strong> opt = options[i];</pre><pre><strong>var</strong> el = document.createElement(&quot;option&quot;);</pre><pre>el.textContent = opt;</pre><pre>el.value = opt;</pre><pre>select.appendChild(el);</pre><pre>}</pre><pre>}</pre><pre><strong>function</strong> fillWithDwrUtil(data) {</pre><pre>dwr.util.removeAllOptions(&quot;optionList2&quot;);</pre><pre>dwr.util.addOptions(&quot;optionList2&quot;, data);</pre><pre>}</pre><pre>&lt;/script&gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;div class=<em>&quot;container&quot;</em>&gt;</pre><pre>&lt;div class=<em>&quot;alert alert-success&quot;</em>&gt;</pre><pre>&lt;center&gt;</pre><pre>&lt;strong&gt;Web App demo of DWR&lt;/strong&gt;</pre><pre>&lt;/center&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;label for=<em>&quot;sel1&quot;</em>&gt;Random message number from server&lt;/label&gt;</pre><pre>&lt;div id=<em>&quot;divResponse&quot;</em> class=<em>&quot;well&quot;</em>&gt;&lt;/div&gt;</pre><pre>&lt;div class=<em>&quot;form-group&quot;</em>&gt;</pre><pre>&lt;input id=<em>&quot;text&quot;</em> class=<em>&quot;form-control&quot;</em>&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;h2&gt;Form control: select&lt;/h2&gt;</pre><pre>&lt;p&gt;The form below contains two dropdown menus (select lists):&lt;/p&gt;</pre><pre>&lt;form&gt;</pre><pre>&lt;div class=<em>&quot;form-group&quot;</em>&gt;</pre><pre>&lt;label for=<em>&quot;sel1&quot;</em>&gt;Drop down list using js function&lt;/label&gt; &lt;select</pre><pre>class=<em>&quot;form-control&quot;</em> id=<em>&quot;optionList&quot;</em>&gt;</pre><pre>&lt;/select&gt; &lt;br&gt; &lt;label for=<em>&quot;sel2&quot;</em>&gt;Drop down list using dwr util&lt;/label&gt; &lt;select</pre><pre>class=<em>&quot;form-control&quot;</em> id=<em>&quot;optionList2&quot;</em>&gt;</pre><pre>&lt;/select&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>Final result is below:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0YXwycvUjYV5LKaHHyviA.png" /></figure><p>To know more about dwr, Kindly go to this link <a href="http://directwebremoting.org/dwr/index.html"><em>DWR — Easy Ajax for JAVA</em></a>.</p><p>You can find the full code base at my github repo.</p><p><a href="https://github.com/nitishsati82/dwrtest">GitHub</a></p><p><strong>References:-</strong></p><p><a href="http://directwebremoting.org/dwr/index.html">DWR — Easy Ajax for JAVA</a></p><p><a href="https://dzone.com/articles/direct-web-remoting-tips">DWR article</a></p><p><a href="https://www.programmersought.com/article/8611739802/">DWR Java</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7cde7747bd2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/web-application-development-with-dwr-direct-web-remoting-and-spring-boot-b7cde7747bd2">Web Application development with DWR(direct web remoting) and Spring Boot</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flexbox Layout in CSS]]></title>
            <link>https://medium.com/xebia-engineering/flexbox-layout-in-css-55e1fbaded7e?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/55e1fbaded7e</guid>
            <category><![CDATA[flexbox]]></category>
            <category><![CDATA[flexboxlayout]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[css3-flexbox]]></category>
            <category><![CDATA[css3]]></category>
            <dc:creator><![CDATA[Rimple Srivastava]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 10:53:12 GMT</pubDate>
            <atom:updated>2021-06-27T10:53:12.319Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*HnOWco1IR24XfcVcHODPpw.jpeg" /></figure><p>Understanding Flexbox and its usage</p><p><strong>A flexible box</strong>, or <strong>Flexbox</strong> as it is called, is a set of properties that can be used to design advanced responsive layouts for websites. Before Flexbox, there were four kinds of layout models (<strong>inline</strong>, <strong>block</strong>, <strong>table,</strong> and <strong>positioned</strong>) and with limitations, they did not cater well for designing modern web applications. These limitations left the web developers with no option other than using floating elements, table-cell displays, and writing innumerable CSS hack tricks, which was a lot of headache in itself.</p><p>Let&#39;s get rid of any more CSS hacks, and enter the world of CSS Flexbox Layout.</p><h3>Flexbox and its Properties</h3><p>CSS flexbox allows the website designers to control how items are aligned, positioned, and sized within their container to fit in any viewport.</p><p>All the items inside the main container are laid out along two axes, <strong>the main (<em>x-axis</em>)</strong> and the <strong>cross-axis (<em>y-axis</em>)</strong>.</p><p>The main container is the parent element, also called a <strong>flex container,</strong> while all the elements within this container are its children, called <strong>flex items.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*JaE6DW0SsdI1rESszZeY0g.png" /><figcaption>Flex items inside a Flex container</figcaption></figure><p>The above image is a flex container (area in black) with three flex items.</p><p>The HTML for the above layout will be-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*VOeFvqufQssrrpB1ZvGKYg.png" /><figcaption>HTML template illustrating the use of flexbox</figcaption></figure><p>The flex container becomes flexible when the <strong><em>display</em></strong> property is set to <strong><em>flex</em></strong>.</p><p><strong>Flex container-</strong></p><p>The flex container properties include the following-</p><p><strong>a. flex-direction:</strong></p><p>It defines the direction in which the items will be aligned. Its options include <strong><em>row</em></strong>, <strong><em>row-reverse</em></strong>, <strong><em>column</em></strong>, <strong><em>column-reverse.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*g6x9mvthT3o1wXm9JcyJ-A.png" /></figure><p><strong>b. flex-wrap:</strong></p><p>This property defines whether items will be wrapped or not, options include <strong><em>wrap</em></strong>, <strong><em>no-wrap</em></strong>, <strong><em>wrap-reverse</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*ut3fkbELbnXqp551MHmU0w.png" /></figure><p><strong>c. flex-flow:</strong></p><p>This property is a combination of <strong><em>flex-direction</em></strong> and <strong><em>flex-wrap</em></strong> properties.</p><p><strong>d. justify-content:</strong></p><p>This property is used to align the flex items along the <strong><em>x-axis</em></strong>. The below illustration will show all options available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*sYL9mF8TWILxjajfSdEp2w.png" /></figure><p><strong>e. align-items:</strong></p><p>This property is used to align the items inside the flex container along the<strong><em> y-axis</em></strong>, let&#39;s take a look at the options available-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*EyyUF_aRQ-IR8yHVkYOeTA.png" /></figure><p><strong>f. align-content:</strong></p><p>This property is used to align the flex item lines. We will use this property along with the <strong><em>flex-wrap</em></strong> property set to wrap to demonstrate better-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*ND4CznaWN9LaHwq7ATYrLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*PQq5cDQ0l2kcd5hzQs1q6Q.png" /></figure><p><strong>Flex Item-</strong></p><p>Once we have assigned the display property of the parent container as flex, the child item also becomes flexible.</p><p>The below properties can be used to align the flex item.</p><p><strong>a. order:</strong></p><p>This is simply used to display the order of the flex items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*QPS--kPqElN-vd0_qklbTw.png" /></figure><p><strong>b. flex-grow:</strong></p><p>This property defines how much an item will grow relative to the other flex item-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*Q8uHaQ2L1OIkpbAGLibwlw.png" /></figure><p><strong>b. flex-shrink:</strong></p><p>This property defines how much an item will shrink relative to the other flex item.</p><p><strong>c . flex-basis:</strong></p><p>It defines the initial width of the flex item-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*Ed3V8B5M6M9hQGDZq8QrTw.png" /></figure><p><strong>d . flex:</strong></p><p>This property combines the above three properties of flex items(<strong><em>flex-grow</em></strong>, <strong><em>flex-shrink</em></strong>, and <strong><em>flex-basis)</em></strong>. It can be used as below example-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*8OlvtyfXBrNqhUyW3a_mzQ.png" /></figure><p><strong>e. align-self:</strong></p><p>This property defines the alignment of the selected item and overrides the <strong><em>align-item</em></strong> property of the <strong><em>container</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*-wDcfN-pWu_asyEy7txyVQ.png" /></figure><p>That’s all folks!</p><p>Hope you will be able to build intelligent responsive websites using the new flexbox layout.</p><p>Thank you, and Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55e1fbaded7e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/flexbox-layout-in-css-55e1fbaded7e">Flexbox Layout in CSS</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating real time stock prices using web-socket]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/xebia-engineering/simulating-real-time-stock-prices-using-web-socket-8d9696c66503?source=rss----e63b5e12385d---4"><img src="https://cdn-images-1.medium.com/max/1400/0*sm0bsUZwA9DY81PD" width="1400"></a></p><p class="medium-feed-snippet">After exploring how real-time updates like real-time stock prices, social feeds, notification, etc. from the server gets loaded on the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/xebia-engineering/simulating-real-time-stock-prices-using-web-socket-8d9696c66503?source=rss----e63b5e12385d---4">Continue reading on Xebia Engineering Blog »</a></p></div>]]></description>
            <link>https://medium.com/xebia-engineering/simulating-real-time-stock-prices-using-web-socket-8d9696c66503?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/8d9696c66503</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[stomp]]></category>
            <dc:creator><![CDATA[Amit Kumar]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 10:52:47 GMT</pubDate>
            <atom:updated>2024-11-04T19:33:55.118Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Coroutines in Android]]></title>
            <link>https://medium.com/xebia-engineering/coroutines-in-android-d94b54caec55?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/d94b54caec55</guid>
            <dc:creator><![CDATA[Mohit Mahajan]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 10:52:25 GMT</pubDate>
            <atom:updated>2021-06-27T10:52:25.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*mUOzPyx-2Wh1FdaZiuis-Q.png" /></figure><p>Coroutines help to manage long-running tasks that might otherwise block the main thread and cause your app to become unresponsive. A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously</p><p>As you see in above diagram, in your main thread you can perform only small operations. If you want to perform long running operations in your main thread then your app might be crash and slow. Or if you create no. of background/worker thread then out of memory issue is coming. Coroutines are a special type of function that deliberately yield control over to the caller, but does not end its context in the process, instead maintaining it in an idle state.</p><h3>How to use Coroutines?</h3><pre>dependencies<br>        <strong>{<br>            </strong>implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:x.x.x&quot;<br>            implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-android:x.x.x&quot;<br>        <strong>}</strong></pre><p>Coroutine defines a series of rules and configurations that define how and where a coroutine is going to be executed.</p><ul><li><strong>Main: </strong>uses the UI Thread. In Rx is similar to AndroidSchedulers.MainThread()</li><li><strong>Default: </strong>used for<strong> </strong>CPU<strong> </strong>intensive<strong> </strong>tasks.<strong> </strong>It is going to use as many threads as CPU cores are available. Since they are CPU intensive tasks, there is no point in having many threads running, as the CPU is going to be busy. Similar to Schedulers.computation() in Rx.</li><li><strong>IO: </strong>used for<strong> </strong>Input/Output.<strong> </strong>Making a request to an API, access to a DB, etc. Similar to Schedulers.io() in Rx.</li><li><strong>Job: </strong>It’s essentially a task that runs in background, and it can be interpreted as an action, with a lifecycle that gets destroyed once finished.</li><li>For run different operations using jobs: <strong>Job.join</strong></li><li>For cancels all the children jobs: <strong>Job.cancel</strong></li><li><strong>withContext: </strong>another way of writing the async where we do not have to write await().</li></ul><pre>suspend fun fetchUser(): User {<br>    return withContext(Dispatchers.<em>IO</em>) <strong>{<br>        </strong>// make network call<br>        // return user<br>    <strong>}<br></strong>}</pre><p>When we use withContext, it will run in series instead of parallel. That is a major difference.</p><h3>Coroutines functions in Kotlin</h3><p><strong>Suspend</strong> : As their name suggests, they are functions that suspend the execution of a coroutine at some point, and then resume the execution of the function again when the result is ready.</p><pre>suspend fun makeNetworkRequest() {<br>    // fetchData is another suspend function, so &#39;makeNetworkRequest&#39; is going to be `suspended`<br>    // until it&#39;s result becomes available, without blocking the main thread.<br>    val result = fetchData()<br>    // continues executing once the result becomes available<br>    show(result)<br>}<br><br>// fetchData is main thread safe<br>suspend fun fetchData(): Result { ... }</pre><h4>Launch Function</h4><p>The launch will not block the main thread, but on the other hand, the execution of the rest part of the code will not wait for the launch result since launch is not a suspend call.</p><pre>fun GFG()<br>{<br>    var resultOne = &quot;Android&quot;<br>    var resultTwo = &quot;Kotlin&quot;<br>    Log.i(&quot;Launch&quot;, &quot;Before&quot;)<br>    launch(Dispatchers.<em>IO</em>) <strong>{ </strong>resultOne = function1() <strong>}<br>    </strong>launch(Dispatchers.<em>IO</em>) <strong>{ </strong>resultTwo = function2() <strong>}<br>    </strong>Log.i(&quot;Launch&quot;, &quot;After&quot;)<br>    val resultText = resultOne + resultTwo<br>    Log.i(&quot;Launch&quot;, resultText)<br>}<br><br>suspend fun function1(): String<br>{<br>    delay(1000L)<br>    val message = &quot;function1&quot;<br>    Log.i(&quot;Launch&quot;, message)<br>    return message<br>}<br><br>suspend fun function2(): String<br>{<br>    delay(100L)<br>    val message = &quot;function2&quot;<br>    Log.i(&quot;Launch&quot;, message)<br>    return message<br>}</pre><h3>Async Function</h3><p>Async is also used to start the coroutines, but it blocks the main thread at the entry point of the <strong>await() </strong>function in the program.</p><pre>fun GFG<br>{<br>    Log.i(&quot;Async&quot;, &quot;Before&quot;)<br>    val resultOne = Async(Dispatchers.<em>IO</em>) <strong>{ </strong>function1() <strong>}<br>    </strong>val resultTwo = Async(Dispatchers.<em>IO</em>) <strong>{ </strong>function2() <strong>}<br>    </strong>Log.i(&quot;Async&quot;, &quot;After&quot;)<br>    val resultText = resultOne.await() + resultTwo.await()<br>    Log.i(&quot;Async&quot;, resultText)<br>}<br><br>suspend fun function1(): String<br>{<br>    delay(1000L)<br>    val message = &quot;function1&quot;<br>    Log.i(&quot;Async&quot;, message)<br>    return message<br>}<br><br>suspend fun function2(): String<br>{<br>    delay(100L)<br>    val message = &quot;function2&quot;<br>    Log.i(&quot;Async&quot;, message)<br>    return message<br>}</pre><h3>Launch vs Async</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*_rG5DBdd49pAcRLycEB0Pw.png" /></figure><h3>Benefits using Coroutines</h3><ul><li>Coroutines are Light-weight Threads</li><li>Coroutines can run in parallel, wait for each other and communicate with each other</li><li>Create thousands of coroutines without any memory issue</li><li>Best for modern applications</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d94b54caec55" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/coroutines-in-android-d94b54caec55">Coroutines in Android</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pub/Sub and Events]]></title>
            <link>https://medium.com/xebia-engineering/pub-sub-and-events-b5bcf610db3b?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/b5bcf610db3b</guid>
            <dc:creator><![CDATA[Mohit Mahajan]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 10:51:29 GMT</pubDate>
            <atom:updated>2021-06-27T10:51:29.129Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9fw9-AbGIqjEskbK-Rf6A.png" /></figure><p>The publish subscribe pattern provides a great design to pass the information between widgets. We can send a message from one object to one or more other objects, without the sender or receivers having any reference or dependency to each other.</p><p>To make development easy, the Android SDK provides a built-in BroadcastReceiver. This class can pick up message broadcasts from other classes in the same app, or from the Android system and other Android apps, similar to the publish-subscribe design pattern.</p><p><strong>Define events:</strong></p><pre>public static class MessageEvent { /* Additional fields if needed */ }</pre><p><strong>Prepare subscribers:</strong></p><pre>@Subscribe(threadMode = ThreadMode.<em>MAIN</em>)<br>public void onMessageEvent(MessageEvent event) {/* Do something */};</pre><p><strong>Register and unregister your subscriber.</strong></p><pre>@Override<br>public void onStart() {<br>    super.onStart();<br>    EventBus.<em>getDefault</em>().register(this);<br>}<br><br>@Override<br>public void onStop() {<br>    super.onStop();<br>    EventBus.<em>getDefault</em>().unregister(this);<br>}</pre><p><strong>Post events:</strong></p><pre>EventBus.getDefault().post(new MessageEvent());</pre><p><strong>Via Gradle:</strong></p><pre>implementation &#39;org.greenrobot:eventbus:3.2.0&#39;</pre><p><strong>Via Maven:</strong></p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.greenrobot&lt;/groupId&gt;<br>    &lt;artifactId&gt;eventbus&lt;/artifactId&gt;<br>    &lt;version&gt;3.2.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><h3>Benefits using EventBus</h3><ul><li>simplifies the communication between components</li><li>decouples event senders and receivers</li><li>performs well with UI artifacts (e.g. Activities, Fragments) and background threads</li><li>avoids complex and error-prone dependencies and life cycle issues</li><li><strong>Convenient Annotation based API:</strong> Simply put the @Subscribe annotation to your subscriber methods. Because of a build time indexing of annotations, EventBus does not need to do annotation reflection during your app’s run time.</li><li><strong>Android main thread delivery:</strong> When interacting with the UI, EventBus can deliver events in the main thread regardless how an event was posted.</li><li><strong>Background thread delivery:</strong> If your subscriber does long running tasks, EventBus can also use background threads to avoid UI blocking.</li><li><strong>Event &amp; Subscriber inheritance:</strong> In EventBus, the object oriented paradigm apply to event and subscriber classes. Let’s say event class A is the superclass of B. Posted events of type B will also be posted to subscribers interested in A. Similarly the inheritance of subscriber classes are considered.</li><li><strong>Jump start:</strong>You can get started immediately — without the need to configure anything — using a default EventBus instance available from anywhere in your code.</li><li><strong>Configurable:</strong> To tweak EventBus to your requirements, you can adjust its behavior using the builder pattern.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5bcf610db3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/pub-sub-and-events-b5bcf610db3b">Pub/Sub and Events</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Letting customers reach out to you!]]></title>
            <link>https://medium.com/xebia-engineering/letting-customers-reach-out-to-you-e0c9b86813cc?source=rss----e63b5e12385d---4</link>
            <guid isPermaLink="false">https://medium.com/p/e0c9b86813cc</guid>
            <dc:creator><![CDATA[Mohit Kanwar]]></dc:creator>
            <pubDate>Sat, 19 Jun 2021 10:44:51 GMT</pubDate>
            <atom:updated>2021-06-19T10:49:58.173Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJAdmUiTGv0tJYN1QU_BLw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mirzababic?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mirza Babic</a> on <a href="https://unsplash.com/s/photos/bank?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I recently surveyed to understand how do customers reach out to their banks when they have a query. I would like to share the results of the survey and my understanding of the same.</p><p>Context: If you want to know if your bank is working today, how will you find it out?</p><p>This survey was shared on Linked-in, in the English language, and in a network influenced by bankers and technologists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ceRMwH1WxECEhqpm" /></figure><p>Below is a summary of the survey : How do you speak to your bank?</p><ul><li>57% preferred to ask Google</li><li>22% wanted to refer to the app/website</li><li>13% would have called up the customer care executives</li><li>the rest 7% preferred to visit the nearest branch.</li></ul><p>Let me share my understanding of each one of the options.</p><h3>Visit the nearest branch: 7%</h3><p>While the option of visiting the nearest branch has received the lowest votes, I believe this would be influenced by the ongoing global pandemic of Covid-19. The context here is if you want to know if the bank is working today or not, a simple answer is to visit the branch and find it out.</p><p>While the technologies are advancing and a lot of NEO banks are arising, there is still a section of people who love to visit the branch office.</p><p>While I am not surprised, that this is the lowest voted option, one of the participants helped me realize that the results might be flawed because the survey is being organized on linked-in and the language used is English. Also, the post will only be visible to my network which primarily comprises people working in the software and banking industries</p><p>There is a section of people (e.g. my parents) who do not feel comfortable with technology and would love to visit the branch itself for a more personalized and warm experience.</p><p>I believe in the real world (with or without the pandemic) this number would be higher.</p><h3>Call up the customer care: 13 %</h3><p>Customer care centers (CCC) as the name suggests are supposed to be caring for the customers. But being the second-lowest ranker, in a pandemic-affected era reflects truly how these centers have failed to achieve their objectives.</p><p>The comments section in the survey re-confirms my opinion that there is a need to rebuild the customer care model. There are quite a few problems with the existing system</p><h3>Long waiting queue</h3><p>Because the CCCs are human-powered, there is a limit to scale up with demand. which means long waiting queues and general disappointment of the caller.</p><h3>Lack of human warmth</h3><p>CCCs were supposed to be operated by humans, who understand other humans and the bank itself. With this knowledge, they can become a bridge between the customer and the bank.</p><p>I feel that the CC executives are no more than script readers. Just refer to the monotone that they use to talk to their customers. Radio jockey Naved actually played a prank on a customer care executive to call this problem out.</p><p>[Hindi Audio: <a href="https://www.youtube.com/watch?v=KTKsNCjGDOc">https://www.youtube.com/watch?v=KTKsNCjGDOc</a> ]</p><p>One pleasant exception to this is American Express. Try calling customer care of any bank, and then call up the American Express call center. You will feel a difference.</p><h3>Lack of experience</h3><p>Like everything else, knowledge of banks and serving customers is gained with experience. New people in the industry are bound to be impacted by a lack of experience in finding the correct information. I have personally felt many times that the executive on the phone doesn’t have the full information. It could be because of a lack of documentation, lack of experience, or even a human error. As a result, these problems impact customer experience.</p><h3>Check the bank’s app/website: 22%</h3><p>As a software developer, the results of this option were most heartbreaking for me. I read this as :-&gt; Approx. 80% of the people in my tech and banking network feel that the apps or websites we develop are worthless.</p><p>I mean, the apps are built by the banks for sharing information with the customers. The banks invest so much in the applications, but for a simple answer “Is the bank working today” people would prefer a third-party system (e.g. Google) more than the app itself.</p><p>We are definitely doing something wrong. I would try to understand more and share my findings with you in the upcoming weeks.</p><h3>The Winner: Ask Google: 57%</h3><p>Google (or the other search engines) today hold so much information and excel at providing ease and convenience of accessing the information that we tend to trust them more than the original owner of the information.</p><p>This option was voted more than all the other options combined. A whopping 57% of the participants preferred convenience over the bank itself.</p><p>The magic lies behind the thoughts and efforts Google has invested in user experience. The designs, performance, readability, and human aspects are taken care of. So this is a clear winner!</p><p>One of the participants went ahead and mentioned “I prefer checking with my google assistant”. That is indeed a novel and most convenient way of getting the information. You don’t even need to pick up the phone. Just call out loud “ Okay Google” (Or “Alexa” in some cases) and you get answers to your queries. Smooth!</p><h3>Conclusion</h3><p>From the survey and the comments, I can clearly deduce that people want convenience and ease of operations.</p><p>We can also conclude that the existing channels provided by the banks are lagging behind the channels provided by tech giants like Google.</p><p>I hope with these learnings, I am able to develop a solution that brings the banks back into the competition and win in owning their own information.</p><p>Originally published at <a href="https://www.linkedin.com/pulse/letting-customers-reach-out-you-mohit-kanwar/">https://www.linkedin.com/pulse/letting-customers-reach-out-you-mohit-kanwar/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c9b86813cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xebia-engineering/letting-customers-reach-out-to-you-e0c9b86813cc">Letting customers reach out to you!</a> was originally published in <a href="https://medium.com/xebia-engineering">Xebia Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>