Data Transformation Using the Decorator Pattern

Data Transformation Using the Decorator Pattern

The decorator pattern is one of the most versatile design patterns available to us in software engineering. It allows for behaviour to be added to an object dynamically while still obeying the Single Responsibility Principle. It is similar to the Chain of Responsibility pattern, which I wrote about here, but a key difference is that instead of a single class (or link in the chain) handling a particular request or action, all classes handle the request or action.

The decorator pattern is one of the most versatile design patterns available to us in software engineering. It allows for behaviour to be added to an object dynamically while still obeying the Single Responsibility Principle. It is similar to the Chain of Responsibility pattern, which I wrote about here, but a key difference is that instead of a single class (or link in the chain) handling a particular request or action, all classes handle the request or action. This article shows how useful this can be when transforming data, typically as part of an Extract, Transform, and Load pipeline. In the example, we’ll see how the decorator pattern can be applied to extend the functionality of an object all while maintaining compliance with the Single Responsibility Principle. Ok — let’s crack on. In this example imagine a system that stores and processes commodity data — data about oil, gold, silver, etc. Specifically, we’ll be looking at a Data Transfer Object, a DTO, that holds data retrieved from the database.

software-development software-engineering c-sharp-programming

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Software Developer vs Software Engineer — Differences: Bogus or Real?

In this article, see if there are any differences between software developers and software engineers. What you’re about to read mostly revolves around my personal thoughts, deductions, and offbeat imagination. If you have different sentiments, add them in the comment section, and let’s dispute! So, today’s topic…

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

5 Best C# (C-Sharp) Programming Courses for Beginners in 2020

In this article, I am going to share some of the best courses to learn C# or C-Sharp in 2020. These courses are suitable for both beginners and experienced programmers who want to fill gaps in their C# knowledge.

Developer or Engineer? Does It Make a Difference?

To summarise the main differences between the software developer and engineer: A developer executes. ... So the software developer is mainly focused on developing code that is a part of software development cycle. An engineer designs and plans applying the principles of engineering to software development.

C programming for Beginners | Learn C Programming | C Language

C Language is an evergreen language and is used widely across different industries, This C programming is a must for students and working professionals to become a great Software Engineer especially when they are working in Software Development Domain. Great Learning brings you this live session on "Introduction to C". In this live session, we will be covering major concepts in C Programming such as Different Variables, Different Data Types that are being used, its Operators, Flow control statements, Structure, and lot more.