Evgenii Legotckoi
Sept. 19, 2018, 8:27 p.m.

Design PatternsGenerative Design Patterns - Prototype

Prototype, шаблоны проектирования, Прототип, abstract

Goals

  • Specify the types of objects to create using the prototype instance and create new objects by copying this prototype.
  • Create one instance of the class to use as the source for all future instances.
  • The new operator is considered …
Read
Evgenii Legotckoi
Sept. 18, 2018, 4:06 p.m.

PythonExample - "Builder" design pattern in Python

Строитель, Python, Builder, шаблоны проектирования

Example of "Builder" desnig pattern in Python


  1. """
  2. Separate the construction of a complex object from its representation so
  3. that the same construction process can create different representations.
  4. """
  5.  
  6. import abc
  7.  
  8.  
  9. class Director:
  10. """
  11. Construct an object using the Builder …
Read
Evgenii Legotckoi
Sept. 18, 2018, 3:44 p.m.

C++Example - "Builder" design pattern in C++

cpp, Builder, Строитель, шаблоны проектирования

Discussion. The forte of Builder is constructing a complex object step by step. An abstract base class declares the standard construction process, and concrete derived classes define the appropriate implementation for each step of the process. In this example, "distributed …

Read
Evgenii Legotckoi
Sept. 18, 2018, 3:20 p.m.

JavaExample - "Builder" design pattern in Java

Java, шаблоны проектирования, Builder

Example of "Builder" design pattern in Java


  1. /* "Product" */
  2. class Pizza {
  3. private String dough = "";
  4. private String sauce = "";
  5. private String topping = "";
  6.  
  7. public void setDough(String dough) {
  8. this.dough = dough;
  9. }
  10.  
  11. public void setSauce(String
Read
Evgenii Legotckoi
Sept. 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
Sept. 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
Sept. 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
Sept. 17, 2018, 5:48 p.m.

PHPExample - Abstract Factory in PHP

abstract, PHP

An example of a design pattern An abstract factory in PHP


  1. <?php
  2. /*
  3. * Abstract Factory classes
  4. */
  5.  
  6. abstract class DB_Abstraction_Factory {
  7. protected $settings = array();
  8. protected function __construct() {
  9. $this->settings = Settings::getInstance();
  10. }
  11.  
  12. abstract public function createInstance();
  13. }
  14.  
  15. class
Read
Evgenii Legotckoi
Sept. 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
Sept. 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
  • Last comments
  • ИМ
    Nov. 22, 2024, 9:51 p.m.
    Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
  • Evgenii Legotckoi
    Oct. 31, 2024, 11:37 p.m.
    Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
  • A
    Oct. 19, 2024, 5:19 p.m.
    Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
  • ИМ
    Oct. 5, 2024, 4:51 p.m.
    Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
  • d
    July 5, 2024, 8:02 p.m.
    Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…