Skip to content

Latest commit

 

History

History
523 lines (387 loc) · 53.1 KB

design-patterns.md

File metadata and controls

523 lines (387 loc) · 53.1 KB

drawing

Recently, I have been helping a client implement an event-sourced system. In the process, I put together a very simple demo app which is available on GitHub here.

During design meetings at my workplace and even during other conversations with friends, the term "shim" appeared to being placed offhand, with the context not being setup properly to indicate what it is exactly that the "shim" represented.

Designing software systems is about tradeoffs and making tradeoff decisions is hard. You always feel like you are loosing one thing or the other but that’s not what we are going to talk about today.

What is GRASP? Why do we need it? Information expert and creator principles using Javascript examples.

I really like C#'s extension method feature. I was trying to experiment it on Typescript with decorators.

Here's a problem. You have an object in your code exposed via an export. You also have a function in the same file (also exported) consuming that object directly.

Here's a list of some of the book's design patterns, their definition, and what made me remember them. Each one of those principles solves a particular problem.

The best way to implement the observer pattern - using transaction logs of databases.

Hashmap is a collection of key-value pairs and an array of nodes. It uses an array and LinkedList for storing key-value pairs.

This article provides guidance on how to design simple and intuitive RESTful APIs.

A 30 line piece of script can finally provide a good solution for a repository pattern in Laravel apps.

Experienced software engineers learn what works after maintaining their work for years.

Decouple your Go components by leveraging Mediator and Event Aggregator patterns. Learn how to use open-source mediator / event aggregator library called mob.

Why we should be careful not to abuse barrel exports in our TypeScript code.

If-else keyword built into nearly every programming language and simple conditional logic are easy for anyone to understand. If you are a programmer, you know else keyword. But if you are a good programmer, don’t use this keyword. One of the biggest mistakes I fell into when starting was overusing the else keyword when writing conditionals. I stopped using this keyword in my programs since 5 years ago. Let me explain!

According to Gang of Four, the iterator pattern provides a process to obtain the aggregator object without knowing its implementation.

web design is moving into the future, with advanced techniques like retro revolution, fewer images, and Memphis design.

In brief, the pattern injects some logical functionality before and/or after function execution.

Imagine you have several blocks of similar layout which are hard-coded on the frontend side. These blocks are not dynamic, they are not being fetched from back-end, it’s just a layout. Most beginners, when they see similar blocks of layout, start to think about arrays as a tool to handle similar stuff.

We talk about two design patterns that highlight best practices for building resilient microservices architectures at scale.

Like tidying up a house before a total renovation, preparing your monolith is the first step towards transitioning to microservices.

Inheritance is one of the most used method for code reuse. Object Oriented Languages strive on the inheritance to collect the common functionality in a base class.

Object oriented programming (or OOP) is a style of programming that encapsulates data and behaviours into models known as objects. In this way, related code is grouped together and kept separate from other code, and provides reusable blocks that can be used to rationalise the problem at hand.

Streamlining Your Code: An Introduction to the Builder Pattern in Go

The filter and pipeline patterns can be optimized with code reduction using lambda expression(shortcuts for anonymous method) as concrete filter condition. To demonstrate concept, the sample WPF UI application was created. Here is Source code

Primitive obsession is a code smell in which primitive data types are used excessively to represent your data models.

Keep your Model Observers in Laravel under control.

Inheritance vs Composition in JavaScript. What is better, when use inheritance, when use composition. We will look at different examples on JS.

The Forward Trust design pattern used in the Yield Protocol simplifies integration and makes scaling easier.

The article describes how pattern matching effectively utilises and processes data in forms not part of the primary system.

The development life cycles of applications in an enterprise environment often follow a common theme. An application begins life with a clear purpose in mind and over time has requirements brought in that cause incremental additions to the scope of the original concept. These additions could either be completely in sync with the original concept or perhaps the requirement just had no better home to belong in. As the application matures to an end-of-life state it has now grown far past its original intended purpose and is in dire need of a refactor — breaking down the monolithic beast into smaller and more succinct components.

Here are the use cases for iterators and generators that are closer to the real-world scenario than a simple "Hello World" type code.

I went to an OOP workshop by Sandi Metz several years ago. She made a comment that at one of her previous jobs, they didn't use if statements.

The other day I was reading up on the legendary React God Dan Ambrov’s great but very un-TLDR post on useEffect.

