Python → Example - Factory method in Python
шаблоны проектирования, factory, Python, method
An example of a factory method in the Python programming language
Read""" Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. """ import abc class …
Java → Example - Factory Method in Java
шаблоны проектирования, factory, method, Java, JAVA
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done …
ReadC++ → Example - Factory method in C++
шаблоны проектирования, factory, method, C++
Discussion. Frameworks are applications (or subsystems) with "holes" in them. Each framework specifies the infrastructure, superstructure, and flow of control for its "domain", and the client of the framework may: exercise the framework's default behavior "as is", extend selected pieces …
ReadDesign Patterns → Structural Design Patterns - Bridge
шаблоны проектирования, Bridge, мост
Goals
- Separate the abstraction from its implementation so that they can change independently of each other.
- Create a public interface in an inheritance hierarchy and implement it in your own inheritance hierarchy.
- In addition to encapsulation, the use of isolation …
Projects based on Qt → Reader fb2-files on Qt Creator
reader, читалка, fb2-читалка, html, fb2-reader, fb2
Some time ago I wrote an article in which I showed how to open a fb2 file with Qt tools. After some time, I noticed a number of shortcomings in it, which I decided to eliminate. Moreover, I found that …
ReadDesign Patterns → Structural Design Patterns - Adapter
adapter, шаблоны проектирования
Goals
- Converting a class interface to another interface. An adapter allows classes to work together that might otherwise be due to incompatible class interfaces.
- Wrapping an existing class in a new interface
- Compliance of the old component with the new …
PHP → Example - "Builder" design pattern in PHP
PHP, шаблоны проектирования, Строитель, Builder
In the Builder Pattern a director and a builder work together to build an object. The director controls the building and specifies what parts and variations will go into an object. The builder knows how to assemble the object given …
ReadDelphi → Example - "Builder" design pattern in Delhpi
Builder, Delphi, Строитель, шаблоны проектирования
The functionality used in Delphi's VCL to create forms and components is similar in concept to the builder. Delphi creates forms using a common interface, through Application.CreateForm and through the TForm class constructor. TForm implements a common constructor using the …
ReadDesign Patterns → Generative Design Patterns - Singleton
шаблоны проектирования, Синглетон, singleton
Goals
- Make sure the class has only one instance and provides a global access point to it.
- Encapsulated "initialization at a certain point in time" or "initialization on first use".
Problems
An application needs one and only one object instance. …
Read- Unknown akadamn
- Jan. 24, 2025, 6:14 p.m.
Qt - Test 001. Signals and slots
- Result:84points,
- Rating points4
- Unknown akadamn
- Jan. 24, 2025, 5:22 p.m.
Qt - Test 001. Signals and slots
- Result:42points,
- Rating points-8