Закрыть
×
=0) { let js = text.slice(pos1, pos2); + '<\/' + "script" + '>'; arrText.push(js); // next pos1 = pos2; continue; } } } break; } return arrText; } function OpenDialog(parentDiv, urlContent) { parentDiv = document.getElementById('modal-background'); // new !!!!!!! parentDiv.appendChild(document.getElementById('modal-template')); document.getElementById('modal-background').style.display = "flex"; // !!!!! block document.getElementById('modal-template').style.display = "flex"; // !!!!! document.getElementById('modal-body').innerHTML = ""; post_url(urlContent, "", function(text_from_server) { var element = document.getElementById('modal-body'); element.innerHTML = text_from_server; // add scripts var arrJSText = get_scripts(text_from_server); for (var i=0; i
dir.by
Праздники ...
Праздники ...
Рождество (Католическое) 25 Декабря
Концерты, выставки ...
Концерты, выставки ...
Спектакль "Чудики"|||г. Минск 15 сентября, 26 сентября, 18 октября, 29 октября, 18 ноября 2026
Афишу
Спорт занятия ...
Спорт занятия ...
Занятия в тренажерном зале
Спорт занятие
Компьютер, программы...
Компьютер, программы...
Объявления ...
Объявления ...
Услуги логопеда - дефектолога, детского психолога
Объявление
Новости ...
Новости ...
Форум ...
Форум ...
обсуждение...
<<
Поиск >>
Поиск
Концерты
Спорт
Форум
Компьютер
Компьютер, программы
→
Patterns, Design Patterns | OOP Principles | Code refactoring
Одиночка (Singleton) это порождающий шаблон проектирования
посмотрели
4124
раз
обновлено: 30 March 2021
Одиночка
это паттерн, который гарантирует, что для определенного класса будет создан только один объект.
Пример
C#
class
AppVersion
{
private
static
AppVersion
_instance;
private
AppVersion
()
{}
public
static
AppVersion
getInstance()
{
if
(_instance == null)
_instance =
new
AppVersion
();
return
_instance;
}
}
← Previous topic
The Abstract Factory is a generative design pattern
Next topic →
Prototype is a generative design pattern
Your feedback ... Comments ...
Your Name
Your comment
(www links can only be added by a logged-in user)
+ Picture
Новость
"Черная пятница" Dreame в Беларуси – две недели скидок до 3400 рублей
Introduction
•
What is a subclass or child class or descendant of a class? What is a parent class?
Principles of OOP
•
What is Object-Oriented Programming? Principles: abstraction, encapsulation, inheritance, polymorphism
Code refactoring
•
What is code refactoring?
Design patterns
Generative patterns
•
The Factory Method is a generative design pattern
•
The Abstract Factory is a generative design pattern
•
Singleton is a generative design pattern
•
Prototype is a generative design pattern
•
The Builder is the generative design pattern
<BR>
Patterns of behavior
•
Strategy is a behavioral design pattern
S.O.L.I.D. (5 principles of program design)
•
What is SOLID?
•
Single Responsibility Principle SOLID Design
•
Open/Closed Principle SOLID Design
Ваши вопросы присылайте по почте:
info@dir.by