In this article, we'll take a deeper dive into the seven graphic design trends that are set to dominate in 2023.

The Alias pattern minds two issues. Extending how a final class builds its objects.

Software design patterns have been used to package solutions to many common design conundrums. Each one has its own advantages and drawbacks to consider.

In this article, we will discuss what is SOLID principles, why we should intend them. Also, we will take a look at examples of "S" principle using Javascript.

According to Gang of Four, a creational pattern “Builder” allows to separate and reuse a specific method to build something.

Designers should stop using the ‘Hierarchy of Design’ concept as the representation of design characteristics as a pyramid is inaccurate and misleading

The article describes how pattern matching effectively utilises and processes data in forms not part of the primary system.

As a product person, have you ever witnessed large, complex releases result in outages or rollbacks?

Have you wanted to make configuration changes in productio

Five pillars of web design

You can keep your Rails app cleaner and easier to maintain using Service Objects. Service objects help to decouple business logic from your controllers

Nonetheless, it's a great book that I recommend to any developer entering the world of APIs or even one with more experience to round up their knowledge.

You know that feeling when you work really hard on something for really long and it feels like nobody really notices?

The Unit of Work design pattern is a software design pattern that is widely used in software development. It is a way to group database-related operations

A decorator pattern is a powerful tool that can be used to modify and extend functionality in PHP and MySQL-based content management systems.

A walk-through of dependency injection.

A story about how important it is to keep a smooth balance between complexity and simplicity while building software.

The repository architectural pattern is frequently employed in software development to segregate an application's business logic from the data access layer. It

I recently wrote a blog post introducing some of my favourite NuGet packages: My Top 4 NuGet Packages for ASP.NET Core. In that post, I briefly introduced a package called MediatR. Today, I will dedicate this post to revisiting MediatR in further detail.

A while ago, we covered the invocation (trigger) methods supported by Lambda and the integrations available with the AWS catalog.

This comprehensive list includes a wide range of options, from elegant serifs to modern sans-serifs, so you’re sure to find something that fits your project.

When we start building software, we can see many code's incompatibilities. This is because of many codes have been written based on different contracts.

Liskov’s Substitution Principle | SOLID as a Rock

Companies have paid lip service to our digital wellbeing for too long. Now we need to see real change.

“Pagination, also known as paging, is the process of dividing a document into discrete pages, either electronic pages or printed pages.”

According to Gang of Four, it defines a chain of responsibilities to process a request. In other words, pass the request from one object to another until an obj

Open closed principle is the most simple one in the list of software design principles I understand. "Open for extension, close for modification" - the idea seems quite straightforward. Let's create an example about validation.

Visitor pattern is dead. Long live to Visitor pattern. (With Kotlin examples)

With the introduction of OOPs, Inheritance and Composition entered our senses and still confusing us.

