beroca / shell

shell
0 stars 0 forks source link

twitter.com / Do You Need to Know All Design Patterns ? #10

Open beroca opened 11 months ago

beroca commented 11 months ago

https://twitter.com/milan_milanovic/status/1681184239629266944

The answer is no. Even though we have 23 design patterns, around ten are mostly used in everyday development. Knowing which patterns exist overall is good, but you need to know these very well.

Design patterns can be divided into three main types:

๐Ÿญ. ๐—–๐—ฟ๐—ฒ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€

These design patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.

Important patterns in this group are:

๐Ÿ”น๐—™๐—ฎ๐—ฐ๐˜๐—ผ๐—ฟ๐˜†: This pattern allows delegating the instantiation logic to factory classes. The Factory Method creates objects without exposing the instantiation logic to the client.

๐Ÿ”น๐—ฆ๐—ถ๐—ป๐—ด๐—น๐—ฒ๐˜๐—ผ๐—ป: The Singleton pattern ensures that a class has only one instance and provides a global point of access to it. It's useful when exactly one object is needed to coordinate actions across the system.

๐Ÿฎ. ๐—ฆ๐˜๐—ฟ๐˜‚๐—ฐ๐˜๐˜‚๐—ฟ๐—ฎ๐—น ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€

These patterns deal with the composition of classes and objects which form larger structures.

Important patterns in this group are:

๐Ÿ”น๐—”๐—ฑ๐—ฎ๐—ฝ๐˜๐—ฒ๐—ฟ: This pattern works as a bridge between two incompatible interfaces. It wraps an existing class with a new interface to become compatible with the client's interface.

๐Ÿ”น๐—™๐—ฎ๐—ฐ๐—ฎ๐—ฑ๐—ฒ: The Faรงade pattern provides a unified interface to a set of interfaces in a subsystem. Faรงade defines a higher-level interface that makes the subsystem easier to use.

๐Ÿ”น๐——๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ: This pattern dynamically adds/overrides behavior in an existing method of an object. This pattern provides a flexible alternative to subclassing for extending functionality.

๐Ÿ”น๐—ฃ๐—ฟ๐—ผ๐˜…๐˜†: The Proxy pattern provides a surrogate or placeholder for another object to control access to it. In its most general form, a proxy is a class functioning as an interface to something else.

๐Ÿฏ. ๐—•๐—ฒ๐—ต๐—ฎ๐˜ƒ๐—ถ๐—ผ๐—ฟ๐—ฎ๐—น ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€

These patterns are specifically concerned with communication between objects and how they interact and distribute work.

Important patterns in this group are:

๐Ÿ”น๐—–๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ: The Command pattern encapsulates a request as an object, thus allowing users to parameterize clients with queues, requests, and operations.

๐Ÿ”น๐—ง๐—ฒ๐—บ๐—ฝ๐—น๐—ฎ๐˜๐—ฒ ๐— ๐—ฒ๐˜๐—ต๐—ผ๐—ฑ: This pattern defines the program skeleton of an algorithm in a method called template method, which defers some steps to subclasses.

๐Ÿ”น๐—ฆ๐˜๐—ฟ๐—ฎ๐˜๐—ฒ๐—ด๐˜†: The Strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

๐Ÿ”น๐—ข๐—ฏ๐˜€๐—ฒ๐—ฟ๐˜ƒ๐—ฒ๐—ฟ: This pattern defines a one-to-many dependency between objects so that all its dependents are notified and updated automatically when one object changes state.

#technology #softwareengineering #programming #techworldwithmilan #developers

beroca commented 11 months ago

image