[JEU] @JLRecrutement est sponsor de la soirรฉe communautaire de l'#APIPlatformCon 2024 ! ร cette occasion, nous vous offrons l'opportunitรฉ de remporter une place pour assister ร ces deux jours de confรฉrences ๐คฉ. Pour participer, follow et RT ce post, tirage au sort vendredi !
@JPansart
๐ช๐ต๐ฒ๐ป ๐๐ผ ๐๐ฒ๐น๐ฒ๐ฐ๐ ๐๐ฒ๐๐ถ๐ด๐ป ๐ฃ๐ฎ๐๐๐ฒ๐ฟ๐ป?
Choosing the correct design pattern in software engineering is critical to practical problem-solving. This guide simplifies the process, helping you decide between patterns based on specific needs. It offers concise descriptions and valuable use cases for each pattern, making understanding and applying them in real-world scenarios easier.
To select a pattern, we must first go through the problem identification. If the problem is related to:
๐ธ Object Creation? โ Creational Patterns
๐ธ Object Assembly? โ Structural Patterns
๐ธ Object Interactions? โ Behavioral Patterns
So, let's dive in.
๐ญ. ๐๐ฟ๐ฒ๐ฎ๐๐ถ๐ผ๐ป๐ฎ๐น ๐ฃ๐ฎ๐๐๐ฒ๐ฟ๐ป๐
๐น Singleton: Use when a single instance of a class is needed. Some examples are logging and database connections.
๐น Factory Method: Decouple object creation from usage. For example, you create different types of database connections based on configuration.
๐น Abstract Factory: Create families of related objects. For example, I build parsers for different file formats (e.g., JSON, XML, CSV).
๐น Builder: Constructing complex objects step by step. For example, if you need to create a complex domain object.
๐น Prototype: Creating duplicate objects and reusing cached objects to reduce database calls.
๐ฎ. ๐ฆ๐๐ฟ๐๐ฐ๐๐๐ฟ๐ฎ๐น ๐ฃ๐ฎ๐๐๐ฒ๐ฟ๐ป๐
๐น Adapter: Make incompatible interfaces compatible. For example, it integrates a new logging library into an existing system that expects a different interface.
๐น Composite: Represent part-whole hierarchies. For example, graphic objects in a drawing application can be grouped and treated uniformly
๐น Proxy: Control access to objects. For example, lazy loading of a high-resolution image in a web application.
๐น Decorator: Dynamically add/remove behavior. For example, we are implementing compression or encryption on top of file streams.
๐น Bridge: Decouple abstraction from implementation. For example, I am separating platform-specific code from core logic.
๐ฏ. ๐๐ฒ๐ต๐ฎ๐๐ถ๐ผ๐ฟ๐ฎ๐น ๐ฃ๐ฎ๐๐๐ฒ๐ฟ๐ป๐
๐น Strategy: Define a family of algorithms. For example, they allow users to choose different sorting or compression algorithms.
๐น Observer: Maintain a consistent state by being notified of changes and, for example, notifying subscribers of events in a messaging system.
๐น Command: Encapsulate a request as an object. For example, I implement undo/redo functionality in text or image editor.
๐น State: Encapsulate state-specific behavior. For example, we are handling different states of a user interface element (e.g., enabled, disabled, selected).
๐น Template Method: Define the skeleton of an algorithm in operation, deferring some steps to subclasses and implementing a base class for unit testing with customizable setup and teardown steps.
Ultimately, we came up with the pattern we needed for our problem.
#softwaredesign #designpatterns
We've been discussing the future of PECL and its website โ the current tools for installing PHP extensions.
The code is old and hard to maintain. And we want to bring a more modern method of installing things.
๐ @derickr is kicking off with a requirements document:
Beaucoup de monde pour la confรฉrence de Loris Guemart, rรฉdacteur en chef de Arrรชt sur Images, au Forum PHP 2023 ๐
Une confรฉrence ร retrouver en replay dans quelques semaines sur notre chaรฎne YouTube.
Dites @payplug et @GroupeBPCE Nous approchons 7h de panne totale des acquisitions de paiement CB en raison de votre choix de travailler avec GCP, sans redondance. Vous nโavez aucun PCA ? Cโest des stagiaires ร la gouvernance IT et conformitรฉ chez vous ? Vous plaisantez jโespรจre.
Entre ceux qui jugent les adminSys hackรฉs sur leurs VMware et ceux qui jugent les devs n'ayant pas de processus CI/CD, vous me fatiguez.
Vous ne connaissez pas le contexte dans lesquels nos consลurs et confrรจres travaillent.
โ L'idรฉal n'existe pas, chacun fait de son mieux โ ๐