<?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 Adriano Machado on Medium]]></title>
        <description><![CDATA[Stories by Adriano Machado on Medium]]></description>
        <link>https://medium.com/@adrianoricardom?source=rss-bbf4eb7cdf57------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*9yuIhkvTfwQstMp__dOdiQ.jpeg</url>
            <title>Stories by Adriano Machado on Medium</title>
            <link>https://medium.com/@adrianoricardom?source=rss-bbf4eb7cdf57------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:41:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adrianoricardom/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[React Navigation 5.0 — Navigating without the navigation prop]]></title>
            <link>https://medium.com/swlh/react-navigation-5-0-navigating-without-the-navigation-prop-ceeee6cc7d76?source=rss-bbf4eb7cdf57------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceeee6cc7d76</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[react-navigation-5]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[redux-saga]]></category>
            <dc:creator><![CDATA[Adriano Machado]]></dc:creator>
            <pubDate>Tue, 28 Apr 2020 23:28:46 GMT</pubDate>
            <atom:updated>2020-05-19T21:07:45.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>Navigating without the navigation prop — React Navigation 5</h3><h3>Navigation using redux or redux-saga</h3><p>React navigation comes with a lot of features that make it much easier to navigate within pages. But I got stuck for a long time trying to do something that I thought would be easy. <br>The main objective of this post is not to create an app from scratch, I just want to help you navigate in your application without the navigation props or without the context of a component, like a reducer or a redux middleware. So lets code!</p><h4>— If you are in a hurry jump to step 4—</h4><h4>Contextualizing</h4><p>Just to give you some context, my app simulates a delivery company and besides the admin page (a web application using ReactJS) we have this app used for the deliveryman, where he can see all the pending and finished deliveries, also he can start and finish the deliveries, the complete application is <a href="https://github.com/adriano-machado/fullstack-fastFeet">here</a>. But as it isn’t the focus of this article, let’s continue.</p><p>When the user clicks on a delivery, he goes to the first page of a stack navigator, and all other pages inside this stack use the informations about this “active delivery”. I didn’t want to pass the data about this delivery through each page in my stack just because it would be much harder to maintain. So for me, the perfect solution was to store this data on a reducer state and access this from any page in my stack (or outside it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*2-LQK-ryxXvf_nVCdwLMbw.png" /></figure><h4>1- My problem</h4><p>So you might think, it’s ok, I just need to dispatch an action and after that navigate to the delivery details page. Well if you are here maybe you already realize that it isn’t so simple. If you try to this, you will realize that your navigation reaches you to the page before the reducer updates its states and you won’t be able to use the information when you reach the page.<br>And as you might know, you can’t just put an “await” before a dispatch.</p><p>When we are in ReactJS all we need to do is use the ‘history’ library. Import it on our reducer or saga, and then navigate with this (ok, we have one or two more steps here). But we don’t have a ‘history’ to use here. So we need to do some more steps to achieve this result on React Native. Cool, so stop talking and show me the code.</p><h4>2- Solution</h4><p>When the user clicks on “Details”, let’s look at what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*Kc3bh7HruYaZPS_xRTdkSA.png" /></figure><p>It just dispatch a function, so let’s see what the function does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*lN2JH2QtjKAQbKx7OqiWCg.png" /></figure><p>This function dispatch an action that is heard by two files, the Delivery reducer, and the delivery saga.</p><h4>3- Reducer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*CbuN2vKOboILUXjfxRaQCg.png" /></figure><p>If you don’t know what this ‘produces’ does, don’t worry, it isn’t important for the scope of this article. It is just a lib that helps you to do some operations in your state without the need to worry about immutability. If you can’t go on without knowing exactly what it does, click <a href="https://immerjs.github.io/immer/docs/introduction">here</a>.</p><p>It is a simple reducer that just stores the data passed to it. <br>Ok but I want to know about the navigation!</p><h4>4- Navigation</h4><p>Do you remember I said that the action is heard by two files? I absolutely could do the navigation on the reducer file, but just to follow SoC (separate of concern) I used the saga to handle with navigation, so let’s see my saga file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*8DTaBRCQ_7AmQihQlGmkpQ.png" /></figure><p>If you are not familiar with <a href="https://redux-saga.js.org/">redux-saga</a> or redux middleware, don’t worry, it doesn’t make any difference, but just to clarify, the “takeLatest” method binds the action “<a href="http://twitter.com/delivery/SET_ACTIVE_DELIVERY">@delivery/SET_ACTIVE_DELIVERY</a>” to the function “redirectToActiveDelivery”. <br>But all you need to pay attention is the RootNavigation being imported, and you can use it EVERYWHERE in your application and it will handle any navigation function you need.<br>Let’s see how it works.</p><h4>5- The RootNavigation</h4><p>This file was created looking the react-navigation docs, but I took a long time to find and I think it could be clearer in the docs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*hBUDH-dCtHHaO9UmcsVfAQ.png" /></figure><p>You can add any function from navigation you need, in my case all I needed was the navigate function.</p><p>Now the last step is to give this navigationRef to your navigation container. You can pass it through props on your main route component like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*7LE5Y-Z83_PnTCyEwOpZpw.png" /></figure><p>And in your navigation container you receive it as the second parameter of your component. Set the ref attribute with the ref value received. (You can safely ignore all the rest).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*S4KnHAMMPSK1RUYtQnybMg.png" /></figure><p>And last but not least, you export your function wrapped by the forwardRef hook, to pass this ref to children&#39;s components. You can import it from React, like</p><pre>import React, { forwardRef } from &quot;react&quot;;</pre><h3>Until Next Time!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceeee6cc7d76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/react-navigation-5-0-navigating-without-the-navigation-prop-ceeee6cc7d76">React Navigation 5.0 — Navigating without the navigation prop</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentaho Data Integration ]]></title>
            <link>https://medium.com/soma-labs/pentaho-data-integration-a7b754fae960?source=rss-bbf4eb7cdf57------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7b754fae960</guid>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[pentaho]]></category>
            <dc:creator><![CDATA[Adriano Machado]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 20:26:19 GMT</pubDate>
            <atom:updated>2019-02-28T18:29:05.534Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pentaho</h4><p>O<a href="https://www.hitachivantara.com/en-us/products/big-data-integration-analytics/pentaho-data-integration.html"> Pentaho Data Integration</a> é o componente da suíte Pentaho usado para criar processos ETL que alimentam o banco de dados, o Pentaho é a suite mais madura da ferramenta e já possui mais de 10 anos de existência.</p><p>Sua principal vantagem é a fácil integração a diferentes programas. Por ter códio aberto, pode ser customizado de acordo com as necessidades de cada usuário. Pra ficar ainda melhor, a aquisição ou licenciamento da sua versão Community é grátis, o que faz deste software uma das soluções mais viáveis do mercado, aliando baixo custo e bons resultados.</p><h4>O que é um ETL ?</h4><p>Pela definição do <a href="https://pt.wikipedia.org/wiki/Extract,_transform,_load">wikipédia</a>, “ <strong>ETL</strong>, do inglês <strong>Extract Transform Load</strong> (<em>Extração Transformação Carregamento</em>), são ferramentas de software cuja função é a extração de dados de diversos sistemas, transformação desses dados conforme regras de negócios e por fim o carregamento dos dados em algum banco de dados” como por exemplo : SQL, Mysql, PostgreSQL, Oracle, etc. “A extração e carregamento são obrigatórios para o processo, sendo a transformação/limpeza opcional, mas que são boas práticas … Os projetos consolidam dados de diferentes fontes. A maioria dessas fontes tendem a ser bancos de dados relacionais ou arquivos de texto mas podem existir outras fontes. Um sistema ETL tem que ser capaz de se comunicar com as bases de dados e ler diversos formatos de arquivos utilizados por toda a organização.”</p><h4>Principais funcionalidades</h4><p>Bom, deu pra perceber que o Pentaho é capaz de realizar bastante coisa, pra deixar as coisas mais simples e consolidá-las vamos listar as principais operações desta incrível ferramenta.</p><ul><li>Migração de dados</li><li>Limpeza de dados</li><li>Transformação de dados</li></ul><h3>A interface gráfica do Pentaho Data Integration:</h3><h4>Spoon</h4><p>O Spoon é a interface gráfica que facilita a elaboração de rotinas e lógica ETL, através de seus dois tipos de artefatos Jobs e Transformações.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lDGPBH6XN6Cb26W3rF6Eg.jpeg" /><figcaption>Interface gráfica do Spoon</figcaption></figure><h4>Jobs</h4><p>Um Job realiza operações completas uma a uma, ele permite combinar as transformações em uma sequência desejada e com isso automatizar uma determinada tarefa. Os Jobs não possuem muitos recursos para manipular os dados, deixando isso para as Transformações, que veremos um pouco adiante.</p><p>A lista de funcionalidades completa está disponível na Wiki do projeto: <a href="https://wiki.pentaho.com/display/EAI/Pentaho+Data+Integration+Job+Entries">Jobs</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xo79Tki3esuZOl7M95nQMg.png" /><figcaption>Um Job, contendo uma série de transformações.</figcaption></figure><h4>Transformações</h4><p>É nas Transformações que o Pentaho mostra à que veio, é na Transformação que a operação sobre os dados ocorre de fato, registrando os procedimentos de extração, leitura e exportação dos dados.</p><p>Como uma imagem vale mais que mil palavras, vou mostrar uma transformação e explicar o passo-a-passo dos principais Steps que ela possui.</p><p>O objetivo principal dessa Transformação é importar uma tabela de um banco de dados SQL, realizar algumas transformações, introduzir alguns campos e exportar esses dados para um banco de dados MySQL, a transformação possui uma regra, se determinada linha não estiver presente no banco de dados MySQL, ele a introduzirá, se tal linha já estiver no banco de dados, ele a atualizará.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sC2pX3abYku6YOqOF9kp-Q.png" /><figcaption>Transformação com os Steps</figcaption></figure><h4>Step 1.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKk3RA00BVdk-oB-MwlJKw.png" /><figcaption>Step 1</figcaption></figure><p>No primeiro Step, “Input Table” nos conectamos à um banco de dados (SQL server) e escrevemos a query desejada correspondente aos dados que queremos extrair.</p><h4>Step 2.</h4><p>No segundo Step, “String Operations“ realizamos algumas operações com strings para termos certa homogeneidade dos dados.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pYLGUklExeV_cHmo6FgvAA.png" /><figcaption>Step 2</figcaption></figure><h4>Step 3.</h4><p>No terceiro Step “Select / remove values” apenas mudamos os nomes das colunas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycGq582nHZRo7Gj1lw3zHw.png" /><figcaption>Step 3</figcaption></figure><h4>Step 4.</h4><p>No quarto Step “Database lookup” verificamos se o valor de determinado campo é correspondente com o da tabela em que faremos a verificação, e retornamos algum valor desejado. Neste exemplo, verificamos se o campo “cor_material” (SQL server) é igual ao campo “cor” da tabela Material_Cor(MySQL) se os valores forem iguais, retornamos o valor “id_material_cor” da tabela Material_Cor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GYH274bsAp8PXqjejL_M_g.png" /><figcaption>Step 4</figcaption></figure><h4>Step 5.</h4><p>No quinto Step “Filter Rows”, é importante notar que temos uma divisão do fluxo. Pra cada linha que entra neste step, ele faz uma verificação dos campos “material” , “cor_material” e “ordem_producao” e neste caso, se algum desses valores for “null” essa linha segue para o Step “Dummy”, caso contrário, a linha segue para o próximo passo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsAHJd1bltblyO-dkaGsFA.png" /><figcaption>Step 5</figcaption></figure><h4>Step 6.</h4><p>O sexto Step “Database lookup” é um dos steps mais importantes da transformação, pois é nele que será feita a verificação se determinada linha já existe na tabela do banco de dados alvo ou não. É importante lembrar, que neste Step, também temos uma separação de fluxo, se a linha em questão, já existir na tabela alvo (MySQL), ela seguirá para o Step 8 para posterior atualização dos valores. Caso contrário, ou seja, caso esta linha ainda não esteja presente na tabela, ela será inserida no banco de dados (MySQL) no Step 7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DOsJaU--6k0U8QFt8p8LA.png" /><figcaption>Step 6</figcaption></figure><h4>Step 7.</h4><p>No sétimo Step “Table Output”, só chegam as linhas que não se encontram na tabela alvo (por conta do database lookup realizado no Step 6). E neste Step, nos conectamos ao banco de dados em que queremos inserir os valores (MySQL) e determinamos os campos que serão preenchidos, como podemos ver na figura abaixo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4XZBd8qAvf4--BWaKg7eg.png" /><figcaption>Step 7</figcaption></figure><h4>Step 8.</h4><p>O oitavo Step, é um Step redundante, que apenas confirma se determinada linha vindo do Step 6 realmente já está em nossa tabela alvo, no banco de dados MySQL. E caso não esteja, essa linha segue para o step “Dummy”. O fluxo de informações restante segue para o Step 9</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rvqDKxof7BK0BFCEd0SR4g.png" /><figcaption>Step 8</figcaption></figure><h4>Step 9.</h4><p>No nono Step “Update” os valores que já existem na tabela são atualizados com os valores do fluxo provenientes do Step 8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jY5vEE3gjUcuuvbrxntJCA.png" /><figcaption>Step 9</figcaption></figure><p>Como foi possível ver, com o Spoon (interface gráfica do Pentaho) conseguimos realizar uma série de operações nos dados de maneira simples e intuitiva, desde a importação dos dados de um banco de dados, manipulação destes dados, e a importação tanto para um outro banco de dados, como para uma planilha do Excel, um arquivo CSV e etc.</p><p>No wiki do projeto podemos ver a lista de funcionalidades completa das <a href="https://wiki.pentaho.com/display/EAI/Pentaho+Data+Integration+Steps">Transformações</a></p><h4>Consolidando os conceitos Job x Transformação</h4><p><strong>Job (*.kjb): </strong>Passos são executados sequencialmente.</p><p>Opera sobre o fluxo de ações</p><p>Organização</p><p><strong>Transformação (*.ktr): </strong>Passos são executados simultaneamente</p><p>Opera sobre as linhas de dados</p><p>Cálculos, carga de dados, aplicação de regras de negócios.</p><h3>Muito além da Interface Gráfica</h3><h4>Pan</h4><p>Como foi dito anteriormente, o Spoon é a interface gráfica que auxilia na criação dos processos de integração de dados. Porém, para execução em produção, utilizamos outros programas que operam sem a interface gráfica, para isto, temos o Pan, que executa as transformações sem a interface gráfica.</p><h4>Kitchen</h4><p>Da mesma forma que temos o Pan, para executar transformações sem a interface gráfica. Também temos o Kitchen, para executar os Jobs sem a interface gráfica</p><p>Tanto o Kitchen quanto o Pan podem ter suas execuções agendadas para serem realizadas automaticamente em intervalos de tempo regulares por alguma ferramenta de gerenciamento de tarefas.</p><h3>Conclusão</h3><p>O uso de um ETL largamente utilizado como o Pentaho traz uma série de vantagens para nossa unidade de negócios. Por exemplo : uma boa estruturação das tarefas a serem realizadas, menor tempo de desenvolvimento, uma interface gráfica intuitiva que representa visualmente o fluxo de dados (Transformações) e a organização de tarefas (Jobs). Pra fechar com chave de ouro, está disponível para diversas plataformas (Linux, Windows e Mac OSX)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7b754fae960" width="1" height="1" alt=""><hr><p><a href="https://medium.com/soma-labs/pentaho-data-integration-a7b754fae960">Pentaho Data Integration 💻</a> was originally published in <a href="https://medium.com/soma-labs">soma-labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>