Evgenii Legotckoi
Evgenii LegotckoiSept. 18, 2018, 5:11 a.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, 4:01 a.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, 9:47 a.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, 7:48 a.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, 5:37 a.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. 16, 2018, 2:25 p.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, 3:35 a.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, 8:03 a.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, 6:12 a.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, 6:01 a.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, 4:29 a.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, 3:10 a.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
AD

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:50points,
  • Rating points-4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:80points,
  • Rating points4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:20points,
  • Rating points-10
Last comments
ИМ
Игорь МаксимовNov. 22, 2024, 11:51 a.m.
Django - Tutorial 017. Customize the login page to Django Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
Evgenii Legotckoi
Evgenii LegotckoiOct. 31, 2024, 2:37 p.m.
Django - Lesson 064. How to write a Python Markdown extension Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
A
ALO1ZEOct. 19, 2024, 8:19 a.m.
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Игорь МаксимовOct. 5, 2024, 7:51 a.m.
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
d
dblas5July 5, 2024, 11:02 a.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
Now discuss on the forum
m
moogoNov. 22, 2024, 7:17 a.m.
Mosquito Spray System Effective Mosquito Systems for Backyard | Eco-Friendly Misting Control Device & Repellent Spray - Moogo ; Upgrade your backyard with our mosquito-repellent device! Our misters conce…
Evgenii Legotckoi
Evgenii LegotckoiJune 24, 2024, 3:11 p.m.
добавить qlineseries в функции Я тут. Работы оень много. Отправил его в бан.
t
tonypeachey1Nov. 15, 2024, 6:04 a.m.
google domain [url=https://google.com/]domain[/url] domain [http://www.example.com link title]
NSProject
NSProjectJune 4, 2022, 3:49 a.m.
Всё ещё разбираюсь с кешем. В следствии прочтения данной статьи. Я принял для себя решение сделать кеширование свойств менеджера модели LikeDislike. И так как установка evileg_core для меня не была возможна, ибо он писался…

Follow us in social networks