<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jean Klebert de A Modesto</title>
    <description>The latest articles on DEV Community by Jean Klebert de A Modesto (@jeandevbr).</description>
    <link>https://dev.to/jeandevbr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1701219%2F09323b53-5369-4259-b794-29db9dd2e037.jpg</url>
      <title>DEV Community: Jean Klebert de A Modesto</title>
      <link>https://dev.to/jeandevbr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeandevbr"/>
    <language>en</language>
    <item>
      <title>Symfony AI: A Rocket, a School Bus, or Something In Between?</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Fri, 13 Feb 2026 11:59:31 +0000</pubDate>
      <link>https://dev.to/jeandevbr/symfony-ai-a-rocket-a-school-bus-or-something-in-between-31nn</link>
      <guid>https://dev.to/jeandevbr/symfony-ai-a-rocket-a-school-bus-or-something-in-between-31nn</guid>
      <description>&lt;p&gt;When a recent &lt;strong&gt;article compared Symfony AI to “a school bus painted like a rocket pretending to reach orbit,”&lt;/strong&gt; it struck a nerve in the PHP community: &lt;br&gt;
&lt;a href="https://dev.to/pascal_cescato_692b7a8a20/symfony-ai-when-a-school-bus-painted-as-a-rocket-pretends-to-go-to-orbit-1mk6"&gt;https://dev.to/pascal_cescato_692b7a8a20/symfony-ai-when-a-school-bus-painted-as-a-rocket-pretends-to-go-to-orbit-1mk6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The metaphor was clever. The critique was sharp. And the underlying question was serious:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is Symfony AI real engineering progress — or just AI hype wrapped in Symfony branding?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s unpack the criticism point by point and examine what Symfony AI actually is — and what it isn’t.&lt;/p&gt;




&lt;h2&gt;
  
  
  The “It’s Just a Wrapper” Argument
&lt;/h2&gt;

&lt;p&gt;One of the central criticisms is that Symfony AI is essentially a polished HTTP wrapper around large language model APIs.&lt;/p&gt;

&lt;p&gt;Underneath the abstraction layer, it still calls external providers like OpenAI, Anthropic, or Gemini. There’s no proprietary inference engine. No novel AI breakthrough. No deep runtime innovation.&lt;/p&gt;

&lt;p&gt;But here’s the thing:&lt;br&gt;&lt;br&gt;
That’s true of almost every modern AI integration stack.&lt;/p&gt;

&lt;p&gt;Laravel apps call OpenAI APIs.&lt;br&gt;&lt;br&gt;
FastAPI services call OpenAI APIs.&lt;br&gt;&lt;br&gt;
Node apps call OpenAI APIs.&lt;/p&gt;

&lt;p&gt;None of them are building transformer models from scratch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The value of Symfony AI isn’t in inventing AI. It’s in:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Standardizing provider integration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Abstracting vendor switching&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fitting seamlessly into Symfony’s architecture&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reducing boilerplate and duplicated infrastructure code&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s an orchestration layer, not a research lab.&lt;/p&gt;

&lt;p&gt;And that distinction matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  PHP’s Synchronous Model: A Real Limitation
&lt;/h2&gt;

&lt;p&gt;Now let’s address the stronger criticism: PHP’s execution model.&lt;/p&gt;

&lt;p&gt;Traditional PHP (PHP-FPM) follows a synchronous request-response lifecycle. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Each request occupies a worker process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Long LLM calls can block that worker.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High concurrency may cause worker starvation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For token streaming or heavy AI workloads, that’s not ideal.&lt;/p&gt;

&lt;p&gt;And Symfony AI does not magically turn PHP into an asynchronous runtime.&lt;/p&gt;

&lt;p&gt;If you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Massive concurrency&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Continuous streaming pipelines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High-throughput RAG systems&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’ll likely need architectural support such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;RoadRunner or Swoole&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Background workers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dedicated AI microservices in Python, Go, or Node&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But here’s the nuance:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Not every AI use case is high-frequency, low-latency inference at scale.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For many business applications — content generation, summaries, internal tools, admin automation — synchronous execution is perfectly acceptable.&lt;/p&gt;

&lt;p&gt;The limitation is real.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;But the context determines whether it’s critical.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Doctrine + Vectors: Ferrari or Lawnmower?
&lt;/h2&gt;

&lt;p&gt;The critique becomes more technical when discussing vector storage and Retrieval-Augmented Generation (RAG).&lt;/p&gt;

&lt;p&gt;Using Doctrine ORM with relational databases for embeddings and similarity search is far from optimal at scale.&lt;/p&gt;

&lt;p&gt;Dedicated vector databases like Qdrant, Milvus, or Pinecone are designed for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Efficient similarity search&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High-dimensional indexing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Low-latency retrieval&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Horizontal scalability&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Relational databases weren’t built for that.&lt;/p&gt;

&lt;p&gt;So yes — if you’re building a production-grade AI search engine handling millions of vectors, Doctrine is not your ideal tool.&lt;/p&gt;

&lt;p&gt;But if you’re:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Running moderate workloads&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storing small embedding datasets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prototyping RAG features&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Building internal knowledge assistants&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Doctrine may be “good enough.”&lt;/p&gt;

&lt;p&gt;And Symfony AI doesn’t prevent you from swapping in a proper vector backend later.&lt;/p&gt;

&lt;p&gt;The real mistake would be assuming any ORM-based solution replaces specialized infrastructure at scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  Cost, Efficiency, and the Stack Question
&lt;/h2&gt;

&lt;p&gt;Another argument is economic:&lt;br&gt;&lt;br&gt;
Why not just use Python and FastAPI, where AI tooling is more mature?&lt;/p&gt;

&lt;p&gt;That’s a fair question.&lt;/p&gt;

&lt;p&gt;But software architecture is rarely about theoretical efficiency alone. It’s about trade-offs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Do you introduce a new language into your company?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you increase operational complexity?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you split your team across ecosystems?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you maintain two deployment pipelines?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For companies already invested in Symfony, the cost of introducing a Python AI microservice may outweigh performance gains — especially for moderate workloads.&lt;/p&gt;

&lt;p&gt;Symfony AI lowers friction inside an existing ecosystem.&lt;/p&gt;

&lt;p&gt;And sometimes friction is more expensive than compute cycles.&lt;/p&gt;




&lt;h2&gt;
  
  
  Is Symfony AI “Marketing-Driven”?
&lt;/h2&gt;

&lt;p&gt;The rocket metaphor implies that Symfony AI is more branding than engineering.&lt;/p&gt;

&lt;p&gt;But that interpretation depends on expectations.&lt;/p&gt;

&lt;p&gt;If you expect Symfony AI to rival Python’s AI ecosystem, you’ll be disappointed.&lt;/p&gt;

&lt;p&gt;If you see it as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A structured integration layer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A provider abstraction framework&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A productivity booster for Symfony teams&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then it’s doing exactly what it promises.&lt;/p&gt;

&lt;p&gt;It’s not trying to reach orbit.&lt;/p&gt;

&lt;p&gt;It’s trying to make AI usable inside Symfony apps.&lt;/p&gt;

&lt;p&gt;That’s a different mission.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Question: What Problem Are You Solving?
&lt;/h2&gt;

&lt;p&gt;Here’s the deeper issue the debate surfaces:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are you building an AI product — or adding AI features to a product?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If AI is the core engine of your company, you’ll likely need specialized infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If AI is an enhancement — summaries, recommendations, internal copilots — Symfony AI may be perfectly aligned with your needs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Framework components should be evaluated within their intended scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symfony AI is not a high-performance inference framework.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s a Symfony-native AI integration layer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And judged on that basis, it makes sense.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Verdict: Rocket? No. Useful Tool? Yes.
&lt;/h2&gt;

