Evgenii Legotckoi
Evgenii LegotckoiSept. 18, 2018, 3:11 p.m.

DelphiExample - 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 18, 2018, 2:01 p.m.

Design PatternsGenerative 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 17, 2018, 7:47 p.m.

JavaExample - Abstract Factory in Java

abstract, 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 …
Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 17, 2018, 5:48 p.m.

PHPExample - Abstract Factory in PHP

abstract, PHP

An example of a design pattern An abstract factory in PHP


<?php
/*
 *  Abstract Factory classes
 */

abstract class DB_Abstraction_Factory {
    protected $settings = array();
    protected function __construct() {
        $this->settings = Settings::getInstance();
    }

    abstract public function createInstance();
}

class …
Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 17, 2018, 3:37 p.m.

Design PatternsGenerative 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 17, 2018, 12:25 a.m.

EVILEGAdding initial support for photos and photo albums

EVILEG, Развитие

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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 14, 2018, 1:35 p.m.

Design PatternsGenerative 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 13, 2018, 6:03 p.m.

PythonExample - Abstract Factory in Python

abstract, factory, abc, python

An example of an abstract factory in the Python programming language


"""
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 …
Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 13, 2018, 4:12 p.m.

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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 13, 2018, 4:01 p.m.

Design PatternsGenerative 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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiAug. 9, 2018, 2:29 p.m.

LinuxBash script for creating and downloading a dump of a database and media files from a remote server

Bash, rsync, Linux

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 …

Read
Evgenii Legotckoi
Evgenii LegotckoiAug. 7, 2018, 1:10 p.m.

LinuxCounting the number of commits for authors in Git

Git, Fun, Linux

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
Ua

Qt - Test 001. Signals and slots

  • Result:84points,
  • Rating points4
Ua

Qt - Test 001. Signals and slots

  • Result:42points,
  • Rating points-8
ОК

Qt - Test 001. Signals and slots

  • Result:47points,
  • Rating points-6
Last comments
ИМ
Игорь МаксимовNov. 22, 2024, 9:51 p.m.
Django - Tutorial 017. Customize the login page to Django Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
Evgenii Legotckoi
Evgenii LegotckoiOct. 31, 2024, 11:37 p.m.
Django - Lesson 064. How to write a Python Markdown extension Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
A
ALO1ZEOct. 19, 2024, 5:19 p.m.
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Игорь МаксимовOct. 5, 2024, 4:51 p.m.
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
d
dblas5July 5, 2024, 8:02 p.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
Now discuss on the forum
f
firstlunoxodFeb. 15, 2025, 1:46 p.m.
Рисование на QGraphicsScene при зажатой кнопке мыши Подскажите, пожалуйста! Как данный класс можно дополнить, чтобы созданные объекты можно было перемещать мышкой по сцене?
Дмитрий
ДмитрийFeb. 3, 2025, 4:24 p.m.
Создание deb-пакета. Как создать ярлык на рабочем столе после установки собственного deb-пакета? Всем привет. Сделал свой deb-пакет с программой. Всё устанавливается и работает. Ставлю по пути /usr/bin/my_application. Как для пользователя при установке пакета сразу создать ярлык на раб…
NW
Nayo WaiJan. 30, 2025, 7:22 p.m.
не запускается компьютер!!! Не запускается компьютер (точнее работает блок , но сам монитор вообще жесть)В общем я ничего с интернета не скачивала в последнее время. На компе никаких левых пр…
n
nklyJan. 3, 2025, 12:52 p.m.
Нужно запретить перемещение только некоторых итемов, остальные перемещать можно. Вопрос решен. Узнать QModelIndex элемента на который мы перетаскиваем другой элемент, можно с помощью функции indexAt(event->position().toPoint()) представления QTreeViev вызываемой в переопр…
M
MarselAug. 17, 2023, 12:26 a.m.
OAuth2.0 через VK, получение email Спасибо большое за помощь и простите за то что отнял время своей невнимательностью.

Follow us in social networks