Structure Equality in Golang

What is a struct in Go? A struct or structure in Go is a user-defined type. It helps with composing different types into a single unit. https://gist.github.com/anjanashankar9/d427d0cfe225c01c7631afd71153bdf7 When can you compare two structures? In order to compare two structures, it is imperative that all struct field types are comparable. If the variables being compared belong to different structures, then you will see a … Continue reading Structure Equality in Golang

Command Design Pattern – Implementation in Java

I have discussed Singleton Pattern, Observer Pattern, Factory Pattern and Decorator Pattern in my previous posts. In this one I will be talking about Command Design Pattern. What is a Command Pattern? Command Design Pattern is a pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later … Continue reading Command Design Pattern – Implementation in Java

Git submodules

Git submodules are a powerful way to use git as an external dependency management tool. It is basically a way to embed a repository into another. When you add a submodule in Git, the code of the submodule does not get added to the main repository, only certain information about the submodule does. It simply … Continue reading Git submodules

Decorator Design Pattern – Implementation in Java

I have discussed Singleton Pattern, Observer Pattern and Factory Pattern in my previous posts. In this one I will be talking about Decorator Design Pattern. What is a Decorator Pattern? The dictionary definition of the verb decorate is make (something) look more attractive by adding extra items to it. Keeping in line with this definition, … Continue reading Decorator Design Pattern – Implementation in Java

Factory Design Pattern – Implementation in Java

After discussing Singleton Pattern and Observer Pattern in my previous posts, I will be talking about Factory Design Pattern in this one. What is a Factory Pattern? Factory Pattern is also among the most commonly used design patterns. Instantiating an object with the new() operator couples the code tightly to the concrete implementation leading to … Continue reading Factory Design Pattern – Implementation in Java

Observer Pattern – Implementation in Java

What is an Observer Pattern? Observer Pattern is one of the most commonly used design patterns. It is useful when you are interested in getting notified of the state changes of an object. It defines a one-to-many relationship between the subject and the observers. Terminologies Observer or Listener or Subscriber The objects which are interested … Continue reading Observer Pattern – Implementation in Java