&lt;p&gt;The criticisms are technically grounded.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PHP’s execution model has limits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Doctrine isn’t a vector database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High-scale AI systems demand specialized architectures.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;But the metaphor of a fake rocket oversimplifies the situation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symfony AI is not pretending to replace AI infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s offering a structured way for Symfony applications to participate in the AI era.&lt;/p&gt;

&lt;p&gt;For some projects, that’s insufficient.&lt;/p&gt;

&lt;p&gt;For many others, it’s exactly what they need.&lt;/p&gt;

&lt;p&gt;And in software engineering, context is everything.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>ai</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CORS: The Traffic Guard You Actually Need (And How It Protects User Sessions)</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Wed, 11 Feb 2026 19:36:38 +0000</pubDate>
      <link>https://dev.to/jeandevbr/cors-the-traffic-guard-you-actually-need-and-how-it-protects-user-sessions-4n33</link>
      <guid>https://dev.to/jeandevbr/cors-the-traffic-guard-you-actually-need-and-how-it-protects-user-sessions-4n33</guid>
      <description>&lt;p&gt;If you’ve ever built a modern web API, you’ve likely been haunted by the infamous error: &lt;em&gt;"No 'Access-Control-Allow-Origin' header is present on the requested resource."&lt;/em&gt; While it feels like a hurdle during development, that error is actually the browser acting as a high-tech bodyguard for your users' data.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Attack Vector: Cross-Site Data Theft
&lt;/h3&gt;

&lt;p&gt;Imagine you are logged into your online bank at &lt;code&gt;bank.com&lt;/code&gt;. Your browser stores a &lt;strong&gt;session cookie&lt;/strong&gt; to keep you logged in. Now, suppose you accidentally visit a malicious site, &lt;code&gt;evil-hacker.net&lt;/code&gt;, in another tab.&lt;/p&gt;

&lt;p&gt;Without &lt;strong&gt;CORS&lt;/strong&gt; and the &lt;strong&gt;Same-Origin Policy (SOP)&lt;/strong&gt;, a script on the hacker's site could trigger a &lt;code&gt;fetch&lt;/code&gt; request to &lt;code&gt;bank.com/api/account-details&lt;/code&gt;. Since browsers automatically attach cookies to requests for the destination domain, the hacker could theoretically read your balance or execute transactions using &lt;strong&gt;your active session&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How CORS Stops the Bleeding
&lt;/h3&gt;

&lt;p&gt;CORS (Cross-Origin Resource Sharing) doesn't necessarily stop a request from &lt;em&gt;leaving&lt;/em&gt; the browser, but it strictly dictates &lt;strong&gt;who is allowed to read the response&lt;/strong&gt;. It’s a handshake between the browser and the server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simple Requests:&lt;/strong&gt; The browser sends the request and checks the &lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt; header in the response. If the domain doesn't match, the browser drops the data before the script can touch it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Preflight (OPTIONS):&lt;/strong&gt; For "risky" actions (like &lt;code&gt;POST&lt;/code&gt; with JSON or &lt;code&gt;DELETE&lt;/code&gt;), the browser sends a "pre-check" request: &lt;em&gt;"Hey server, is this random site allowed to send you this command?"&lt;/em&gt; If the server says no, the actual request is never even sent.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Implementing Modern Protection in Symfony
&lt;/h3&gt;

&lt;p&gt;In the Symfony ecosystem, we don't manually manage these headers in every controller. We use the &lt;strong&gt;NelmioCorsBundle&lt;/strong&gt;. Here is how to configure your application to prevent session hijacking.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Installation
&lt;/h4&gt;

