Delphi → Example - Abstract Factory in Delphi
abstract, шаблоны проектирования, Delphi
This pattern is ideal where you want to isolate your application from the implementation of the concrete classes. For example if you wanted to overlay Delphi's VCL with a common VCL layer for both 16 and 32 bit applications, you …
ReadDesign Patterns → Generative Design Patterns - Object Pool
шаблоны проектирования, object, pool
Goals
Object pooling can greatly improve performance; it is most effective in situations where the cost of initializing an instance of a class is high and the rate of instantiation of the class is high, while the number of instances …
ReadJava → Example - Abstract Factory in Java
Abstract Factory classes are often implemented with Factory Methods, but they can also be implemented using Prototype. Abstract Factory might store a set of Prototypes from which to clone and return product objects.
- Factory Method: creation through inheritance.
- Prototype: creation …
PHP → Example - Abstract Factory in PHP
An example of a design pattern An abstract factory in PHP
Read<?php /* * Abstract Factory classes */ abstract class DB_Abstraction_Factory { protected $settings = array(); protected function __construct() { $this->settings = Settings::getInstance(); } abstract public function createInstance(); } class …
Design Patterns → Generative Design Patterns - Factory Method
шаблоны проектирования, abstract, cpp
Goals
- We define an interface for creating an object, but let the subclasses decide which class to create. A factory method allows you to instantiate a class for subclasses.
- Definition of a "virtual" constructor.
- The new operator is harmful.
Problems …
ReadEVILEG → Adding initial support for photos and photo albums
The weekend was not in vain. For a couple of days, I managed to write enough functional support for uploading photos through the WYSIWYG website editor. What I would like to inform the users of the site in the form …
ReadDesign Patterns → Generative Design Patterns - Builder
Builder, шаблоны проектирования, Строитель
The reasons
- Separating the construction of a complex object from its representation so that the same construction process can create different representations.
- Dismantling a complex representation, creating one goal from several variations.
Problems
Separation of the object interpretation algorithm (for …
ReadPython → Example - Abstract Factory in Python
abstract, factory, abc, python
An example of an abstract factory in the Python programming language
Read""" Provide an interface for creating families of related or dependent objects without specifying their concrete classes. """ import abc class AbstractFactory(metaclass=abc.ABCMeta): """ Declare an interface for operations that …
C++ → Example - Abstract Factory in C ++
cpp, шаблоны проектирования, abstract, new
Discussion. "Think of object creation as a factory that spawns those same objects."
Here we assign object creation responsibilities to the factory object, and then use inheritance functions and virtual members to provide a "virtual constructor" capability. So there are …
ReadDesign Patterns → Generative Design Patterns - Abstract Factory
шаблоны проектирования, абстрактная, abstract, new, фабрика
The reasons
- Providing an interface for creating families of related or dependent objects without specifying their specific classes.
- Hierarchy that encapsulates: many possible "platforms" and building a set of "products".
- The new operator is considered harmful.
Problems
If an application …
ReadLinux → Bash script for creating and downloading a dump of a database and media files from a remote server
During the development of the site on Django had to start to understand the Bash scripts to automate routine tasks. For example, creating and downloading a database dump from a site, as well as reserving media files.
We assume that …
ReadLinux → Counting the number of commits for authors in Git
Just for fun.
What can programmers measure? Of course, with their commits, at least their number in the Git repository.
To do this, you can use the git shortlog command, which summarizes the output of git log, providing a more …
Read- Akiv Doros
- Nov. 11, 2024, 2:58 p.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:50points,
- Rating points-4
- molni99
- Oct. 26, 2024, 1:37 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:80points,
- Rating points4
- molni99
- Oct. 26, 2024, 1:29 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:20points,
- Rating points-10