Urgent.News

What's breaking now, across thousands of outlets.

Tech

Decorator Design Pattern: Adding Functionality without Breaking Your Architecture

Se você já trabalhou com orientação a objetos por algum tempo, provavelmente já se deparou com este dilema: como adicionar novas funcionalidades a um objeto sem criar uma explosão de subclasses? Imagine um sistema de componentes gráficos onde você precisa combinar bordas, sombras, cores e efeitos de diferentes formas. Criar uma subclasse para cada combinação possível rapidamente se torna…

Translated from Portuguese Read in Portuguese

The article explains the Decorator design pattern, a structural pattern that allows adding behavior to individual objects dynamically and transparently, without affecting other objects of the same class. The Decorator pattern is useful when adding responsibilities to objects dynamically without modifying their source code, and when avoiding the creation of excessive subclasses to represent each combination of behaviors.

The pattern consists of four main elements: Component, Concrete Component, Decorator, and Concrete Decorator, which work together to enable flexible and modular system design. An example in Java illustrates how the pattern can be applied in practice, demonstrating its benefits, including flexibility, modularity, and adherence to the Open/Closed Principle.

The Decorator pattern is widely used in known libraries and frameworks, such as Java's java.io package.

Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

XML Configuration Mode: Decoupling Your API Catalog from Business Code

Annotation mode keeps requests close to Java, but large integrations raise a fair question: do I want a wall of curl strings inside my service interfaces?

  • XML Configuration Mode separates API catalog from business code
  • Uses declarative client split with contract in configuration files
  • Changing XML entries alters app behavior without Java edits

Missing RLS: The Most Underrated Breach Cause of 2026

You know why there are so many breaches in databases? Perfect, me neither. Let's find out in a few minutes. Everyone worries about encryption.

  • Row Level Security (RLS) misconfiguration leads to data breaches.
  • CVE-2025-48757 exposed 303 endpoints in 170 apps due to RLS issues.
  • Supabase improved RLS default in 2026, but migration errors persist.

Milestone Reached: YINI Syntax Highlighting Is Now on the VS Code Marketplace

Milestone Reached: YINI Syntax Highlighting Is Now on the VS Code Marketplace A small but important YINI milestone has been reached: the official YINI Syntax Highlighting extension for Visual Studio…

  • YINI Syntax Highlighting extension reaches version 1.0.0
  • Supports YINI Specification 1.0.0 RC 6
  • Enhances VS Code environment with syntax highlighting

More from Saturday 12 September →