<?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: Tomatito</title>
    <description>The latest articles on DEV Community by Tomatito (@jose25upt).</description>
    <link>https://dev.to/jose25upt</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%2F3028452%2F1819b301-c634-4b3c-a477-1288df03bb73.gif</url>
      <title>DEV Community: Tomatito</title>
      <link>https://dev.to/jose25upt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jose25upt"/>
    <language>en</language>
    <item>
      <title>Prácticas de observabilidad con Prometheus y Grafana en una aplicación FastAPI</title>
      <dc:creator>Tomatito</dc:creator>
      <pubDate>Sat, 05 Jul 2025 12:28:24 +0000</pubDate>
      <link>https://dev.to/jose25upt/practicas-de-observabilidad-con-prometheus-y-grafana-en-una-aplicacion-fastapi-3n10</link>
      <guid>https://dev.to/jose25upt/practicas-de-observabilidad-con-prometheus-y-grafana-en-una-aplicacion-fastapi-3n10</guid>
      <description>&lt;p&gt;``# 🧠 Observability Practices with Prometheus and Grafana in a FastAPI Application 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; #observability #devops #python #grafana #prometheus&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Introduction
&lt;/h2&gt;

&lt;p&gt;In the current era of cloud-native applications and microservices, systems are becoming increasingly complex and distributed. Monitoring is no longer enough. We need to go deeper—&lt;strong&gt;observability&lt;/strong&gt; is the answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Observability&lt;/strong&gt; is the practice of understanding the internal state of a system based on the data it produces, namely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Metrics&lt;/strong&gt; (numerical values over time)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logs&lt;/strong&gt; (structured/unstructured event data)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traces&lt;/strong&gt; (information about distributed request paths)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where monitoring tells you &lt;strong&gt;what is broken&lt;/strong&gt;, observability helps you understand &lt;strong&gt;why it's broken&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌐 Why Observability Matters
&lt;/h2&gt;

