Posts

Showing posts from 2021

Builder Pattern in Rust

Image
Builder Pattern is useful when we need to create complex objects(structs in rust case). Also if you want to do a fluent DSL Builder is a useful pattern for that as well. Today I will show how we can implement this Pattern in Rust, so I have a simple POC to show and also a video. So Let's get started! 

Concurrency in Rust

Image
Rust has amazing support for concurrency programming. Today I will cover Mutex, Rc, RefCell, Channels, and Threads. I might make a second post covering the rest of the concepts like Arc. Rust dont have green threads since focus on having zero cost of abstractions. However, using channels we have a powerful abstraction to work with threads. Combined with Rc/Arc and RefCell/Cell we have a good foundation for good concurrency programs. Today I want to share 4 small pocs and 4 videos about Mutex, Rc/RefCell, Threads, and Channels in Rust. Let's get started!

Add trait in Rust

Image
Rust has this interesting trait called Add  which allows us to use the + operator and add 2 structs together. This is very useful for numeric types but also for engineering productivity lets say you are building a DSL for instance or an internal DSL. So I made some implementation and a video - Let's get started!

Closures in Rust

Image
Rust allows us to do functional programming. One important thing in FP is being also to pass functions as parameters and also return functions which are also called high Order Functions. Today I want to share 2 videos and 2 pocs showing how we can do High Order Functions in Rust also you will get currying for free :-). I also will show how we can do closures using traits as well. So Let's get started!

Java Agents