[66. Animation/Motion Design Tokens

for Complex Design Systems](https://hackernoon.com/using-animationmotion-design-tokens-for-more-complex-and-sophisticated-design-zy3t33y5) Each Animation needs a Trigger, Duration, Easing, and Property element. Design systems also play a part in creating Motion Design and Animation.

The result of the next pen shows the case where I'll use the Publish/Subscribe pattern. Every time you click on the Event button a square is added and a message with the number of squares is displayed.

JavaScript has come a long way since its humble beginnings as a clunky, exclusively front-end scripting language. We saw some big developments in the JavaScript landscape during 2019, including the widespread adoption of React hooks and functional programming concepts, steady conversion to TypeScript, and continued domination of React in the front-end framework ecosystem.

The output is what measures the success of a business. Therefore, all the business houses are adopting all the inevitable methods and programs to intensify their productivity/ output by adopting new technologies and concepts. There are several technologies available and many in the developing phase, which effectively fulfil customers’ needs and generates high output.

Front-end development takes much more than writing clean code. While writing concise and legible code is not mandatory, it will save many headaches in the future. The chances of writing code that will never be changed or never looked at again are slim to none, and time spent getting lost in old code is time wasted. Here are some key web development best practices for HTML, CSS, and JavaScript.

Let’s look at the JavaScript with statement. We will go over the simple uses, as well as a deep dive into some more advanced concepts.

S.O.L.I.D design principle comes from Object oriented programming guidelines. It is designed to develop software that can be easily maintained and extended; prevents code smells; easy to refractor; promotes agility and finally incorporates rapid + frequent changes quickly without bugs.

Design patterns are an essential part of software development, providing a common language and best practices for recurring problems.

Noonies interview with Sukhpinder Singh, Senior Engineer at SourceFuse.

Learn how the API-first design pattern is a carbon copy of the successful writing approach that John Vester has leveraged for several years.

In this article, we'll cover the benefits of utilizing the repository pattern in building backend systems with FastAPI.

Use the facade design pattern to simplify the interaction between subsystems. It provides a single entry point to a subsystem,

Hello, guys, this is the last part of SOLID Principles in JavaScript and if you haven't read the previous three (first part, second part, third part, fourth part), I highly recommend to read them first and come back here.

Design patterns are reusable solutions for common problems that occur during software development. Here are my 9 favorite design patterns for JavaScript

The last part of GRASP is where we will learn polymorphism, pure fabrication, indirection, and protected variations and how to use them in our projects.

Event-driven architecture is a software architecture paradigm promoting the production, detection, consumption of, and reaction to events.

Software architecture, design and process of architecting explained using a case study.

How many more reports can you generate? How many sales figures do you have to tally, how many charts, how many databases, how many sql queries, how many 'design' pattern to follow, how many bugs to fix etc. etc.. because you get paid for it.. Fatigue sets in , purpose of living is being questioned, and just when you are about to yell '.. to hell with all this..', your mortgage comes due, and don't look for that escape vacation because we are in a corona virus shutdown..

TL;DR;

In this post, we will do some exercises to go over the basics of DI (Dependency Injection) in ASP.NET.

This article is the first part of a five-part series about SOLID as Rock design principle series. The SOLID design principles focus on developing software that is easy to maintainable, reusable & extendable. In this article, we will see an example of the Single Responsibility Principle in C++ along with its benefits & generic guideline.

The basic idea behind TypeState pattern is to encode the state information inside types. 

In "Concurrent Programming in Python is not what you think it is", I wrote about the notorious GIL in Python and did a simple experiment on existing concurrency mechanism in Python. Today, I'll describe another common scenario in concurrent programming, the Producer/Consumer problem, with Python.

In this blog, you will learn about the Graphic design trends as we move forward in the year 2021.

Virtual sampling has become an applicable alternative for brands to utilize in their production process. A brand like Hugo Boss are adopting this.

Interface Segregation Principle in C++ is the fourth & by far the simplest design principle of a series SOLID as a Rock design principles. The SOLID design principles focus on developing software that is easy to maintainable, reusable & extendable. In this article, we will see a code violating ISP, a solution to the same code, guideline & benefits of ISP.

Command Design Pattern is one of the behavioural design patterns used to encapsulate a request as an object, thus enabling to parameterize clients with differen

Adopt SOLID design principles in GO for better code quality and easier software maintenance.

There are quite a few rules/principles that get thrown around in the software world. Some that come to mind are SOLID principles, Design Patterns, Do one thing and do it well, etc. I totally stand by all of them and believe our world would be a much better place if these principles are followed more.

Built with Next, Apollo and MongoDB and deployed with GitHub Actions and Docker.

In software engineering, Creational Design Patterns deal with object creation mechanisms, i.e. try to create objects in a manner suitable to the situation. In addition to this basic or ordinary form of object creation could result in design problems or added complexity to the design.

Hello, guys, this is the third part of SOLID Principles in JavaScript and if you haven't read the previous two (first part and second part), I highly recommend to read them first and coming back here.

A step-by-step guide to developing a Fluent API from scratch in .NET C# using the Builder Design Pattern.

This is a story of how I moved from hate to love for NodeJS language while being a Java developer, filled with insights I encountered during this process.

Unlike my sleeping pattern, design patterns are meant to make things more stable and predictable in the future. It is an elegant solution to common problems in software design.

Memento design pattern is a software design pattern that is used to roll back an object to its previous state. It is a part of the behavioural design pattern which is concerned with algorithms and assignment of responsibilities between objects.

The SOLID principles have been created as pillars of creating flexible, understandable and maintainable code. They can add days onto your dev time to implement them properly, and most people don't care or worry much about code quality, so I created some better ones.

Do you think your actions are the result of your own free choices? What if those actions are the inevitable and necessary consequence of antecedent states of affairs? What does this mean for your free will?

He is not our friend. It does not simplify life or make us more efficient. Just more lazy. It is time to stop using null.

Allowed global variables and supposed memory savings

Dependency Inversion Principle in C++ is the fifth & last design principle of a series SOLID as a Rock design principles. The SOLID design principles focus on developing software that is easy to maintainable, reusable & extendable. In this article, we will see an example code with the flaw & correct it with help of DIP. We will also see guideline & benefits of DIP inclosure of the article.

Hello, guys. This is the second article about SOLID principles with Javascript examples. In my previous article I described what are patterns in general, what is SOLID and why we should use them. If you haven't read it, pls, read it now and continue read current article after the previous one.

We all agree: a good name is always the most important thing. Let’s find them.

What are the problems regarding transparency and feedback in FinTech applications? Which UX design patterns can be used to address them? Find out!

Generic implementation of the Composite Design Pattern in Python.

In any application, different sets of services/third-party APIs communicate either asynchronously (out of score from current context) or synchronously or sometimes both (rare cases).

Solidity design patterns are essential for creating secure, robust and scalable smart contracts. In this tutorial, we will learn proper implementations

This is the second part of a five-part series about SOLID as Rock design principle. The SOLID design principles, when combined together, make it easy for a programmer to craft software that is easy to maintain, reuse & extend. Open-Closed Principle(OCP) is the second principle in this series which I will discuss here with minimalistic example in Modern C++ along with its benefits & generic guideline.

Frustrated with unorganized business logic in your Ruby-on-Rails app? Forget what you know about object-oriented design and start using services.

Staring at the maze of interconnected passageways of the microservice system, I immediately recognized the problems.

"RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences." by RxJava developers.

We all have names for everything – our cats, dogs and maybe even that cow we are about to kill. But how come we do not name our CSS codes? The sad thing is that so many programmers and developers tend not to name the CSS codebase they are using.

Prototype Design Pattern is a Creational Design Pattern that helps in the prototyping(creating/copying cheaply) of an object using separate methods or polymorphic classes. You can consider the prototype as a template of an object before the actual object is constructed. In this article of the Creational Design Patterns, we’re going to take a look at why we need a Prototype Design Pattern in C++ i.e. motivation, prototype factory & leveraging prototype design pattern to implement virtual copy constructor.

Kubernetes is an open-source container-orchestration system for automating application deployment, scaling, and management.

So I have started updating myself with Modern C++ a while ago & since my post 21 new features of Modern C++ to use in your project & All about lambda function in C++ was popular I decided to write about advanced C++ concepts & idioms which I have learned from this wikibook & course.

In software engineering, Creational Design Patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic or ordinary form of object creation could result in design problems or added complexity to the design. Builder Design Pattern in C++ solves this specific problem by separating the construction of a complex object from its representation.

After hitting a certain level of experience & spending quite enough time in the industry, I have realised the importance of designing/architecting system & software. So I have started looking into system/software design & got to know nothing can better start than a Design Pattern. And the first thing I have done is googling "What is Design Pattern?" Hence got the idea of this article.

In software engineering, Creational Design Patterns deal with object creation mechanisms, i.e. try to create objects in a manner suitable to the situation. The basic or ordinary form of object creation could result in design problems or added complexity to the design. In this article of the Creational Design Patterns, we’re going to take a look at the much-hated & commonly asked design pattern in a programming interview. That is Singleton Design Pattern in Modern C++ which criticizes for its extensibility & testability. I will also cover the Multiton Design Pattern which quite contrary to Singleton.

In this article, we’re going to learn a little more about the MVC, the system Architecture at the core of the Rails Framework for Software Development. Hopefully, by the end of it, you’ll know why working with a system architecture can make all the difference when developing an app.

Are we done on code smells? Guess not.

An exercise improving legacy code

I know, it’s been a while since the last time I published something newbies-friendly on my blog. The main reason is that most of my readers are either experienced devs or from C background having modest C++ encounter. But while programming in C++ you need a completely different mindset as both C & C++ belongs to different programming paradigm. And I always strive to show them a better way of doing things in C++. Anyway, I found the topic which is lengthy, reasonably complex(at least it was for me), newbies-friendly as well as energizing for experienced folks(if Modern C++ jargons, rules & features added) i.e. C++ Template.