Hello, In this article we're going to explore the Method Injection and Property Injection design patterns. To demonstrate the patterns I'm going to add a new interface named Encoder to the printer.py file and a concrete implementation for two encoders: Rot13Encoder and NullEncoder. class Encoder(metaclass=abc.ABCMeta): def encode(self, message: Message) -> Message: raise NotImplementedError("encode must be … Continue reading Method Injection and Property Injection Design Patterns
Nucu Car Devlog: 0x03 – Android
Hello everyone! I've been working lately on my little project involving Raspberry Pi and .NET, during my free time. Now, I've introduced a new technology, Android! The project needed a front-end and It took me a long time to decide how to implement it and what technology to use. I was conflicting between a cross … Continue reading Nucu Car Devlog: 0x03 – Android
LeetCode: Reverse Linked List Solution and Explanation
Hi, In this article I will explain my solution for the following LeetCode problem: Reverse Linked List. If you're interested in solving this problem then please try to spend at least one hour or more on it before looking at my solution. To help you solve this problem I've created the following table: CurrentPrev1NULL2132NULL3 Think … Continue reading LeetCode: Reverse Linked List Solution and Explanation
Constructor Injection and Null Object Design Patterns
The Constructor Injection design pattern is a pattern that helps you declare all the required dependencies of a class in it's constructor. This is useful because it helps you decouple the code, you can specify an interface instead of a concrete type, remember, program to an interface. Also, in the constructor it is easier to … Continue reading Constructor Injection and Null Object Design Patterns