Go Patterns?
I came across a repository on github that consolidated simple examples exhibiting design patterns in Go. In the beginning I thought that was a great resource, but after a while I got a bit confused. You will find a list of patterns like creational, structural, behavioural, synchronization, concurrency, messaging, stability, profiling, idioms and anti-patterns. You find patterns like Abstract Factory, Singleton, Bridge, Decorator, Mutex, Semaphore, Coroutines, and many more. My favourites are synchronization and concurrency.
One Use Case for TPL
TPL is a set of libraries from Microsoft that can be used for parallel processing, basically it is a set of high level tools that can make your code run in parallel. TPL is not a panacea for parallel processing, mainly because you don’t always need parallel processing, but when you need it, it can be a life-saver.
The system
The system was built with a simple purpose, to consume and process events delivered by Kafka. The events were published, in Avro format, by a separate system, let’s call it producer. Essentially the events represent a course of actions, which are used to produce our model. Eventually that model is publicly exposed through an API (not HTTP). Everything was built using C# on dotnet core and ran on a docker container on linux hosts.
Multi-stage building with Docker
Docker supports a feature, where you can create multiple containers with a single dockerfile and at the same time share the contents between the containers. This feature gives you the possibility of having multi-stage builds and opens one significant spot for creating repeatable builds.
The idea behind it is simple, you can have multiple FROM
statements inside the
same Dockerfile
. Each FROM
statement can use different images, therefore
defines it’s own dependencies and allows you to connect the containers from one
base to the other by using COPY --from=0or COPY --from=previous-stage
.
Inconsistency as a Feature
The image below depicts the logos of the 2 most deadly package managers massively used by almost every JS developer.
Interacting with them is straightforward and easy through a few CLI commands. What they do is pretty simple, download packages for you according to specific version. The left logo belongs to bower and the right one to npm of course.
Experiences Bower & npm
I’ve been using bower for quite some time now (more than 1 year), since I work with front-end and my experience with it is not entirely pleasant. In fact I think I hate it. On the other side we have npm the package manager mainly used by node.js developers (backend/front-end). I have used extensively both and I dislike both of them, but I think that NPM is worse than bower.
SECURITY in your everyday e-shop...
I don’t know if what I discovered is good or bad. I really like this site and the prices of its products, but it has a big security flaw, which makes me not use it anymore. In the following paragraphs I will describe what I’ve discovered, but I will not point to the actual e-shop, since this post is purely academic (so to speak). Heads up, nothing illegal…
OWASP and Security
OWASP is a community which identifies, documents and provide tools to avoid Web Application exploits. It’s formed by a group of security specialists who know how to secure a web application. All the documents and tools they create is free.
ASP.NET & Docker Experience
Introduction
Docker is system for creating and managing lightweight linux containers, which has become very popular in the enterprise computing business.
ASP .NET is a framework/platform from Microsoft, mainly used in building web applications. At the moment is on version 4.6.1 (stable) and version 5 is waiting around the corner. Version 5 is a completely re-done, its structure and mentality mimics the frameworks like Django, Flask or Express, which are small and provide you with basic functionality for web development. The rest is provided upon request by adding packages.