Arrogant Design Patterns ( by Hafiz Waleed Hussain )

Hi, I hope everyone is doing good.

Today, we are going to discuss how to be a magician in coding :). Means we will address one of the Structural Design Pattern. In my opinion, if someone is too good with Structural Design Patterns, he/she can impress you easily by making some small changes at the abstract level. Magic will be your whole application will start working with new requirements, but without making any changes in your entire application.

In case you missed the Introductory Post of Arrogant Design Patterns.More Posts on Design Patterns

For the official or popular definition…


Arrogant Design Patterns ( by Hafiz Waleed Hussain )

Hi, I hope everyone is doing good.

Today, we are going to discuss how to be a magician in coding :). Means we will address one of the Structural Design Pattern. In my opinion, if someone is too good with Structural Design Patterns, he/she can impress you easily by making some small changes at the abstract level. Magic will be your whole application will start working with new requirements, but without making any changes in your entire application.

In case you missed the Introductory Post of Arrogant Design Patterns.More Posts on Design Patterns

For the official or popular definition…


Arrogant Design Patterns ( by Hafiz Waleed Hussain )

Hi, I hope everyone is doing good.

Today, we are going to discuss Builder Design Pattern, a pretty simple but amazing Design Pattern.

In case you missed the Introductory Post of Arrogant Design Patterns.More Posts on Design Patterns

Revision:

We need to do some concepts revise, which are essential from the perspective of Builder Design Patterns.

Note: I am going to use Java for this post. In the case of Kotlin, in most cases, there is no need to use the Builder Pattern because we can give default parameter values.

I am sure everyone who is reading this blog is…


Arrogant Design Patterns ( by Hafiz Waleed Hussain )

Hi, I hope everyone is doing good.

Today, we are going to start our series of Arrogant Design Patterns. In our list first, we have a Factory Pattern which belongs to a Creational Design Pattern group. But for now, we don’t care. We will be focus on the use case, where we should use Factory Pattern, and later you guys will automatically find out the group of this Design Pattern.

In case you missed the Introductory Post of Arrogant Design Patterns.More Posts on Design Patterns

Revision:

We need to do some concepts revise, which are essential from the perspective of…


Arrogant Design Patterns ( by Hafiz Waleed Hussain )

Hi everyone, I hope everyone is doing good and fighting against the COVID-19.

Today, we are going to start an old topic on which we already have tons of material, but still, I feel a lot of developers are facing a problem, and I am also one of them. This post will be theoretical, so if you are expecting something practical about Design Patterns, then this post is not for you. Most probably, the next part will be for you. So it’s time to start :).

Motivation:

I am not going to say, everyone faces the issues with this topic, but…


Created by Hafiz Waleed Hussain

Introduction to Arrogant Design Patterns

Creational Patterns

  • Factory
    When we can see Inheritance/Polymorphism in our code. (50%)
    Inherit class creation depends on some logic or enums. (50%)
  • Abstract Factory
  • Builder
    Mandatory VS Optional
    Any requirement in which we will select individual items and later we will check out those items in the form of an Order.
    A requirement in which we will select individual items and later we will build or manufacture some object. Like Car Manufacturing, or Cooking.
  • Object Pool
  • Prototype
  • Singleton

Structural Patterns

  • Adapter
    Anywhere we can see the two different or incompatible API’s we can create an Adapter class to resolve the problem.
  • Bridge
  • Composite
  • Decorator


This post is the part of the New Era of Rx Android StopWatch App. In this part, we are going to implement version 2 of Android StopWatch. We already got the requirement which I am going to repeat again.

Code will be available on GitHub.


Designed By Hafiz Waleed Hussain

This post is the part of the New Era of Rx Android StopWatch App. In this part, we are going to implement version 1 of Android StopWatch. We already got the requirement which I am going to repeat again.

Code will be available on GitHub.


Hello Readers, Today, I am going to start a new page on about Rx. Here we will do two things.

1. Learning Rx
2. Implementation of Rx in real scenarios

Here, our expectation from the readers, they already know about the basics of Rx.
If you are a beginner, I will recommend reading my other series on Rx first.

  1. Observer Pattern Part1
  2. Pull vs Push & Imperative vs Reactive Part2
  3. Functional Interfaces, Default Methods, { Higher Order — Pure — Side Effects in } + Functions, Im + { Mutable } , Lambda Expression & Functional Programming Part3
  4. War against…

Designed By Hafiz Waleed Hussain

Those who are new to this series of posts. We started Our Collection API framework like the Kotlin once. You can consult with our first post Our Collection API (Kotlin Framework Class Hierarchy, Function Type, Predicate)

In this post, we are going to create two methods from Kotlin Collection API all and any. We will say ourAll() and ourAny() methods.

all():

What is “all” method? According to Kotlin documentation
Returns `true` if all elements match the given [predicate].

For example, I have the data of posts. I want to check is all userId’s greater than 0.

fun main() { val posts…

Hafiz Waleed Hussain

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store