&lt;p&gt;Imagine a user complains that your application is slow. You check CPU usage and it looks fine. So… where do you look next?&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;good observability&lt;/strong&gt;, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trace a request end-to-end (tracing)&lt;/li&gt;
&lt;li&gt;Visualize request volume or error rates (metrics)&lt;/li&gt;
&lt;li&gt;Drill into error logs with detailed context (logs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These insights are essential to maintain performance, uptime, and a smooth developer experience.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 Core Pillars of Observability
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Metrics&lt;/strong&gt;: Time-series data about your systems (e.g., requests per second, CPU usage).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logs&lt;/strong&gt;: Records of events generated by applications (e.g., errors, warnings).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traces&lt;/strong&gt;: Information about a single request as it moves through multiple services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When combined, these pillars help teams quickly answer complex questions like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What is the latency for requests to /login over the last 5 minutes, and what caused the spike at 10:05am?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚒️ Tools We Will Use
&lt;/h2&gt;

&lt;p&gt;For this article, we implement observability using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🐍 &lt;strong&gt;FastAPI&lt;/strong&gt; – a modern web framework for Python&lt;/li&gt;
&lt;li&gt;📈 &lt;strong&gt;Prometheus&lt;/strong&gt; – open-source metrics collection system&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Grafana&lt;/strong&gt; – dashboard and visualization tool&lt;/li&gt;
&lt;li&gt;🐳 &lt;strong&gt;Docker Compose&lt;/strong&gt; – to run everything easily&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This setup will let us &lt;strong&gt;collect, visualize, and analyze&lt;/strong&gt; metrics from a running Python app.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Implementation Overview
&lt;/h2&gt;

&lt;p&gt;We'll deploy a FastAPI application with instrumentation that tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total number of requests&lt;/li&gt;
&lt;li&gt;HTTP methods and response codes&lt;/li&gt;
&lt;li&gt;Response time per endpoint&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These metrics will be exposed at &lt;code&gt;/metrics&lt;/code&gt; and scraped by &lt;strong&gt;Prometheus&lt;/strong&gt; every 5 seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grafana&lt;/strong&gt; will be connected to Prometheus to show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request rates by endpoint&lt;/li&gt;
&lt;li&gt;Latency trends&lt;/li&gt;
&lt;li&gt;Real-time traffic behavior&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Benefits of This Approach
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Benefit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔎 Real-time Monitoring&lt;/td&gt;
&lt;td&gt;Track endpoint usage and performance instantly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📊 Visual Dashboards&lt;/td&gt;
&lt;td&gt;Easy-to-understand graphs in Grafana&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚡ Fast Debugging&lt;/td&gt;
&lt;td&gt;Quickly spot slow endpoints or traffic spikes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧩 Extendable&lt;/td&gt;
&lt;td&gt;Add logs (ELK), tracing (Jaeger), and alerts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This observability stack is ideal for microservices, APIs, CI/CD pipelines, and production monitoring.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 When to Use Prometheus + Grafana
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Recommendation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lightweight metrics&lt;/td&gt;
&lt;td&gt;✅ Prometheus excels here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes/Containers&lt;/td&gt;
&lt;td&gt;✅ Native support with service discovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flexible dashboards&lt;/td&gt;
&lt;td&gt;✅ Grafana is the gold standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Need logs/traces&lt;/td&gt;
&lt;td&gt;🔁 Combine with ELK, Loki, or Jaeger&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧠 Best Practices for Observability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use consistent &lt;strong&gt;labeling&lt;/strong&gt; for metrics (e.g., &lt;code&gt;method&lt;/code&gt;, &lt;code&gt;endpoint&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Expose a &lt;code&gt;/metrics&lt;/code&gt; endpoint in every service&lt;/li&gt;
&lt;li&gt;Avoid high-cardinality metrics (e.g., per-user metrics)&lt;/li&gt;
&lt;li&gt;Add alerts for SLOs and anomalies&lt;/li&gt;
&lt;li&gt;Centralize your dashboards for all environments&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📚 Summary
&lt;/h2&gt;

&lt;p&gt;Observability is essential for modern application health and performance. By implementing it with tools like Prometheus and Grafana, you gain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deep visibility into behavior and usage&lt;/li&gt;
&lt;li&gt;Data to improve reliability and performance&lt;/li&gt;
&lt;li&gt;Faster root-cause analysis for issues&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Code Walkthrough &amp;amp; Example Setup
&lt;/h2&gt;

&lt;p&gt;Below is the &lt;strong&gt;code section&lt;/strong&gt; that shows how to set up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A FastAPI app instrumented with Prometheus metrics&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;Dockerfile&lt;/code&gt; for containerization&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;docker-compose.yml&lt;/code&gt; to launch Prometheus and Grafana&lt;/li&gt;
&lt;li&gt;A preconfigured Grafana dashboard JSON&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 This section is fully detailed in the next Markdown block: &lt;code&gt;📦 Code &amp;amp; Configuration&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📥 Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://prometheus.io/docs/" rel="noopener noreferrer"&gt;Prometheus Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://grafana.com/docs/" rel="noopener noreferrer"&gt;Grafana Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opentelemetry.io/" rel="noopener noreferrer"&gt;OpenTelemetry&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📢 Stay Connected
&lt;/h2&gt;

&lt;p&gt;If this helped you, consider giving it a ❤️, commenting, or following me on Dev.to.&lt;/p&gt;

&lt;p&gt;You can also join our developer community on Telegram to discuss DevOps, APIs, and observability!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Enterprise Architecture Patterns</title>
      <dc:creator>Tomatito</dc:creator>
      <pubDate>Sun, 27 Apr 2025 05:26:38 +0000</pubDate>
      <link>https://dev.to/jose25upt/enterprise-architecture-patterns-l9c</link>
      <guid>https://dev.to/jose25upt/enterprise-architecture-patterns-l9c</guid>
      <description>&lt;h1&gt;
  
  
  Enterprise Architecture Patterns
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Concept
&lt;/h2&gt;

&lt;p&gt;Enterprise Architecture (EA) patterns are reusable solutions to common design problems in the development of enterprise systems. They represent a set of principles, guidelines, and best practices that help organizations create and manage their IT infrastructure effectively.&lt;/p&gt;

&lt;h5&gt;
  
  
  What are Enterprise Architecture Patterns?
&lt;/h5&gt;

&lt;p&gt;Enterprise Architecture patterns are predefined templates or models that represent an organization’s IT architecture. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These patterns provide a structured approach to designing and implementing enterprise systems, and are reusable across different applications and projects. &lt;/li&gt;
&lt;li&gt;EA patterns are intended to simplify the complexity of enterprise architecture and reduce the time and effort required to create effective solutions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Why are Enterprise Architecture Patterns Needed?
&lt;/h5&gt;

&lt;p&gt;Enterprise Architecture patterns are essential because they offer a number of significant benefits to organizations. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firstly, they provide a standardized approach to system design, improving the consistency and quality of solutions. &lt;/li&gt;
&lt;li&gt;Secondly, they help organizations achieve more efficient use of resources by reusing existing patterns. &lt;/li&gt;
&lt;li&gt;Thirdly, they support the alignment of IT architecture with business objectives, enhancing the overall strategic effectiveness of the organization.
##### What Problems Do Enterprise Architecture Patterns Solve?&lt;/li&gt;
&lt;li&gt;Enterprise Architecture patterns solve a variety of common design problems faced by organizations.&lt;/li&gt;
&lt;li&gt;Help organizations create scalable and flexible systems that can adapt to changing business needs.&lt;/li&gt;
&lt;li&gt;Contribute to improving system reliability, security, and performance. &lt;/li&gt;
&lt;li&gt;facilitate the integration of disparate systems and technologies, making it easier to manage complex IT environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some Popular Enterprise Architecture Patterns
&lt;/h2&gt;

&lt;p&gt;There are many Enterprise Architecture patterns available, each addressing a specific design problem. Below are some of the most popular:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service-Oriented Architecture (SOA): Focuses on creating services that can be reused across multiple applications.&lt;/li&gt;
&lt;li&gt;Microservices Architecture: Breaks down applications into small, independently deployable services, similar to SOA.&lt;/li&gt;
&lt;li&gt;Event-Driven Architecture (EDA): Centers on the production, detection, and consumption of events to trigger business processes.&lt;/li&gt;
&lt;li&gt;Layered Architecture: Organizes applications into a set of logical layers that work together to deliver functionality.&lt;/li&gt;
&lt;li&gt;Big Data Architecture: Manages and processes large volumes of data in real time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Combining Enterprise Architecture Patterns
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Enterprise Architecture patterns can be combined to create more complex and tailored solutions. For example, it is possible to combine SOA with EDA to create an event-driven SOA, or to integrate Microservices Architecture with Layered Architecture to achieve scalable and flexible systems. Combining patterns allows organizations to create customized solutions that perfectly fit their specific needs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Detailed Architectural and Design Patterns
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Once you understand the combination of enterprise architecture patterns, it's important to delve into more specific patterns that guide the technical construction of applications. These design and architectural patterns cover aspects such as web presentation, data distribution, business logic, session state management, and data persistence. Below, we describe some of the most commonly used patterns in the development of modern enterprise systems, which can help structure applications in an efficient, flexible, and scalable manner.&lt;br&gt;
These patterns are applied to solve common problems that arise in the development of complex systems, such as managing user interaction, separating responsibilities, efficiently distributing data, and improving consistency and performance in distributed systems. By understanding and using these patterns appropriately, organizations can optimize their applications, reduce complexity, and facilitate long-term maintenance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Web Presentation Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Model View Controller
 &amp;gt; Splits user interface interaction into three distinct roles.&lt;/li&gt;
&lt;li&gt;Page Controller
 &amp;gt; An object that handles a request for a specific page or action on a Web site.&lt;/li&gt;
&lt;li&gt;Front Controller
 &amp;gt;A controller that handles all requests for a Web site.&lt;/li&gt;
&lt;li&gt;Template View
 &amp;gt;Renders information into HTML by embedding markers in an HTML page.&lt;/li&gt;
&lt;li&gt;Transform View
 &amp;gt;A view that processes domain data element by element and transforms it into HTML.&lt;/li&gt;
&lt;li&gt;Two Step View
 &amp;gt;Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.&lt;/li&gt;
&lt;li&gt;Application Controller
 &amp;gt;A centralized point for handling screen navigation and the flow of an application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Distribution Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Remote Facade
&amp;gt; Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.&lt;/li&gt;
&lt;li&gt;  Data Transfer Object
&amp;gt; An object that carries data between processes in order to reduce the number of method calls.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Offline Concurrency Patterns
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Optimistic Offline Lock
&amp;gt; Prevents conflicts between concurrent business transactions by detecting a conflict and rolling back the transaction.&lt;/li&gt;
&lt;li&gt;Pessimistic Offline Lock
&amp;gt; Prevents conflicts between concurrent business transactions by allowing only one business transaction at a time to access data.&lt;/li&gt;
&lt;li&gt;  Coarse-Grained Lock
&amp;gt; Locks a set of related objects with a single lock.&lt;/li&gt;
&lt;li&gt;  Implicit Lock
&amp;gt; Allows framework or layer supertype code to acquire offline locks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Session State Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Client Session State
&amp;gt; Stores session state on the client.&lt;/li&gt;
&lt;li&gt;  Server Session State
&amp;gt; Keeps the session state on a server system in a serialized form.&lt;/li&gt;
&lt;li&gt;  Database Session State
&amp;gt; Stores session data as committed data in the database.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Base Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Gateway
&amp;gt;An object that encapsulates access to an external system or resource.&lt;/li&gt;
&lt;li&gt;  Mapper
&amp;gt;An object that sets up a communication between two independent objects.&lt;/li&gt;
&lt;li&gt;  Layer Supertype
&amp;gt;A type that acts as the supertype for all types in its layer.&lt;/li&gt;
&lt;li&gt;  Separated Interface
 &amp;gt;Defines an interface in a separate package from its implementation.&lt;/li&gt;
&lt;li&gt;  Registry
  &amp;gt;A well-known object that other objects can use to find common objects and services.&lt;/li&gt;
&lt;li&gt;  Value Object
 &amp;gt;A small simple object, like money or a date range, whose equality isn't based on identity.&lt;/li&gt;
&lt;li&gt;  Money
 &amp;gt;Represents a monetary value.&lt;/li&gt;
&lt;li&gt;  Special Case
  &amp;gt;A subclass that provides special behavior for particular cases.&lt;/li&gt;
&lt;li&gt;  Plugin
  &amp;gt;Links classes during configuration rather than compilation.&lt;/li&gt;
&lt;li&gt;  Service Stub
   &amp;gt;Removes dependence upon problematic services during testing. WSDL&lt;/li&gt;
&lt;li&gt;  Record Set
  &amp;gt;An in-memory representation of tabular data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Domain Logic Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Transaction Script
  &amp;gt;Organizes business logic by procedures where each procedure handles a single request from the presentation.&lt;/li&gt;
&lt;li&gt;  Domain Model
 &amp;gt;An object model of the domain that incorporates both behavior and data.&lt;/li&gt;
&lt;li&gt;  Table Module
  &amp;gt;A single instance that handles the business logic for all rows in a database table or view.&lt;/li&gt;
&lt;li&gt;  Service Layer
   &amp;gt;Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each operation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Data Source Architectural Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Table Data Gateway
  &amp;gt;An object that acts as a Gateway (466) to a database table. One instance handles all the rows in the table.&lt;/li&gt;
&lt;li&gt;  Row Data Gateway
  &amp;gt;An object that acts as a Gateway (466) to a single record in a data source. There is one instance per row.&lt;/li&gt;
&lt;li&gt;  Active Record
  &amp;gt;An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.&lt;/li&gt;
&lt;li&gt;  Data Mapper
  &amp;gt;A layer of Mappers (473) that moves data between objects and a database while keeping them independent of each other and the mapper itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Object-Relational Behavioral Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Unit of Work
   &amp;gt;Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.&lt;/li&gt;
&lt;li&gt;  Identity Map
  &amp;gt;  Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.&lt;/li&gt;
&lt;li&gt;  Lazy Load
  &amp;gt;An object that doesn't contain all of the data you need but knows how to get it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Object-Relational Structural Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Identity Field
  &amp;gt;Saves a database ID field in an object to maintain identity between an in-memory object and a database row.&lt;/li&gt;
&lt;li&gt;  Foreign Key Mapping
  &amp;gt;Maps an association between objects to a foreign key reference between tables.&lt;/li&gt;
&lt;li&gt;  Association Table Mapping
  &amp;gt;Saves an association as a table with foreign keys to the tables that are linked by the association.&lt;/li&gt;
&lt;li&gt;  Dependent Mapping
  &amp;gt; Has one class perform the database mapping for a child class.&lt;/li&gt;
&lt;li&gt;  Embedded Value
  &amp;gt;Maps an object into several fields of another object's table.&lt;/li&gt;
&lt;li&gt;  Serialized LOB
  &amp;gt;Saves a graph of objects by serializing them into a single large object (LOB), which it stores in a database field.&lt;/li&gt;
&lt;li&gt;  Single Table Inheritance
  &amp;gt;Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.&lt;/li&gt;
&lt;li&gt;  Class Table Inheritance
  &amp;gt;Represents an inheritance hierarchy of classes with one table for each class.&lt;/li&gt;
&lt;li&gt;  Concrete Table Inheritance
   &amp;gt;Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.&lt;/li&gt;
&lt;li&gt;  Inheritance Mappers
   &amp;gt;A structure to organize database mappers that handle inheritance hierarchies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Object-Relational Metadata Mapping Patterns
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;  Metadata Mapping
  &amp;gt;Holds details of object-relational mapping in metadata.&lt;/li&gt;
&lt;li&gt;  Query Object
   &amp;gt;An object that represents a database query.&lt;/li&gt;
&lt;li&gt;  Repository
   &amp;gt;Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Medio de Publicacion DEV
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://dev.to/jose25upt/enterprise-architecture-patterns-l9c/edit"&gt;https://dev.to/jose25upt/enterprise-architecture-patterns-l9c/edit&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Github y Automatizacion:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Jose25UPT/Enterprise-Architecture-Patterns" rel="noopener noreferrer"&gt;https://github.com/Jose25UPT/Enterprise-Architecture-Patterns&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>programming</category>
      <category>design</category>
    </item>
    <item>
      <title>Software Design Principles</title>
      <dc:creator>Tomatito</dc:creator>
      <pubDate>Tue, 08 Apr 2025 04:50:52 +0000</pubDate>
      <link>https://dev.to/jose25upt/software-design-principles-22i4</link>
      <guid>https://dev.to/jose25upt/software-design-principles-22i4</guid>
      <description>&lt;h1&gt;
  
  
  What is a Principle?
&lt;/h1&gt;

&lt;p&gt;A principle is a broad behavioral guideline applicable to many situations. In general, a principle doesn't tell you exactly what to do, but rather gives you clues as to the correct course of action across a wide range of situations. The details are up to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't Repeat Yourself (DRY)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You should avoid repeating code as much as possible.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;We must keep in mind that we must find ways to reuse code we've already created to avoid getting tangled up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why is it important?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;➢ &lt;strong&gt;Makes the code more maintainable:&lt;/strong&gt; Avoiding repeating code helps us make changing functionality more practical.&lt;/li&gt;
&lt;li&gt;➢ &lt;strong&gt;Reduces code size:&lt;/strong&gt; It makes it more readable and understandable because there's less code to understand.&lt;/li&gt;
&lt;li&gt;➢ &lt;strong&gt;Saves time:&lt;/strong&gt; By having the code available for reuse, we can use it and shorten coding time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  KISS = Keep It Simple [,] Stupid
&lt;/h2&gt;

&lt;p&gt;This principle establishes that code, design, documentation, and everything related to it should be simple.&lt;/p&gt;

&lt;p&gt;It establishes that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;➢ Software should have as few components as possible&lt;/li&gt;
&lt;li&gt;➢ No unused functionality&lt;/li&gt;
&lt;li&gt;➢ Documentation should contain strict and necessary information&lt;/li&gt;
&lt;li&gt;➢ Code should be as obvious and simple as possible&lt;/li&gt;
&lt;li&gt;➢ Design should be simple&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why is it important?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;➢ &lt;strong&gt;More maintainable projects.&lt;/strong&gt; The code is easier to maintain and update.&lt;/li&gt;
&lt;li&gt;➢ &lt;strong&gt;Less documentation.&lt;/strong&gt; There are fewer weird things to document by making the code simpler.&lt;/li&gt;
&lt;li&gt;➢ &lt;strong&gt;Faster debugging.&lt;/strong&gt; By reducing complexity, errors can be found more quickly.&lt;/li&gt;
&lt;li&gt;➢ &lt;strong&gt;Greater economic returns.&lt;/strong&gt; The three effects above allow the initial financial investment in the code created to yield greater returns.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Simplicity is the ultimate sophistication."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  The following principles are based on these two principles.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  SOLID Principles
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;SOLID is an acronym that brings together five key principles for efficient, replicable, maintainable, and scalable software development.&lt;/p&gt;
&lt;h2&gt;
  
  
  S - Single Responsibility Principle (SRP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;“Every class should have a single responsibility: It should have a single purpose in the system, and there should be only one reason to change it.”&lt;/li&gt;
&lt;/ul&gt;


&lt;/blockquote&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Each class should have a single responsibility, a single task that should be applied to classes, components, and microservices. &lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6euy4b33owcov2y1oqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6euy4b33owcov2y1oqi.png" alt="image" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  O - Open/Closed Principle (OCP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;“…code should be open for extension but closed to modification. When we have a good design, we just don’t have to change code much to add new features.”&lt;/li&gt;
&lt;li&gt;A software entity (class) should be open to extension (its functionality can be expanded with external entities) but closed to modification.&lt;/li&gt;
&lt;li&gt;If one of the extensions doesn't work, you can remove it without damaging the original code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg96jkgduc5qlak4n6xpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg96jkgduc5qlak4n6xpw.png" alt="image" width="608" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  L - Liskov Substitution Principle (LSP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;“Objects of subclasses should be substitutable for objects of their superclasses throughout our code.”&lt;/li&gt;
&lt;li&gt;The Liskov Substitution Principle speaks of interfaces: if a software entity uses a class, it should be able to use classes derived from that class.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw8dqle1pntyf3vktuhd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw8dqle1pntyf3vktuhd.png" alt="image" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  I - Interface Segregation Principle (ISP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;“A client-specific interface for a particular set of clients.”&lt;/li&gt;
&lt;li&gt;Instead of one large, common interface, multiple scenario-specific interfaces should be planned to improve decoupling and change management:&lt;/li&gt;
&lt;li&gt;Clients (software entities) that use a software entity (originally a class) should not be forced to depend on methods they don't use. To address this, large interfaces should be segregated, i.e., broken up, into smaller ones.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jcjv9q42y3cuit7qtec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jcjv9q42y3cuit7qtec.png" alt="image" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  D - Dependency Inversion Principle (DIP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;“It is better to depend on interfaces or abstract classes than it is to depend on concrete classes.”&lt;/li&gt;
&lt;li&gt;The Dependency Inversion Principle states that high-level modules, that is, those closest to human ideas of what the software should do, should not depend on low-level modules (those closest to the implementation details for the computer).&lt;/li&gt;
&lt;li&gt;Both should depend on the abstractions of the problem (interfaces). Furthermore, the implementation details should depend on the abstractions as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bx6749dd544eidvfm8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bx6749dd544eidvfm8p.png" alt="image" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2rwgwcu2gfceiuj11dpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2rwgwcu2gfceiuj11dpc.png" alt="image" width="572" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations When Applying the Principles
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;The SOLID Principles can be applied to all phases of object-oriented programming (OOP), as well as to functional programming (FP) and multi-paradigm programming.
However, they should always be applied with proper planning and methodologies. And above all, without excessive rigidity. Excessive rigidity and rigor can make these principles the ultimate goal and hinder the development process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

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

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Design principles are not simply academic rules; they are practical tools that allow you to build quality software in the real world. Applying them reduces long-term development time, improves collaboration between teams, and ensures that your code scales safely.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Code :
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmih6dlosqpsjvbpsqkuj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmih6dlosqpsjvbpsqkuj.png" alt="image" width="764" height="1042"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Application Principle
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SRP The Message class is only responsible for representing a message.&lt;/li&gt;
&lt;li&gt;OCP We can add new delivery types without modifying DeliveryService.&lt;/li&gt;
&lt;li&gt;LSP EmailSend and SMSSend can be used without breaking the system logic.&lt;/li&gt;
&lt;li&gt;ISP The Sender interface defines only what is necessary: send(message).&lt;/li&gt;
&lt;li&gt;DIP DeliveryService depends on an abstraction (Sender), not on concrete classes.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