&lt;p&gt;Bash&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require nelmio/cors-bundle

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Security Configuration (&lt;code&gt;config/packages/nelmio_cors.yaml&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;Suppose your frontend lives at &lt;code&gt;https://my-app.com&lt;/code&gt;. You want to ensure no other origin can make authenticated calls to your API.&lt;/p&gt;

&lt;p&gt;YAML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nelmio_cors:
    defaults:
        origin_regex: true
        allow_origin: ['^https://my-app\.com$'] # Only allow your official frontend
        allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
        allow_headers: ['Content-Type', 'Authorization']
        expose_headers: ['X-Custom-Auth-Header']
        max_age: 3600
    paths:
        '^/api/':
            allow_origin: ['https://my-app.com']
            allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
            allow_credentials: true # Crucial for session protection!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why &lt;code&gt;allow_credentials: true&lt;/code&gt; is the Key
&lt;/h3&gt;

&lt;p&gt;When you set &lt;code&gt;allow_credentials: true&lt;/code&gt;, you tell the browser it’s okay to share cookies and authorization headers. However, for security reasons, when this is active, &lt;code&gt;allow_origin&lt;/code&gt; &lt;strong&gt;cannot be a wildcard (&lt;code&gt;*&lt;/code&gt;)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You must specify the exact domain. This prevents any random site from making "credentialed" calls to your backend using the user's existing session.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Protected Controller Example
&lt;/h3&gt;

&lt;p&gt;With the bundle configured, your Symfony controllers stay clean. The security logic is handled at the architectural level.&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/Controller/AccountController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\JsonResponse;

class AccountController extends AbstractController
{
    #[Route('/api/balance', name: 'api_balance', methods: ['GET'])]
    public function getBalance(): JsonResponse
    {
        // If CORS is misconfigured, a malicious site could 
        // trigger this, but the browser would prevent the 
        // malicious script from ever reading this JSON response.
        return new JsonResponse([
            'balance' =&amp;gt; 1250.75,
            'currency' =&amp;gt; 'USD'
        ]);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;CORS isn't a network firewall; it’s a &lt;strong&gt;browser-side security policy&lt;/strong&gt;. By properly configuring &lt;code&gt;nelmio-cors-bundle&lt;/code&gt; in your Symfony project, you aren't just fixing a "bug"—you are ensuring that your users' sessions and sensitive data remain locked within your trusted environment.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>security</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introducing Symfony Object Mapper: Clean and Explicit Object Mapping in Modern PHP</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Wed, 31 Dec 2025 13:46:25 +0000</pubDate>
      <link>https://dev.to/jeandevbr/introducing-symfony-object-mapper-clean-and-explicit-object-mapping-in-modern-php-4hh3</link>
      <guid>https://dev.to/jeandevbr/introducing-symfony-object-mapper-clean-and-explicit-object-mapping-in-modern-php-4hh3</guid>
      <description>&lt;p&gt;Modern software engineering is experiencing a strong maturation phase within the PHP ecosystem, driven by increasing demands for scalability, architectural clarity, and developer productivity. In this context, the release of the &lt;strong&gt;Symfony Object Mapper&lt;/strong&gt; in &lt;strong&gt;2025&lt;/strong&gt; represents an important step forward in the evolution of tools that help developers build more cohesive, explicit, and well-designed applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Object Mapper emerges as a new component in the Symfony ecosystem&lt;/strong&gt; with the goal of solving a classic problem: transforming data between domain objects and other representations, such as arrays, &lt;strong&gt;DTOs&lt;/strong&gt;, or transport structures. &lt;strong&gt;Unlike ORMs, it does not deal with persistence, but rather with clear and controlled conversion between conceptually different models.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A core concept of the Symfony Object Mapper is the separation between the domain and external layers.&lt;/strong&gt; For example, consider a domain object &lt;code&gt;User&lt;/code&gt; that represents business rules, and a &lt;code&gt;UserDTO&lt;/code&gt; used for API input. The Object Mapper allows one to be converted into the other without forcing the domain to depend on HTTP concerns or framework-specific details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$mapper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userDto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another important aspect is the explicit definition of mappings. Instead of scattering manual conversions throughout the codebase, developers can declare how properties relate to one another. A simple example would be mapping fields with different names between objects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$mapper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;UserDTO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'emailAddress'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fullName'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach improves readability and significantly reduces subtle errors, especially as models evolve over time.&lt;/p&gt;

&lt;p&gt;The component also makes it easier to handle more complex transformations, such as creating value objects. Suppose the domain uses an &lt;code&gt;Email&lt;/code&gt; value object, while incoming data provides a plain string. The Object Mapper allows custom transformations to be defined:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$mapper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;UserDTO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps domain rules intact and avoids duplicating validation logic across multiple layers of the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In architectures such as Domain-Driven Design or Clean Architecture, the Object Mapper naturally fits between use cases and external interfaces.&lt;/strong&gt; A controller, for instance, can receive a &lt;strong&gt;DTO&lt;/strong&gt;, delegate the mapping process, and pass a consistent domain object to the use case without taking on extra responsibilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$mapper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$requestDto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$createUserUseCase&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;From a technical standpoint, the Symfony Object Mapper is designed to be both extensible and efficient.&lt;/strong&gt; Mapping definitions can be reused, transformations can be composed, and validations can even be integrated into the process, ensuring that resulting objects are already in a valid state before they are used.&lt;/p&gt;

&lt;p&gt;Finally, by introducing clear examples and an intention-driven API, &lt;strong&gt;the Symfony Object Mapper helps standardize something that was historically implemented in an ad hoc manner.&lt;/strong&gt; It reduces repetitive code, improves system expressiveness, and reinforces a culture of thoughtful design, making it a valuable ally for teams &lt;strong&gt;aiming to improve architectural quality from the very beginning of a project.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>symfony</category>
      <category>dto</category>
      <category>programming</category>
    </item>
    <item>
      <title>SOLID: Understanding the Principles That Make Code Cleaner and More Maintainable</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Wed, 24 Dec 2025 11:26:52 +0000</pubDate>
      <link>https://dev.to/jeandevbr/solid-understanding-the-principles-that-make-code-cleaner-and-more-maintainable-481p</link>
      <guid>https://dev.to/jeandevbr/solid-understanding-the-principles-that-make-code-cleaner-and-more-maintainable-481p</guid>
      <description>&lt;p&gt;If you’ve ever worked on &lt;strong&gt;a project that turned into a “monster” that’s hard to maintain&lt;/strong&gt;, you probably felt the lack of &lt;strong&gt;good code design practices&lt;/strong&gt;. That’s exactly where &lt;strong&gt;SOLID&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;SOLID is a set of &lt;strong&gt;five object-oriented programming principles&lt;/strong&gt; that help you create code that is &lt;strong&gt;more organized, easier to maintain, test, and evolve&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we’ll understand &lt;strong&gt;each principle in simple terms&lt;/strong&gt;, with &lt;strong&gt;practical examples&lt;/strong&gt;, without unnecessary complexity.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is SOLID?
&lt;/h2&gt;

&lt;p&gt;SOLID is an acronym created by &lt;strong&gt;Robert C. Martin (Uncle Bob)&lt;/strong&gt; and stands for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;S&lt;/strong&gt; – Single Responsibility Principle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;O&lt;/strong&gt; – Open/Closed Principle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;L&lt;/strong&gt; – Liskov Substitution Principle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;I&lt;/strong&gt; – Interface Segregation Principle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;D&lt;/strong&gt; – Dependency Inversion Principle&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s go through each one.&lt;/p&gt;




&lt;h2&gt;
  
  
  1️⃣ S — Single Responsibility Principle
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A class should have only one reason to change.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ❌ Bad example
&lt;/h3&gt;

&lt;p&gt;A class that does too much:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Report&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;generateReport&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;saveToDatabase&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;sendEmail&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This class:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Generates reports&lt;/li&gt;
&lt;li&gt;  Saves data&lt;/li&gt;
&lt;li&gt;  Sends emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of these rules change, the entire class may break.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Correct example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ReportGenerator&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ReportRepository&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmailService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Benefit:&lt;/strong&gt; More organized code that’s easier to test and maintain.&lt;/p&gt;




&lt;h2&gt;
  
  
  2️⃣ O — Open/Closed Principle
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Software entities should be open for extension, but closed for modification.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ❌ Bad example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DiscountCalculator&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CHRISTMAS"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"BLACK_FRIDAY"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time a new discount appears, you must modify this class.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Correct example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Discount&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ChristmasDiscount&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Discount&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BlackFridayDiscount&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Discount&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Benefit:&lt;/strong&gt; You add new behaviors without changing existing code.&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ L — Liskov Substitution Principle
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A subclass should be replaceable by its superclass without breaking the system.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ❌ Classic problematic example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Bird&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;fly&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Penguin&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Bird&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Penguins don’t fly!&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a conceptual error: not every bird can fly.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Correct example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Bird&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FlyingBird&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Bird&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;fly&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Penguin&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Bird&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Benefit:&lt;/strong&gt; Correct inheritance hierarchies and fewer unexpected bugs.&lt;/p&gt;




&lt;h2&gt;
  
  
  4️⃣ I — Interface Segregation Principle
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;No class should be forced to implement methods it does not use.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ❌ Bad example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;work&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;eat&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What if we have a robot?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Robot&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;work&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;eat&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="c1"&gt;// Makes no sense&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Correct example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Worker&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;work&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Eater&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;eat&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Human&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Worker&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Eater&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Robot&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Worker&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Benefit:&lt;/strong&gt; Smaller, more specific, and reusable interfaces.&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ D — Dependency Inversion Principle
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Depend on abstractions, not on concrete implementations.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ❌ Bad example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;MySQLDatabase&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MySQLDatabase&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the code is tightly coupled to MySQL.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Correct example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MySQLDatabase&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nc"&gt;OrderService&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Benefit:&lt;/strong&gt; Flexible code that’s easy to test (with mocks) and easy to change implementations.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Conclusion
&lt;/h2&gt;

&lt;p&gt;Applying SOLID is not about:&lt;br&gt;&lt;br&gt;
❌ Writing complex code&lt;br&gt;&lt;br&gt;
❌ Using patterns everywhere&lt;/p&gt;

&lt;p&gt;It’s about:&lt;br&gt;&lt;br&gt;
✅ Organization&lt;br&gt;&lt;br&gt;
✅ Maintainability&lt;br&gt;&lt;br&gt;
✅ Scalability&lt;br&gt;&lt;br&gt;
✅ Fewer bugs in the future&lt;/p&gt;




&lt;p&gt;You &lt;strong&gt;don’t need to apply all principles all the time&lt;/strong&gt;, but understanding them helps you &lt;strong&gt;make better design decisions&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>solidprinciples</category>
      <category>oop</category>
      <category>softwaredevelopment</category>
      <category>programming</category>
    </item>
    <item>
      <title>Framework Battle: Symfony vs. Laravel — Which One Should You Use for Your Enterprise System?</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Mon, 15 Dec 2025 11:52:18 +0000</pubDate>
      <link>https://dev.to/jeandevbr/framework-battle-symfony-vs-laravel-which-one-should-you-use-for-your-enterprise-system-350k</link>
      <guid>https://dev.to/jeandevbr/framework-battle-symfony-vs-laravel-which-one-should-you-use-for-your-enterprise-system-350k</guid>
      <description>&lt;p&gt;When it comes to developing enterprise-level systems with PHP, choosing the right framework is a strategic decision. Among the most popular options, &lt;strong&gt;Symfony&lt;/strong&gt; and &lt;strong&gt;Laravel&lt;/strong&gt; stand out as robust, mature, and widely adopted solutions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which one is the best fit for your enterprise project?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview of Symfony
&lt;/h2&gt;

&lt;p&gt;Symfony is a &lt;strong&gt;highly modular and flexible PHP framework&lt;/strong&gt;, widely used in large-scale and complex systems. Many well-known platforms, such as Drupal and Magento, are built on Symfony components.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Strengths of Symfony
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High level of flexibility&lt;/strong&gt;: You can use only the components you need.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enterprise-ready architecture&lt;/strong&gt;: Ideal for complex business rules and long-term projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strong adherence to best practices&lt;/strong&gt;: SOLID principles, clean architecture, and design patterns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Long-term support (LTS)&lt;/strong&gt; versions, ensuring stability and security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trusted by large corporations&lt;/strong&gt; and widely used in corporate environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Steeper learning curve, especially for beginners.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Initial setup can be more complex.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Development speed may be slower for small or simple projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Overview of Laravel
&lt;/h2&gt;

&lt;p&gt;Laravel is known for its &lt;strong&gt;developer-friendly approach&lt;/strong&gt;, elegant syntax, and fast development capabilities. It has become the most popular PHP framework in recent years.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Strengths of Laravel
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rapid development&lt;/strong&gt; with expressive and clean syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Excellent documentation and a massive community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built-in features like authentication, queues, jobs, caching, and mailing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strong ecosystem (Eloquent ORM, Blade, Horizon, Nova).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ideal for startups and fast-paced development environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Less strict architecture by default, which may lead to technical debt in large teams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some abstractions can hide complexity, impacting performance if not used carefully.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Requires strong architectural discipline in enterprise projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Which Framework Should You Choose?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choose &lt;strong&gt;Symfony&lt;/strong&gt; if:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Your system has &lt;strong&gt;complex business rules&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Long-term maintenance and stability are critical.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You work with large, experienced development teams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You need full control over architecture and components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose &lt;strong&gt;Laravel&lt;/strong&gt; if:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You need &lt;strong&gt;fast development and delivery&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your team values productivity and simplicity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are building an enterprise system with a strong focus on time-to-market.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You enforce architectural standards and best practices internally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;There is no absolute winner in the Symfony vs. Laravel battle. Both frameworks are powerful and capable of supporting enterprise-grade systems. The right choice depends on &lt;strong&gt;project complexity, team experience, scalability needs, and long-term goals&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From a systems analyst’s point of view, &lt;strong&gt;Symfony excels in complex, mission-critical enterprise environments&lt;/strong&gt;, while &lt;strong&gt;Laravel shines when productivity, speed, and developer experience are top priorities&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>laravel</category>
      <category>symfony</category>
    </item>
    <item>
      <title>## ⏳ From Dot-Com Bubble to Digital Hype: Learning from the Past</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Thu, 27 Nov 2025 11:50:16 +0000</pubDate>
      <link>https://dev.to/jeandevbr/-from-dot-com-bubble-to-digital-hype-learning-from-the-past-2k1i</link>
      <guid>https://dev.to/jeandevbr/-from-dot-com-bubble-to-digital-hype-learning-from-the-past-2k1i</guid>
      <description>&lt;p&gt;The term &lt;strong&gt;"Digital Transformation"&lt;/strong&gt; dominates boardrooms and news feeds, promising efficiency, innovation, and the redefinition of entire industries. However, &lt;strong&gt;for those who lived through the late 90s, this digital euphoria sounds curiously familiar&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Today's craze, where every company must "go digital" or "die," bears a deep resemblance to the era of the &lt;strong&gt;Dot-Com Bubble&lt;/strong&gt; (1998–2000). Back then, merely having a ".com" in the name was enough to attract astronomical investments, even if the business model was non-existent. The main lesson the bubble burst taught us, and which is crucial for today's landscape, is simple: &lt;strong&gt;hype doesn't pay the bills.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;The big difference today is the &lt;strong&gt;maturity&lt;/strong&gt; with which we approach technology. During the Dot-Com years, the Internet was seen as a magic wand that would solve all profitability problems; the value lay in &lt;strong&gt;expectation&lt;/strong&gt; and not in &lt;strong&gt;realization&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Today, Digital Transformation is undeniably driven by powerful tools—Cloud Computing, Big Data, AI, and IoT. However, true success lies in going beyond the code and the servers. The focus has shifted to &lt;strong&gt;culture, processes, and customer experience&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Technology is the &lt;strong&gt;means&lt;/strong&gt;, not the end. It must be a catalyst for increasing productivity and optimizing costs, supporting a business model that is, above all, &lt;strong&gt;economically viable&lt;/strong&gt; in the long term.&lt;/p&gt;




&lt;p&gt;One of the most painful lessons in digital history is that the &lt;strong&gt;tool doesn't guarantee wisdom&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hundreds of Dot-Com companies, packed with cutting-edge technology, disappeared because they burned through capital without generating revenue.&lt;/strong&gt; In the current context, this &lt;strong&gt;caution is vital.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Investing in new software or migrating to the cloud is not, in itself, a successful transformation. Leadership must &lt;strong&gt;discern&lt;/strong&gt; where to apply the digital investment. It's not about transforming for transformation's sake, but about choosing changes that will, in fact, translate into &lt;strong&gt;increased productivity and tangible economic results&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;Herein lies the most subtle danger: not every transformation is necessarily for the better. It is the modern-day alchemy dilemma: we can use technology to &lt;strong&gt;turn water into wine&lt;/strong&gt;, creating exceptional and efficient experiences; or we can, through an ill-advised application or poor planning, &lt;strong&gt;turn water into vinegar&lt;/strong&gt;, complicating processes and wasting resources. What defines success is the ability to &lt;strong&gt;validate the digital strategy&lt;/strong&gt; against traditional business metrics: profit, customer satisfaction, and operational efficiency. Without this alignment, Digital Transformation risks becoming merely an expensive and modern repetition of the Dot-Com Bubble's hype.&lt;/p&gt;




&lt;p&gt;Therefore, the legacy of the 2000s serves as a beacon of warning and guidance. Technology gives us unprecedented power, but the &lt;strong&gt;strategic responsibility&lt;/strong&gt; to use it falls to today's leaders. True Digital Transformation is one that respects financial sustainability, places culture at the center, and uses innovation to solve real problems and generate lasting value. May we embrace digital enthusiasm without falling into the trap of speculation, ensuring that our companies are not only &lt;em&gt;digital&lt;/em&gt;, but also fundamentally &lt;strong&gt;sound and prosperous&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
    <item>
      <title>## 🚀 OKRs: The Secret Sauce Behind Tech Companies' Quarterly Success</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Fri, 14 Nov 2025 11:49:02 +0000</pubDate>
      <link>https://dev.to/jeandevbr/-okrs-the-secret-sauce-behind-tech-companies-quarterly-success-333e</link>
      <guid>https://dev.to/jeandevbr/-okrs-the-secret-sauce-behind-tech-companies-quarterly-success-333e</guid>
      <description>&lt;p&gt;If you've ever wondered how companies like Google, Meta, or Netflix maintain a relentless pace of innovation, OKR is a big part of the answer. It's not just a management tool; it's a philosophy that brings focus, alignment, and transparency to the entire organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Exactly Are OKRs?
&lt;/h3&gt;

&lt;p&gt;OKRs are a simple yet powerful framework for defining and tracking goals. They are divided into two essential parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Objective:&lt;/strong&gt; The &lt;strong&gt;WHAT&lt;/strong&gt; we want to achieve.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-   It must be **inspirational**, **qualitative**, and **engaging**. It should be something that makes the team want to go the extra mile.

-   _Example:_ Successfully launch the next generation of our flagship application.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Key Results (KRs):&lt;/strong&gt; The &lt;strong&gt;HOW&lt;/strong&gt; we will measure the success of the objective.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-   They must be **measurable**, **quantitative**, and time-bound (usually quarterly). Progress should be undeniable.

-   _Example for the Objective above:_

    -   KR 1: Achieve $100,000$ in Monthly Recurring Revenue (MRR) by the end of the quarter.

    -   KR 2: Reduce the customer _churn_ rate by $15\%$ for new users.

    -   KR 3: Achieve an average Customer Satisfaction (CSAT) score of $4.5$ out of $5.0$.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h3&gt;
  
  
  Why Do Tech Companies Love OKRs?
&lt;/h3&gt;

&lt;p&gt;The technology environment is fast-paced and constantly changing. The OKR framework fits perfectly into this scenario for a few crucial reasons:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Laser Focus on Priorities (The Essential vs. The Optional)
&lt;/h4&gt;

&lt;p&gt;In a single quarter, a tech company might have countless ideas. OKR forces leadership to choose only &lt;strong&gt;3 to 5 priority Objectives&lt;/strong&gt;. This prevents resource dispersion and ensures that all teams are working on the things that will truly move the needle.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Vertical and Horizontal Alignment
&lt;/h4&gt;

&lt;p&gt;This is the OKR superpower.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vertical (Cascading):&lt;/strong&gt; Company-wide objectives define leadership's OKRs, which, in turn, inform the OKRs of the product, engineering, marketing teams, and so on. The backend team knows exactly how their code is helping to achieve the company's quarterly revenue goal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Horizontal:&lt;/strong&gt; Clear OKRs prevent two teams from working in opposite directions, ensuring Product, Marketing, and Sales are all rowing toward the same destination.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Ambitious Goals (Stretching)
&lt;/h4&gt;

&lt;p&gt;Many tech companies set their OKRs to be slightly uncomfortable—what we call &lt;strong&gt;"Stretch Goals."&lt;/strong&gt; The idea is not to hit $100\%$ of the KR, but to be considered successful if you achieve about $70\%$. This encourages innovation and disruptive thinking. If a team consistently hits $100\%$ of their OKRs, the goal was likely not ambitious enough!&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Total Transparency
&lt;/h4&gt;

&lt;p&gt;In many tech companies, everyone's OKRs—from the CEO to the intern—are public. This generates accountability and allows anyone to understand the company's strategy and see how their work fits into the bigger picture.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Quarterly Cycle in Practice (The Tech Rhythm)
&lt;/h3&gt;

&lt;p&gt;The OKR cycle in tech companies is a well-oiled machine that repeats every 90 days:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Definition (Weeks 1-2):&lt;/strong&gt; Leadership proposes the company's OKRs for the next quarter. Teams then propose their own aligned OKRs, in a process that is both &lt;em&gt;bottom-up&lt;/em&gt; and &lt;em&gt;top-down&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Execution (Weeks 3-12):&lt;/strong&gt; The team works, and tracking is constant. There are weekly &lt;em&gt;check-in&lt;/em&gt; meetings where the &lt;em&gt;status&lt;/em&gt; of each KR is discussed (usually with a score from 0.0 to 1.0).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Evaluation and Scoring (Week 13):&lt;/strong&gt; At the end of the quarter, each KR is scored. The team analyzes what worked, what didn't, and why.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-   **Scoring Example:** If the goal was $100,000$ in MRR and the team achieved $75,000$, the score is $0.75$.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;&lt;em&gt;Retrospective&lt;/em&gt; and Planning (Weeks 13-14):&lt;/strong&gt; Learnings are incorporated into the planning for the next cycle, making the OKR process a continuous loop of improvement and learning.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  💡 Conclusion
&lt;/h2&gt;

&lt;p&gt;OKRs are not just an HR fad; they are the backbone of how tech companies translate a bold vision into measurable, deliverable actions every quarter. They ensure that innovation is focused, growth is intentional, and every line of code or marketing campaign contributes to the big picture.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>performance</category>
      <category>community</category>
      <category>learning</category>
    </item>
    <item>
      <title>🔒 The `#[SensitiveParameter]` Attribute in PHP 8.2+</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Tue, 11 Nov 2025 11:28:16 +0000</pubDate>
      <link>https://dev.to/jeandevbr/the-sensitiveparameter-attribute-in-php-82-152f</link>
      <guid>https://dev.to/jeandevbr/the-sensitiveparameter-attribute-in-php-82-152f</guid>
      <description>&lt;p&gt;During debugging and error monitoring, it's common for &lt;strong&gt;stack traces&lt;/strong&gt; to be recorded in logs. However, &lt;strong&gt;these traces can accidentally capture and expose critical data, such as passwords, API tokens, or credit card numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PHP 8.2 solves this problem with the introduction of the &lt;strong&gt;&lt;code&gt;#[SensitiveParameter]&lt;/code&gt;&lt;/strong&gt; attribute.&lt;/p&gt;




&lt;h3&gt;
  
  
  What is &lt;code&gt;#[SensitiveParameter]&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;#[SensitiveParameter]&lt;/code&gt; is a metadata attribute you can apply to a &lt;strong&gt;specific parameter of a function or method&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If an exception or error is thrown inside the function, PHP ensures that the value of this marked parameter &lt;strong&gt;will not be included&lt;/strong&gt; in the generated stack trace. Instead of the real value, the log will display a secure placeholder, such as &lt;code&gt;***&lt;/code&gt; or &lt;code&gt;*sensitive*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goal:&lt;/strong&gt; To prevent the &lt;strong&gt;accidental exposure&lt;/strong&gt; of confidential data in production logs, crash reports, or detailed error messages, thus strengthening application security.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Practical Demonstration
&lt;/h3&gt;

&lt;p&gt;Consider a simple authentication method that throws an exception if the credentials are invalid.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The Old Scenario (PHP &amp;lt; 8.2)
&lt;/h4&gt;

&lt;p&gt;Without the attribute, if the method fails, the stack trace will show the actual password value:&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function login(string $username, string $password)
{
    // Authentication attempt...
    if (false) { // Simulates a failure
        // Stack trace would include: login('user@email.com', 'my_secret_password')
        throw new Exception("Failed to authenticate user.");
    }
}

try {
    login('user@email.com', 'my_secret_password');
} catch (Exception $e) {
    // $e-&amp;gt;getTraceAsString() exposes 'my_secret_password'
    // ...
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. The Secure Scenario (PHP 8.2+)
&lt;/h4&gt;

&lt;p&gt;By applying the attribute to the &lt;code&gt;$password&lt;/code&gt; parameter, we ensure it will be masked:&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use SensitiveParameter; // Import the attribute (or use \SensitiveParameter)

function login(
    string $username,
    #[SensitiveParameter] string $password // Marks the parameter as sensitive
) {
    // Authentication attempt...
    if (false) { // Simulates a failure
        // Stack trace will include: login('user@email.com', Object(SensitiveParameterValue))
        // The actual value is replaced by a secure object in the trace
        throw new Exception("Failed to authenticate user.");
    }
}

try {
    login('user@email.com', 'my_secret_password');
} catch (Exception $e) {
    // The stack trace generated by PHP or logging tools
    // (like Monolog or Sentry) will NOT display the string 'my_secret_password'.
    // ...
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the log, the &lt;strong&gt;sensitive argument&lt;/strong&gt; will be visually represented as &lt;code&gt;Object(SensitiveParameterValue)&lt;/code&gt;, &lt;strong&gt;protecting&lt;/strong&gt; the data.&lt;/p&gt;




&lt;p&gt;The &lt;code&gt;#[SensitiveParameter]&lt;/code&gt; is a small yet &lt;strong&gt;powerful&lt;/strong&gt; addition to PHP 8.2 that reflects the language's ongoing focus on building robust and secure applications. It is an essential feature for any project that handles authentication data or private keys.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>backend</category>
      <category>php</category>
    </item>
    <item>
      <title>Reflection in Action – Unveiling Symfony's Use of `ReflectionClass`</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Wed, 29 Oct 2025 10:35:42 +0000</pubDate>
      <link>https://dev.to/jeandevbr/reflection-in-action-unveiling-symfonys-use-of-reflectionclass-5d62</link>
      <guid>https://dev.to/jeandevbr/reflection-in-action-unveiling-symfonys-use-of-reflectionclass-5d62</guid>
      <description>&lt;p&gt;Hello devs! As a software engineer, I am excited to share insights into how powerful frameworks like Symfony leverage advanced PHP features. PHP's &lt;strong&gt;Reflection API&lt;/strong&gt;, and specifically the &lt;code&gt;ReflectionClass&lt;/code&gt; class, is a fundamental tool for the magic that happens behind the scenes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a robust framework like Symfony, configuration and flexibility are crucial.&lt;/strong&gt; Much of this flexibility is achieved through a powerful PHP feature: the &lt;strong&gt;Reflection API&lt;/strong&gt;. More specifically, &lt;strong&gt;the &lt;code&gt;ReflectionClass&lt;/code&gt; class acts as a code inspector at runtime&lt;/strong&gt;, allowing the framework to discover information about classes and use this information to make decisions and automatically initialize components.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Dependency Injection (DI)
&lt;/h4&gt;

&lt;p&gt;This is perhaps the &lt;strong&gt;most critical&lt;/strong&gt; use of Reflection. &lt;strong&gt;Symfony's Service Container is responsible for creating and managing objects (services)&lt;/strong&gt;. To do this without you having to explicitly state a class's dependencies, it inspects the class's constructor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Symfony does:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;ReflectionClass&lt;/code&gt; on your service class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It retrieves the constructor method using &lt;code&gt;getConstructor()&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;ReflectionMethod::getParameters()&lt;/code&gt; to list the constructor's parameters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For each parameter, it checks the dependency's &lt;em&gt;type&lt;/em&gt; (the &lt;em&gt;type-hint&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It then resolves these dependencies (finds or creates the corresponding services in the container) and passes them to &lt;code&gt;newInstanceArgs()&lt;/code&gt; to create the service instance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conceptual Example of Constructor Inspection:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you have a service:&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/Service/ProductManager.php
namespace App\Service;

use App\Repository\ProductRepository;
use Psr\Log\LoggerInterface;

class ProductManager
{
    private ProductRepository $repository;
    private LoggerInterface $logger;

    public function __construct(ProductRepository $repository, LoggerInterface $logger)
    {
        $this-&amp;gt;repository = $repository;
        $this-&amp;gt;logger = $logger;
    }
    // ... methods
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Symfony container, internally, would do something &lt;em&gt;conceptually&lt;/em&gt; similar to this to figure out what to inject:&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use ReflectionClass;

// Inside the Service Container...
$reflectionClass = new ReflectionClass(ProductManager::class);
$constructor = $reflectionClass-&amp;gt;getConstructor();

// If a constructor exists and is public...
if ($constructor) {
    $dependencies = [];
    foreach ($constructor-&amp;gt;getParameters() as $parameter) {
        $type = $parameter-&amp;gt;getType();
        if ($type instanceof \ReflectionNamedType &amp;amp;&amp;amp; !$type-&amp;gt;isBuiltin()) {
            // Gets the name of the dependency class (e.g., "App\Repository\ProductRepository")
            $dependencyClass = $type-&amp;gt;getName();

            // Container logic to RESOLVE the dependency
            $dependencies[] = $container-&amp;gt;get($dependencyClass);
        }
    }

    // Creates the ProductManager instance by passing the resolved dependencies
    $manager = $reflectionClass-&amp;gt;newInstanceArgs($dependencies);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Routing and Controllers
&lt;/h4&gt;

&lt;p&gt;With the use of &lt;strong&gt;Attributes&lt;/strong&gt; (or Annotations in older versions), Symfony uses Reflection to read route configuration and &lt;strong&gt;inject arguments&lt;/strong&gt; into controller action methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Symfony does:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;ReflectionClass&lt;/code&gt; for the controller class and &lt;code&gt;ReflectionMethod&lt;/code&gt; for its action methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;ReflectionClass::getAttributes()&lt;/code&gt; or &lt;code&gt;ReflectionMethod::getAttributes()&lt;/code&gt; to find the &lt;code&gt;#[Route]&lt;/code&gt; attribute and extract the path, name, and HTTP methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It inspects the parameters of the action method (e.g., &lt;code&gt;$post&lt;/code&gt; in &lt;code&gt;public function show(Post $post)&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example: Controller Arguments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When Symfony performs automatic &lt;em&gt;ParamConverter&lt;/em&gt; (for example, fetching an entity from the database based on a route value), it relies on Reflection.&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/Controller/PostController.php
use Symfony\Component\Routing\Attribute\Route;
use App\Entity\Post; // Important for the type-hint

class PostController
{
    #[Route('/post/{id}', name: 'post_show')]
    public function show(Post $post) // $post is automatically injected!
    {
        // ... logic that uses $post (which has already been loaded from the DB)
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Symfony processes the &lt;code&gt;show&lt;/code&gt; method:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It gets the &lt;code&gt;ReflectionMethod&lt;/code&gt; for &lt;code&gt;show&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It sees the &lt;code&gt;$post&lt;/code&gt; parameter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reflection tells it the type is &lt;code&gt;App\Entity\Post&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The framework uses this information to invoke the ParamConverter, which fetches the &lt;code&gt;Post&lt;/code&gt; entity from the database using the &lt;code&gt;{id}&lt;/code&gt; from the URL and injects the &lt;strong&gt;already populated&lt;/strong&gt; object into the method.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. The Serializer Component
&lt;/h4&gt;

&lt;p&gt;The Symfony Serializer is used to convert objects to formats like JSON/XML (normalization) and vice-versa (denormalization). It needs to know which properties exist in an object and their types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Symfony does:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;ReflectionClass&lt;/code&gt; for the class to be serialized/deserialized.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It uses &lt;code&gt;getProperties()&lt;/code&gt; and/or &lt;code&gt;getMethods()&lt;/code&gt; to discover the available properties and &lt;em&gt;getters&lt;/em&gt; and &lt;em&gt;setters&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;PropertyInfo&lt;/code&gt; Component, which uses &lt;code&gt;ReflectionExtractor&lt;/code&gt;, uses Reflection to infer property types (including the use of native PHP &lt;em&gt;type-hints&lt;/em&gt; or docblocks).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example: Property and Type Discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/Entity/User.php
class User
{
    private string $firstName;
    private ?int $age = null;
    // ... getters and setters
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Serializer uses Reflection to see that &lt;code&gt;User&lt;/code&gt; has the property &lt;code&gt;$firstName&lt;/code&gt; (type &lt;code&gt;string&lt;/code&gt;) and &lt;code&gt;$age&lt;/code&gt; (type &lt;code&gt;?int&lt;/code&gt;), allowing it to know how to safely convert data to/from the class.&lt;/p&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;Reflection API&lt;/strong&gt; is the introspection engine that allows Symfony to be so &lt;em&gt;magical&lt;/em&gt;, &lt;em&gt;automatic&lt;/em&gt;, and &lt;em&gt;flexible&lt;/em&gt;. It powers &lt;strong&gt;Dependency Injection&lt;/strong&gt;, &lt;strong&gt;Intelligent Routing&lt;/strong&gt;, and &lt;strong&gt;Data Mapping&lt;/strong&gt; (like in the Serializer and the Doctrine ORM), shifting configuration from static files into the code itself (via Attributes and type-hints).&lt;/p&gt;

&lt;p&gt;Mastering the concept of Reflection, even if you don't use it directly in your application code, helps you understand deeply how Symfony operates, empowering you to write cleaner code and debug configuration issues much more easily.&lt;/p&gt;




&lt;p&gt;I hope this article is useful for you! All the best and happy coding!&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
      <category>laravel</category>
      <category>development</category>
    </item>
    <item>
      <title>The Code as a Mirror of the Mind: Code is, at its core, the tangible projection of someone’s reasoning</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Thu, 23 Oct 2025 14:01:08 +0000</pubDate>
      <link>https://dev.to/jeandevbr/the-code-as-a-mirror-of-the-mind-code-is-at-its-core-the-tangible-projection-of-someones-49cp</link>
      <guid>https://dev.to/jeandevbr/the-code-as-a-mirror-of-the-mind-code-is-at-its-core-the-tangible-projection-of-someones-49cp</guid>
      <description>&lt;h2&gt;
  
  
  The Code as a Mirror of the Mind: Code is, at its core, the tangible projection of someone’s reasoning
&lt;/h2&gt;

&lt;p&gt;In the current landscape of innovation and digital disruption, Software Engineering has ascended from a merely technical function to a strategic business pillar. However, many organizations still overlook the fundamental truth behind their code assets: &lt;strong&gt;code is, at its core, the tangible projection of someone’s reasoning.&lt;/strong&gt; Every line written is a direct transcription of a mental process. Understanding this deep correlation is the first step toward unlocking higher levels of quality and resilience in our systems. It is not merely about syntax; it is the manifestation of the developer’s cognition.&lt;/p&gt;

&lt;p&gt;The inevitability of this mental projection means that the disorder, conceptual gaps, or logical shortcuts taken under pressure will be &lt;strong&gt;mirrored precisely and relentlessly in the resulting code.&lt;/strong&gt; Fragmented reasoning or an incomplete understanding of the problem will translate into modules with low cohesion, high coupling, and, critically, a proliferation of silent technical debt. The performance and stability of a system become hostage to the intellectual discipline of its creator. It is a principle of causality in the digital world: the quality of the output is ultimately limited by the clarity of the mental input.&lt;/p&gt;

&lt;p&gt;This premise elevates the importance of the &lt;strong&gt;programmer’s conceptual foundation&lt;/strong&gt; to a strategic level. It is not enough to know &lt;em&gt;how&lt;/em&gt; to type commands; the value lies in knowing &lt;em&gt;what&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt; a certain design pattern or data structure should be applied. A software engineer with a strong theoretical framework (computer science, discrete mathematics, information theory) is better equipped to build elegant abstractions, optimized algorithmic complexities, and solutions that withstand the test of time and scale. Software robustness begins with the rigor of one’s education.&lt;/p&gt;

&lt;p&gt;Technical proficiency, however, operates in layers. While theoretical grounding is crucial, the &lt;strong&gt;intimate mastery of the specific programming language&lt;/strong&gt; used is equally indispensable. Every language has its idioms, its performance trade-offs, and its pitfalls. Fluency doesn't just mean avoiding compilation errors; it means writing code that resonates with the language's ecosystem, utilizing its features efficiently and adhering to its established best practices. A superficial knowledge of a framework or library will manifest as suboptimal code that is difficult to maintain and prone to non-obvious failures.&lt;/p&gt;

&lt;p&gt;Naturally, the &lt;strong&gt;experience accumulated over time&lt;/strong&gt; refines and synthesizes these diverse levels of knowledge. Years of work translate abstract theory into practical wisdom, turning syntactic knowledge into expertise in system architecture. The experienced developer develops a keen sense for scalability and security issues before they surface, learning to read between the lines of a business requirement and anticipate the long-term consequences of design decisions. Maturity is, therefore, a force multiplier in the pursuit of code excellence.&lt;/p&gt;

&lt;p&gt;Ultimately, &lt;strong&gt;even the most brilliant engineer, with the most robust conceptual foundation and years of experience, has cognitive blind spots.&lt;/strong&gt; The coding process is inherently subjective, and proximity to the artifact can subtly obscure logical flaws or pattern violations. This is why, when the goal is enterprise-level excellence and reliability, &lt;strong&gt;code review by another developer&lt;/strong&gt; is established not as a luxury but as a quality imperative. It is the institutional mechanism that applies collective intelligence, decentralizes knowledge, and, crucially, confronts the projection of individual reasoning with the scrutiny of a qualified peer, ensuring superior and sustainable outcomes.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>development</category>
      <category>software</category>
    </item>
    <item>
      <title>Understanding in simple terms: symfony lock versus symfony semaphore</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Tue, 09 Sep 2025 10:58:49 +0000</pubDate>
      <link>https://dev.to/jeandevbr/understanding-in-simple-terms-symfony-lock-versus-symfony-semaphore-2h5d</link>
      <guid>https://dev.to/jeandevbr/understanding-in-simple-terms-symfony-lock-versus-symfony-semaphore-2h5d</guid>
      <description>&lt;p&gt;For software developers, &lt;strong&gt;managing shared resources is a constant challenge&lt;/strong&gt;. The &lt;strong&gt;Symfony&lt;/strong&gt; framework, for instance, offers robust tools to handle this scenario, and two of them, &lt;code&gt;Lock&lt;/code&gt; and &lt;code&gt;Semaphore&lt;/code&gt;, are often confused. Although both are used to control access to resources, their approaches and use cases are fundamentally different. Understanding this distinction is crucial to avoiding complex bugs and ensuring the integrity of your applications.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Lock&lt;/code&gt; class in Symfony is ideal for &lt;strong&gt;managing exclusive access to a resource&lt;/strong&gt;. Imagine you have a critical section of code that can only be executed by a single task at a time. The &lt;code&gt;Lock&lt;/code&gt; ensures exactly that: it allows one process to acquire a "key" for that resource, and as long as that key is in its possession, no other process can obtain it. It's an "all or nothing" model—either you have the key to enter, or you wait until it's released. This is perfect for preventing race conditions when updating files, processing payments, or modifying database data where order and exclusivity are paramount.&lt;/p&gt;

&lt;p&gt;On the other hand, the &lt;code&gt;Semaphore&lt;/code&gt; adopts a more permissive and flexible approach. Instead of a single key, it handles a predetermined number of "permissions" or "tokens." When a process needs to access the resource, it consumes one of these permissions. If the number of available permissions is zero, the process must wait. This means multiple processes can access the resource simultaneously, as long as the maximum limit of permissions has not been reached. &lt;strong&gt;The &lt;code&gt;Semaphore&lt;/code&gt; is like a parking lot with a limited number of spaces&lt;/strong&gt;: cars can enter until all spaces are occupied, and new cars can only enter when a space is freed up.&lt;/p&gt;

&lt;p&gt;The main &lt;strong&gt;difference&lt;/strong&gt;, therefore, lies in the &lt;strong&gt;granularity of control&lt;/strong&gt;. The &lt;code&gt;Lock&lt;/code&gt; enforces &lt;strong&gt;exclusive&lt;/strong&gt; access (one permission at a time), while the &lt;code&gt;Semaphore&lt;/code&gt; allows for &lt;strong&gt;concurrent&lt;/strong&gt; and &lt;strong&gt;limited&lt;/strong&gt; access (multiple permissions). In simple terms, the &lt;code&gt;Lock&lt;/code&gt; is a padlock on a door that can only be opened by one person at a time. The &lt;code&gt;Semaphore&lt;/code&gt; is a set of passwords that can be distributed to multiple people at the same time until there are no more passwords left.&lt;/p&gt;

&lt;p&gt;To illustrate with practical examples, think of a cron job that needs to generate a complex report. If the process is time-consuming and could be run again, you should use a &lt;code&gt;Lock&lt;/code&gt; to ensure that only one instance of the script is running. This prevents two instances of the report from being generated at the same time, causing conflicts or duplicate data. The &lt;code&gt;Lock&lt;/code&gt; prevents the second instance from starting until the first one is complete.&lt;/p&gt;

&lt;p&gt;In a different scenario, consider a system that processes images uploaded by users. You might want to limit the number of simultaneous processing tasks to avoid overloading the CPU. In this case, the &lt;code&gt;Semaphore&lt;/code&gt; would be the ideal choice. You can configure it to, for example, allow a maximum of five image resizing processes to occur at the same time. If a sixth process tries to start, it will be blocked until one of the five ongoing processes finishes and releases a permission.&lt;/p&gt;

&lt;p&gt;In summary, the choice between &lt;code&gt;Lock&lt;/code&gt; and &lt;code&gt;Semaphore&lt;/code&gt; in Symfony depends on your need for control. &lt;strong&gt;If your application needs to ensure that only one process at a time can access a resource, the &lt;code&gt;Lock&lt;/code&gt; is the correct tool.&lt;/strong&gt; And other hands, &lt;strong&gt;if the intention is to limit the number of simultaneous accesses to a resource while allowing controlled concurrency, the &lt;code&gt;Semaphore&lt;/code&gt; is the solution.&lt;/strong&gt; Mastering these distinctions not only optimizes performance but also ensures the robustness and security of your systems, which is the ultimate goal of any developer.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
      <category>development</category>
      <category>programming</category>
    </item>
    <item>
      <title>Creating a extremely secure hacker-proof system</title>
      <dc:creator>Jean Klebert de A Modesto</dc:creator>
      <pubDate>Fri, 15 Aug 2025 10:20:04 +0000</pubDate>
      <link>https://dev.to/jeandevbr/creating-a-extremely-secure-hacker-proof-system-advanced-cybersecurity-principles-3gno</link>
      <guid>https://dev.to/jeandevbr/creating-a-extremely-secure-hacker-proof-system-advanced-cybersecurity-principles-3gno</guid>
      <description>&lt;p&gt;Creating a &lt;strong&gt;completely hacker-proof&lt;/strong&gt; system is, in practice, impossible due to the dynamic nature of cyber threats, the complexity of systems, and the possibility of human error or unforeseen failures. However, it is possible to build an &lt;strong&gt;extremely secure&lt;/strong&gt; system with robust hardware, software, and operational practices. Below, I'll detail the necessary components and strategies to maximize security, based on advanced cybersecurity principles:&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Necessary Hardware&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Hardware plays a crucial role in security by providing a trustworthy foundation for the system. The following components are recommended:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Hardware Security Modules (HSMs):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: Securely store cryptographic keys and perform cryptographic operations without exposing sensitive data.&lt;/li&gt;
&lt;li&gt;Example: YubiHSM, Nitrokey HSM, or devices like the Trusted Platform Module (TPM).&lt;/li&gt;
&lt;li&gt;Why use: They protect against key extraction and physical attacks.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Processors with Security Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: CPUs that support technologies like Intel SGX (Software Guard Extensions), AMD SEV (Secure Encrypted Virtualization), or ARM TrustZone.&lt;/li&gt;
&lt;li&gt;Why use: They allow code execution in isolated environments (secure enclaves) and protect against low-level attacks, such as memory manipulation.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Systems with a Zero Trust Architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: Hardware designed to verify every operation, such as systems with secure boot and remote attestation.&lt;/li&gt;
&lt;li&gt;Example: Servers with verified firmware and dedicated chips for startup validation.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Secure Network Devices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: Hardware firewalls, routers that support secure VLANs, and switches with network segmentation.&lt;/li&gt;
&lt;li&gt;Example: Cisco Secure Firewall, Palo Alto Networks.&lt;/li&gt;
&lt;li&gt;Why use: They limit unauthorized access and protect against network attacks.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Encrypted Storage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: Hard drives or SSDs with hardware encryption (AES-256).&lt;/li&gt;
&lt;li&gt;Example: Samsung T7 Shield, TCG Opal-compliant drives.&lt;/li&gt;
&lt;li&gt;Why use: They protect data at rest from physical access.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Air-Gapped Systems (Optional):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function: Computers physically isolated from the internet or other networks.&lt;/li&gt;
&lt;li&gt;Why use: They eliminate the possibility of remote attacks but limit functionality.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Necessary Software&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Software must be designed to minimize vulnerabilities and implement layers of defense in depth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Secure Operating System:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Options:&lt;/li&gt;
&lt;li&gt;Qubes OS: Uses Xen-based virtualization to isolate applications and processes into separate compartments.&lt;/li&gt;
&lt;li&gt;Tails OS: A live operating system focused on privacy and anonymity, ideal for sensitive operations.&lt;/li&gt;
&lt;li&gt;Hardened Linux Distributions: Like Debian or Fedora with reinforced security settings (SELinux, AppArmor).&lt;/li&gt;
&lt;li&gt;Why use: They reduce the attack surface and limit privileges.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Strong Encryption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools: OpenSSL, GnuPG, or libraries like Libsodium for end-to-end encryption.&lt;/li&gt;
&lt;li&gt;Protocols: TLS 1.3 for secure communications, AES-256 for data at rest.&lt;/li&gt;
&lt;li&gt;Why use: They protect data in transit and at rest from interception.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Intrusion Detection and Prevention Systems (IDS/IPS):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: Suricata, Snort, or CrowdStrike Falcon.&lt;/li&gt;
&lt;li&gt;Why use: They monitor for suspicious activity and block attacks in real time.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Application Firewalls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: ModSecurity, pfSense.&lt;/li&gt;
&lt;li&gt;Why use: They filter malicious traffic and protect web applications.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Identity and Access Management (IAM):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools: Okta, Keycloak, or Zero Trust-based solutions.&lt;/li&gt;
&lt;li&gt;Why use: They implement multi-factor authentication (MFA), role-based access control (RBAC), and continuous verification.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Monitoring and Logging Software:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: ELK Stack (Elasticsearch, Logstash, Kibana), Splunk.&lt;/li&gt;
&lt;li&gt;Why use: They enable real-time auditing and anomaly detection.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Automatic Updates and Patch Management:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools: Ansible, Puppet, or native OS update systems.&lt;/li&gt;
&lt;li&gt;Why use: They quickly fix known vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Operational Practices&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Beyond hardware and software, security depends on rigorous practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Principle of Least Privilege:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limit user and process access to the minimum necessary.&lt;/li&gt;
&lt;li&gt;Example: Use non-privileged administrative accounts for daily tasks.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Network Segmentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Divide the network into isolated zones to limit the spread of attacks.&lt;/li&gt;
&lt;li&gt;Example: VLANs or software-defined networking (SDN).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Encryption at All Layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data at rest, in transit, and in use should be encrypted.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Social Engineering Training:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Educate users to avoid phishing, spear phishing, and other human-based tactics.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Regular Penetration Testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hire experts to simulate attacks and identify weaknesses.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Secure Backups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain encrypted backups in offline or air-gapped locations.&lt;/li&gt;
&lt;li&gt;Example: Use LTO tapes with encryption.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Incident Response Plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define clear procedures for detecting, containing, and mitigating breaches.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Limitations and Considerations&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Impossibility of Absolute Security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Even with the best practices, systems can be compromised by human error, zero-day vulnerabilities, or physical attacks.&lt;/li&gt;
&lt;li&gt;Example: A malicious insider with physical access can bypass many defenses.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Cost vs. Benefit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Highly secure systems (like air-gapped ones) can be expensive and impractical for general use.&lt;/li&gt;
&lt;li&gt;Solution: Assess the necessary level of security based on the data being protected.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Continuous Maintenance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security requires constant updates, monitoring, and adaptation to new threats.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Example of an Ideal Configuration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An extremely secure system could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt;: A server with a TPM, HSM, and encrypted drives, hosted in a data center with strict physical controls.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: Qubes OS with SELinux enabled.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network&lt;/strong&gt;: Hardware firewall, VPN with strong encryption, and network segmentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt;: Applications running in isolated containers (Docker with security policies), protected by an IDS/IPS and monitored by an ELK Stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Access&lt;/strong&gt;: Multi-factor authentication with a YubiKey, Zero Trust policies, and constant auditing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maintenance&lt;/strong&gt;: Quarterly penetration tests, automatic updates, and offline backups.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;While a 100% hacker-proof system is unfeasible, combining secure hardware, robust software, and rigorous operational practices can create an extremely resilient system. The key is to implement &lt;strong&gt;defense in depth&lt;/strong&gt;, continuously monitor, and adapt to new threats. &lt;/p&gt;

&lt;p&gt;For a specific project, I recommend consulting cybersecurity experts to customize a solution based on your needs.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>security</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