Image
 Java Agents are an interesting capability of the JVM. Agents can either be Static(Load when the java app starts with a special flag) or they can be Dynamic(using the dynamic API from java we can dynamically bind to a specific JVM PID. Agents can be used to run any code before the app starts or even to change the bytecode. The cool thing about agents is the fact that is a runtime thing and we do not need to change the source code of the target app. Agents are similar to Aspects but IMHO much better. Mockito uses mocks in order to test difficult scenarios, pretty much all observability solutions for logs and metrics also have agents. Today I want to share 2 pocs, one using a vanilla java app and doing bytecode manipulation, The second using Spring Boot 2.x and running code forever in a background thread as the app also runs. So Let's get started!

Java Bloom Filter

Image
Bloom Filter is a probabilist data structure, created in the 70s. The data structure is used to test if an element is a member of a Set. False Positives(possible in Set) are possible but False negatives(Definitively not in the set) are not. Who uses Bloom Filters? Apache Cassandra, Google Bigtable, Apache HBase, and Postgress to avoid Disk Lookups. Bloom filters are also used by Akamai CDN to prevent one-hit wonders to hit the disk. Medium use Bloom Filters to avoid recommend articles the user already read to the user. Bing, Squid Proxy, Bitcoin, Ethereum also use Bloom Filters. Today I want to share a simple Bloom Filter implementation in Java. So Let's get started! 

Java Bitwise

Image
Bitwise operations are faster and secure. Highly used in Security/Encryption,  Finite State Machines, Graphics, Comunication over ports/sockets, and Bit Fields. Java has support for: AND, OR, Complement, Signed/Unsigned Right Shift, Signed Left Shift. Java does not have Unsigned Left Shift. Today I want to share a simple POC showing all these operations and understanding them in detail. So Let's get started! 

Simple Dummy Clojure Parser in Rust

Image
This is not a production-ready neither serious parser, it's for pure fun! I was bored during one of the pandemics late nights watching Sam Rose's 3h parser video . So I decided to do something similar, inspired by Sam's video. Of course, I did not want to make a 3 hours video fighting Rust compiler - which is the ultimate reality but something shorter. The code is similar but I have few more operations like * and inc.  I also using a queue for Args not Stack so we can preserve ordering. So this is a cool way to learn rust because in the code we will be using Stack and Queue Data Structures and basics of borrow and ownership in rust. Let's get started!

Vector in Rust

Image
Vector is a core collection in Rust. Vector(Vec) can be used for storing a list of values or even if you need a Stack - it's your data type. Rust language is pretty fast and secure however dealing with borrowing, ownership, and lifespan lifecycle is a high wall that often you can bash your head pretty hard against it. Returning Vecs and passing them as parameters could be pretty challenging if you were new to Rust. Strings also are pretty challenging in Rust. So today I want to share a video doing common operations with Vecs but always using functions and passing Vecs and Receiving Vecs. Hopefully, this will be useful in your common and daily work with Rust. Let's get started!  

Thoughts on Internal Complexity

Image
Complexity is something that needs to be managed down and is an eternal battle. Part of the battle is to stay away from the style and cosmetical changes. Can we really get 100% of style discussions? Even removing discussions of 2-4 tabs, there will be some form of style on the discussion because every engineer has a background towards JEE, Spring, or Functional. That's a greater generalization, and there are other "design schools" over there but still quite common to find people within these 3 backgrounds. A Philosophy of Software Design is a great book that explains what complexity means. In the book, complexity is mainly described as "Obscurity," something that is not readable and has a high cognitive load to be understood. IMHO some problem spaces require you to have some background and experience on how some problems are solved; otherwise, it might look the worst they actually are. Complexity discussion often hard since lots of engineers have high EGO and h

CDKs

Image
Cloud Development Kits are becoming very popular. Terraform, Cloud Formation, and many old solutions in the sense of infrastructure provisioning support CDKs. All infrastructure provisioning started as an OPS-ish thing, and often developers/engineers were far away from that. Terraform did a good job of being declarative for OPS and being simple and easy for developers. However, today there is a push to have provisioning happening into multiple programming languages such as Python, Javascript/Typescript, and even Java. Mainly to be more developer-friendly and really on the power of established programming languages. There are a bunch of CDKs popping up nowadays. However, CDKs have a price, code generation, and underlying complexity. Today, I have a slide cast and 2 code demos to show you CDKs more detail and compare them with standard solutions like Terraform. Let's get started!

Java Properties Deep Dive

Image
Properties are around since java.  Properties are a persistent form of K/V pair which is mainly used for configuration. Configuration can be extrapolated all the way down to Feature Flags, Feature Toggles, and Canary. Java properties are cool because they are a simple API that allows you to do simple and yet powerful programing around them. There are 2 interesting projects enhancing properties such as Apache Commons Configuration and Netflix Archaius . These projects are pretty cool and give you killer functionally however the Java Stand SDK can also be pretty powerful if you have enough creativity and know-how to use it. So today I want to share a video exploring the Java Properties API in Depth showing how we can do some pretty powerful and simple configuration management for Dynamic Configurations, Feature Flags, Toggles, and more. So Let's get started!

My 2 Cents on "On the Diverse And Fantastical Shapes of Testing"

Image
I want to share my cents about the post: " On the Diverse And Fantastical Shapes of Testing ". First of all, I believe this is a very interesting subject and yet still see very few engineers talking about it. People mostly take tests for granted. Secondly, I would like to acknowledge the parts I agree with on this post mainly around the concept of Sociable and Solitary Unit Tests are quite useful and show be widespread. Also with the need for teams to have reliable, fast, Bounded(Isolated) and not Flacky on Justin tweet . Now that I acknowledge that, let me elaborate on what I think we are missing and why IMHO the pyramid is dated and we need a mentality shift. I have 4 points I want to elaborate on and give more context.

Fat Jar with Scala 2.13 and Sbt 1.5

Image
Fat Jar is a very useful technique. Having one jar and one jar only makes the distribution of software much easier and also mantaince much more sense as you need to roll out bug fixes and changes. Scala allows us to create self-package, self-executing one single fat jat by using the Assembly plugin. Today I want to share a simple POC and video I made showing how we can create a Fat Jar using Scala, Assembly, and Sbt. The code will be using a java dependency, a project called Apache Commons Lang .  So let's get started! The Video The Code https://github.com/diegopacheco/scala-playground/tree/master/fatjar-assembly-sbt-1.5.0 Cheers, Diego Pacheco

Java Visibility Options

Image
Java has 4 visibility options: Public, Protected, Private, and Default. However, is those visibilities enough? Sometimes we need to weigh tradeoffs between different dimensions such as Design, Abstraction, Testing, and Security. C++ Has interesting fine-grained, class-level control with a friend. Java does not have that, but there are some interesting options we do in order to imporve things a bit. Today I want to share a video going through the options we have in Java. I also will show some C++ code so we can see how C++ would handle it. Java also has modules but that is not widely adopted in the industry as most companies still run on java 8. So Let's get started! The Video The POCs  https://github.com/diegopacheco/cpp-playground/tree/main/friendly-visibility-fun https://github.com/diegopacheco/java-pocs/tree/master/pocs/caller-fun https://github.com/diegopacheco/java-pocs/tree/master/pocs/visibility-control-design-poc Cheers, Diego Pacheco

Encryption Deep Dive

Image
Encryption is super important nowadays.  However, it is straightforward to end up making the wrong choices and compromising your brand and customer experience. AWS CTO Warner Vogels once said Security is everybody's job. Today I want to share another Slidecast I made about Encryption. We will do a Deep Dive into the Encryption problem space, and also, we will see how to do the basics with Java Standard JDK. No Matter if you are a DevOps Engineer or Engineering, you might found this useful. I will cover Symmetrical encryption in-depth, RNGs, PRGNs, AES, AES Operational Modes, Rotation Challenges, AWS KMS, Java Code, and more. So without further due, let's get started! 

Security 101

Image
Security is the new black. Years ago Tests were not widespread as they are today and the same happened with DevOps where automation, Infra as Code, Versioning become the norm today. However, for security, we are not there yet. I believe this will change in the next years and more and more security is a concern where the teams need to care about and understand more about. Security can be pretty scary but at the same time is not rocket science and you can learn it for sure. Today I made a slidecast which I want to share with you guys and go over the security principles, common vulnerabilities and attack vectors, culture, trends, and much more. So Let's get started!

Reflections on Legacy Code

Image
Every company has a legacy code. Often we confuse legacy with multiple different concepts, and this confusion makes improvements harder to happen. Most engineers don’t like to deal with legacy code-we all like shiny new things. Unfortunately, most of the time, there is no easy way out. It is possible to replace a legacy system with a brand new system because it is easier and faster than fixing all the legacy’s problems. We can’t get out of legacy systems because they have old languages, old databases, and often messy. Is that so? However, there are 2 kinds of old languages. The ones who are dying and dated like Delphi or Clipper and the other ones are old but are perfectly fine to use C++ or Java. I’m not defending legacy systems; however, I believe several essential aspects need to be considered. Old: Mature vs. Dated Commonly, we confuse mature software with dated.  Boring technology  is full of good arguments there. Old technology not necessarily means it is terrible. I would argue

Threadcast: A morte dos Microsserviços com Diego Pacheco

Image
Normalmente eu nao blog em português, mas hoje quero compartilhar um programa que participei recentemente. Programa gravado com o Inacio da South System sobre Arquitetura de Software, mais especificamente falando de Microservices, SOA, Shared-Libs e bem como os problemas e as soluções. Microservices estão em baixa nos dias de hoje. Porém muitas vezes não entendemos por que estamos usando microservices e nem por que estamos parando de usa-los. Muito difícil conversar sobre SOA e microservices sem falar de shared-libs e o impacto nessas arquiteturas. Nessa conversa você ira entender mais os problemas desse landscape bem como muitas alternativas para editar esses problemas. Entao bora la ver esse video! 

Teams Evolutions

Image
Every company out there works with teams. There are all sorts of teams such as teams specialized in technology stack like Hadoop or teams which are domain-driven and have cross disciplines( Cross-Functional Team ) inside such as backend, frontend, QA, UX, Architecture, and more. People don't leave companies they leave teams, also it would be accurate to say that people don't join companies and they join teams. So should we have dynamic or static teams? Should teams self-assemble or should we have PMO doing that? Should the teams be stable or should we allow dynamic reteaming? Is work always fitting well in our team's structure? What about Platform vs product teams, which one is best? Should we just pick one model or should we use different models? Should engineers organize around managers or managers organized around engineers? Teams affect Architecture and our perception of ownership. Teams should be a people organization but often is just a grouping of people where everyb

Reflections on SCM

Image
Branches are almost a religious topic on technology. Git made branches easier and the default approach nowadays. However, do branches always help us and improve the status quo? Do we understand where we are going and what goes do we have or are we just following the herd and choosing technology as a fashion choice? Branches can impact your Refactoring, Code Review, and Collaboration habits. Branches also have high relation with software architecture or the lack of then. Many teams want to do CI/CD or at least talk about modernizing the release technologies but do all teams understand the principles behind it. To answer these questions and many others: Today I want to share a slide cast I made about branches and SCM in general. Doing some reflections and thinking about the benefits and the issues around branches. So Let's get started! 

It's all about Contracts

Image
SOA(Service Oriented Architecture) is all about contracts. Contracts can either be managed explicitly by doing Contract First, Customer-Driven Testing, having POs manage the contract as an important asset as much as a UI is. Contracts can also be unmanaged or managed implicitly just pushing problems to consumers and making the whole org move slowly. So what is a contract anyway? Why should we care?  The contract is all Data, Behavior, and expectation involved in the services capabilities. It's easy to see just the endpoint's input and output data and forget about the rest. The rest is smaller things like data formats, access protocols, serialization formats, and do not forget about expectations. For instance let's say you are returning a list of customers, if the data is in ascending or descending order it might affect your consumer code or tests.  Contracts cab be versioned and we should have specific tests on the Implementation provider side in order to make sure we don&#

My 2 cents about UML

Image
There were some interesting posts about UML recently. Mainly being  “   Has UML died without anyone noticing? ” and “   Why UML “Really” Died ”. I also made some po s ts about UML in the past — mainly “   UML Hidden Gems ” and “   Architecture 101: Thinking about Design ” and “   Internal System Design: The Forgotten Discipline   “. IMHO success means decline and eventually abuse. That happened to all successful movements, technologies, and methodologies I can remember such as Agile, Architecture, DevOps, Docker, Spring, and many more. Yes UML was abused and used in the context of the heavy and rigid process. UML was often used for all CRUDs which does not make sense and does not add value. But honestly, if we see things with DDD lens even CRUDS don’t make sense especially with UX sense CRUD are not ideal at all. IMHO what happens is we are exposed to fashion and marketing. There is internal and external pressure to do things in one way instead of another. UML had issues yeah for sure

Restarting Spring Boot Applications

Image
Spring Boot is the standard framework for developing java services nowadays. It's more than normal to have multiple deploys into productions during the day if you are not trapped by a release calendar or release train which should be a temporary thing and end up being a permanent thing. Ideally, you will have 3 at least 3 instances of your service, one for each availability zone in AWS. In order to introduce changes, DevOps often apply a pattern called Rolled Updates where often you patch one service and restart the application and then you do that one server at a time. In order to do that you server should be able to handle a clean shutdown and manage restarts smoothly which requires some config or code in your service side and also some consideration in sense of release resources, deny connections and prepare the land for a proper restart to happen. You might be in the middle of an important transaction so maybe you want to finish that first. For services is common to use the Sag

@Value and Spring Properties

Image
@Value annotation allows you to inject either values or results of expression into fields or even methods and constructors. Spring has several mechanisms to deal with configuration and dependency inject. IMHO for Services is more them fine to use all these features, however for libraries we need to be extremely careful and I would say you don't want to use any of these capabilities. We also need to be careful about versioning properties inside jars, especially for libraries. It's very easy to get unpredictable behavior. So great powers require great responsibility and thinking beyond anything I made a video showing some of this feature and also some simple POC - so let's get started!

Management: Doing the non-obvious part III

Image
Like we say in Brazil (Todo Carnaval tem seu fim) all carnival has an end. This is the end, my friend. It's the final slidecast on the series. If you did not watch  part 1 and part 2 I highly recommend you do. Part 1and 2 I covered +40 books, 20 each slidecast, and today I will cover +20 more. Total +60 books. Even if you dont agree with all ideas here I recommend you watch them because you will see common patterns and connections between books and might get some insights or reading recommendations. So Let's get started! 

Testing AWS Lambdas with Java

Image
AWS Lambda is an awesome Serverless implementation. Lambdas are a bit tricky because they are ephemeral and short-lived so either they call another lambda or they will mutate some external state. Either an external data store like RDS, Aurora, S3, Kineses, Elasticache or they will call another microservices that does state mutation. In order to properly test Lambdas, we need to design for testability, the easier thing to do is always create more lambdas because you can check the input and output. So lambdas are not pure functions(functional programming) they often need to have side effects. So AWS has this library that makes it easier to test lambdas for Unit Testing / Mocking but also for localized Phased Integration Tests. You can mock source events like S3 ones, and also mock the context, and just test your lambdas with Junit. So I made a simple POC and video I want to share with you guys. So Let's get started!

Mock Server

Image
Mock Server is an interesting and useful testing solution. Mock Server allows HTTP and HTTP Tests and verifications. Mock Server supports Java and NodeJS. Mock Server requires requests to match expectations. It's not that different from a unit test from JUnit. However, Mock Server has the expectations in a central server and you could version those expectations as Json files for instances or use the standard API in order to create the with programmatic code in Java or NodeJS. So today I made a simple POC showing how we can use Mock Server, both with Java and JUNIT in an embedded fashion but also in standalone mode and using the dashboard UI mock server has. So Let's get started!

Manage Work not People

Image
Lean / Kanban was always about managing work instead of managing people. Often mention as Manage the flow. Organizations are about organizing people, but they should be about organizing work instead. As organizations grow, it's harder to make an impact and easier to get benefits. Safi Bahcall, the Loonshots book, says that as organizations are growing, the perks become much easier to get rather than impact(outcomes). That's why politics and empire-building strike. Leaders need to be explicit about managing flow. Otherwise, organizations tend to focus on local hierarchies and produce local optimization(classical Lean issue).  If we should manage work/flow instead of people(Some coachs also called it to manage the system). Should we have teams? Are teams silos? Are silos always bad and wrong? When should we create a team? When should we decommission a team? Work often happens on teams, people leave and join companies because of teams, but would teams get into the way sometimes? H

Spring-Boot Native Image

Image
Spring Boot is the most popular java stack nowadays. New languages like Go and Rust are capable of creating a single binary, self-contained with all deps to run the application. This is great for deployment simplicity but also easier to maintain. As time pass we want to have fast bootup times and do more with less. The native solutions are fast since they are statically compiled for a target platform or OS(in the case of UniKernels). Java was designed to be better as time pass(Runtime) and optimizations kick in. However thats not ideal for Serverless applications. GraalVM changes that since allowing us to compile JVM applications(Java, Scala, Kotlin) to native applications. Today I want to share a simple Video + POC using a new project called Spring Boot Native which allows us to create native images to spring boot apps.  Native images have some challenges like Type Erause for C++ and Reflections in Java. So Let's get started!

BOM

Image
BOM(Bill of Materials) is an interesting technique to simplify dependency management. Dependency management is often a lost discipline nowadays and often developers dont care about dependencies. BOM is a way to make dependency management easier, however like anything in this world it can be abused. So be careful to not create a massive monolithic BOM with all your dependencies because that would be another microservices killer . 

Java SPI

Image
Java SPI is a standard java way to have binding between contracts and implementations. SPI used for several use cases such as Currency, Locale, TimeZone, DateFormat, Number, JDBC Driver, JPA, Json, JasonB, and many more. I believe the most classical example is for JDBC/JPA use cases where you have one common spec(contract) and multiple implementations for each database driver such as MySQL, Postgres, etc... SPI is interesting, shower I would not use SPI for common bread a butter SOA / Microservices use cases. Because often you just have one contract and one implementation, for that case using the new keyword or even basic DI/IoC I would say is much more desirable, easier, and much more simple and straightforward. However, if your use case has multiple implementations(beyond versioning) thats definitely something you should consider.

Lo4j2 Async Logger and Benchmark

Image
Lo4j is an old logging framework. Sometime ago Logback was faster than lo4j. Now, lo4j2 is the fastest and coolest kid on the block.  Logs are the eldest and primitive form of observability. IMHO observability has many different use cases such as Troubleshooting, Business Discovery, Performance Troubleshooting, Reliability Assurance, and Testing. IMHO you could use logs for all those use cases, however, IMHO logs are best suited for troubleshooting and metrics and better suited for general observability. Logs can destroy application performance and often are the number 1 culprit of slowness. Log4j2 makes logging faster due to async logging and LMAX Disturptor as the secret source. However I would question if you just use logs nor dont use metrics and traces. 

Design is not Subjective

Image
Design is not Subjective! I know we have bad actors out there and several times people do Bad Design and use subjectiveness as a way to control the dialog and shut down conversations. Today I want to explore more why I believe design is not subjective and Design is done by Design. Design is about Goals, Purpose, and Structure. Decisions are driven considering a particular problem Domain and thats an important matter. When we do design without considering a domain we often step into a code problem, not into a design problem. Just looking at the code misses the point and ends up killing the design. Today I want to share a slidecast I made going deeper on these questions and hopefully I will be able to demonstrate to you why Design is not subjective at all or at least why it should not be. Let's get started!

Jupyter Notebooks

Image
Jupyter Notebooks are very popular in the Big Data / Data Science field. Notebooks are a great tool for discovery it allows us to have interactive code and abstract the runtime environment. Notebooks are sharable and are cool not only on the Big Data / Data Science landscape but also for anyone who wants to write better documentation, have better code examples for your consumers, or even just to learn pretty much anything. Jupyter notebooks are written in Python however is possible to install other Kernels for other languages like Java, Kotlin, Scala, Groovy, Go, Rust, and many more. Github knows how to read Jupiter notebook files and provides great visualization for you.  So today I made a short video showing some Jupyter capabilities across multiples kernels. 

Why Micro frontends might fail as microservices

Image
Micro frontends were highly inspired by Microservices. So why not extend the same benefits from microservices to micro frontends, right? Things are a bit easier at the backend because we can actually have proper and real isolation . Meaning process/machine isolation, since we can distribute workloads in different machines. When we are looking into micro frontends is not the same deal. We also need to remember that microservices were highly inspired by SOA and Microservices are a flavor of SOA. Microservices are DEAD and in decline for the Backend, so it's interesting to see it's a major trend for the frontend. At the end of the day the Browser architecture did not change much and in the backend is much easier to have isolations and we have different flavors of isolations like Docker , UniKernels , MicroWorkers , etc... 

Architecture & Engineering: Doing the non-obvious!

Image
This is the first slide-cast for Architecture and Engineering: Doing the non-obvious. This slide-cast was inspired by the Management: Doing the non-obvious series ( I and II ). For this slidecast, I will cover some non-traditional and non-obvious vision and philosophy about Engineering and Software Architecture. I also will recommend +20 books so you can improve and also get more insights. Buckle up, I will challenge several traditional and established ideas. So I hope you guys like it - Let's get started! The Video The Slides Architecture & Engineering: Doing the non-obvious! de Diego Pacheco Cheers, Diego Pacheco

Advanced Reflection in Java

Image
Reflection is a killer feature in Java Language. It's a technique that combined with annotations and interfaces allows us to do Dynamic and Generic programming which could be complete abstractions or even customizable callbacks. Reflection allows us to do Dynamic discovery in sense of Types, Methods, Fields, Methods, and Annotations. People often couple Annotations with Aspects or AOP. You do not need Aspect you dont need AOP in order to do Generic and dynamic programming using Annotations. Today I want to share a simple POC I made to show the power of annotations combined with Reflection. We will do a 2 layer abstraction pattern. The first level is more generic and the second level allows customization. So Let's get started.

Scala 3.0

Image
Scala 3.0 is not out yet but has some interesting new features. I'm still digesting some features some I have some mixed feelings about it. One of the main big changes is the support for Python-like syntax. Scala 3.0 has lots of shortcuts, types of convenience, and different ways to do generics. Scala always had the philosophy to be flexible on the language level and let the tools and companies restrict functionality, so this still pretty much very true. I made a series of 3 videos going over some of the changes in Scala 3. This material is highly inspired by the scala 3 boo/docs. Some code and features on the videos will not be limited by scala 3 but also cool things about scala 2 or even scala in general but mostly I will be talking about scala 3.0. Keep in mind scala 3 is not final so things could change but I believe you gonna be able to have a good sense of what to expect and what's going on. So Let's get started. 

Functional Programming in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Functional Programing. FP is a very interesting way to think and create safe programs. Today we will cover High Orde Functions, Lambdas, and also Class extensions. So today I made a simple video and code POC. Let's get started! The Video The Code https://github.com/diegopacheco/kotlin-playground/tree/master/kotlin-fp-fun Cheers, Diego Pacheco

Generics in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Generics. Generics are super important for any language. However, some languages abuse generics and have gaps. Generics are important for code reuse and also to enforce type constraints for safety. Kotlin has some interesting ways to express type constraints. So today I made a simple video and code POC. Let's get started!

Reflection in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Reflection. Reflection is needed to perform some generic computations often to reuse code around some metadata processing. Kotlin separates Java and Kotlin classes(KClass) and has utility methods around them. So I made a simple POC and Video. Let's get started!

Strings in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Strings. Strings are bread and butter or everyday work of any programing language. Strings are a basic type that can either be simple and pleasure or a nightmare i.e go look at Strings in Erlang.  Strings are pretty easy and cool in Kotlin. So I made a short video and some simple POC going over some String features in Kotlin. Let's get started!

ksqlDB

Image
ksqlDB is an Event Streaming Database. Basically, you turn Kafka Streams(topics) into Databases. Allowing you to have some level of consistency and fast lookups on real-time data. ksqlDB allows you to perform SQL queries on your Kafka topics. It's possible todo pull-based or even push-based queries. Kafka is getting closer and closer to be a Database and that's exciting. To be 100% clear Kafka is not a full-fledge database and I would cherry-pick use cases that fit into the model. There is no one-size-fits-all. So today I want to share a simple POC in a video I made for you guys where we will see push queries in action. So Let's get started!

Object Binding with remap in Java

Image
Object binding or mapping is something as old as Java. Sometimes you need to use this technique in order to isolate your core domain from your contract or with your persistence layer. It's always a good idea to have a clean and separated core.  DDD calls it an Anti-Corruption Layer . SOC(Separation of concerns) is always a good idea. As time passes Services and Services teams kind of lose that great Architectural and SOA Principles no wonder things are harder them before.  So today I want to talk a bit and show some code about a library called remap . Which provides declarative mapping. It's super easy to use and really will boost you productivity. So Let's get started!

XML Serialization in Java with XStream

Image
Xstream is an old but still a good framework for serialization. Definitely, there are faster libraries however Xstream still lightweight and relevant if you need to deal with XML. There are other formats like YAML, JSON, and so many others. For configurations, I definitely favor java properties file format which is just a key/value format. Generally, I would favor JSON for configs over YAML. So why XML in 2021? I'm not arguing XML is the way. Just saying sometimes you need to deal with old services or old systems and for that case, you might be constrained with whatever format is there. You might consider creating a wrapper service to abstract an old API and old format but eventually, complexity needs to live somewhere. So I made some POC showing some of the capabilities that Xstream has. Let's get started!

git rebase with squash

Image
Git is a very powerful tool for source code version control. Often we do POCs and no one whats to waste time while you are doing a POC so often people dont pay much attention to their commit messages(including myself). However the POC grows and you reach the point to productionize the solution, all great but what you do with your poor commit messages? Good messages are critical for good configuration management, release management, and code hygiene. So what can we do? Well git rebase can rescue us. Git rebase is also useful in other use cases where you need to have a specific format of messages because your CI/CD tool does some validations or you are hunting a bug down and you want to drop a bad commit or you are cherry-picking commits to doing a chirurgical release. So I made a short video showing rebase commands in action. We also will use squash which is an interesting way to combine your commits in one for better trackability. So Let's get started.

Management: The non-obvious II

Image
This is the second post on the series of management the non-obvious. I highly recommend you check out the first post . For the first post, I shared +20 books which was the base of the ideas of the first slidecast. This is the second slidecast. In this second slidecast, we will continue covering some non-traditional ideas and I will recommend +20 books again. Books are portals to other dimensions. We have several cognitive biases in our brains that work against us. We also live in a world that the bad things are repeat over and over and the good things are faiding. So it's really important to spot and think about it. Often we think we have all the answers and just need to execute something, is that so? They allow us to see things we were not seeing before. So I hope you guys like it. Let's get started.