Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
🗓 On April 23-24, the 13th ASEAN Regional Forum Open Ended Study Group on Confidence Building Measures to Reduce the Risk of Confict Stemming from the Use ofICTs (13th #ARF OESG) and the 6th ASEAN Regional Forum Inter-Sessional Meeting (#ARF ISM) on ICT Security co-chaired by Russia 🇷🇺 and Indonesia 🇮🇩 was held in Moscow in a hybrid format.
🔹️Delegations of Indonesia 🇮🇩, Singapore 🇸🇬, Thailand 🇹🇭, Cambodia 🇰🇭, the Philippines 🇵🇭, India 🇮🇳 and Bangladesh 🇧🇩 took part in the meeting in person. Chair of the United Nations Open-Ended Working Group on security of and in the use of ICTs 2021-2025, Permanent Representative of the Republic of Singapore to the UN H.E. Mr. Burhanudeen Gafoor🇸🇬 addressed the gathering with his welcoming speech.
🔹️More than 80 participants discussed future plans and cooperation within the framework of the ARF ISM on ICT Security and considered new initiatives proposed by ARF members. The meeting also exchanged views on cooperation on ICT Security-related issues within the framework of the UN and other international platforms.
🤝 On the sidelines of the events a number of bilateral meetings took place.
⚡️Russia's Foreign Minister Sergey Lavrov takes part in the 32th Ministerial Session of the ASEAN Regional Forum (#ARF) on security.
📍 Kuala Lumpur, July 11
🗓 On April 23-24, the 13th ASEAN Regional Forum Open Ended Study Group on Confidence Building Measures to Reduce the Risk of Confict Stemming from the Use ofICTs (13th #ARF OESG) and the 6th ASEAN Regional Forum Inter-Sessional Meeting (#ARF ISM) on ICT Security co-chaired by Russia 🇷🇺 and Indonesia 🇮🇩 was held in Moscow in a hybrid format.
🔹️Delegations of Indonesia 🇮🇩, Singapore 🇸🇬, Thailand 🇹🇭, Cambodia 🇰🇭, the Philippines 🇵🇭, India 🇮🇳 and Bangladesh 🇧🇩 took part in the meeting in person. Chair of the United Nations Open-Ended Working Group on security of and in the use of ICTs 2021-2025, Permanent Representative of the Republic of Singapore to the UN H.E. Mr. Burhanudeen Gafoor🇸🇬 addressed the gathering with his welcoming speech.
🔹️More than 80 participants discussed future plans and cooperation within the framework of the ARF ISM on ICT Security and considered new initiatives proposed by ARF members. The meeting also exchanged views on cooperation on ICT Security-related issues within the framework of the UN and other international platforms.
🤝 On the sidelines of the events a number of bilateral meetings took place.
🗓 On 28 April 2023 the 5th ASEAN Regional Forum Inter-Sessional Meeting (#ARF ISM) on ICT Security co-chaired by Russia 🇷🇺, Indonesia 🇮🇩 and the Republic of Korea 🇰🇷 was held in Moscow in a hybrid format.
🔹️More than 60 participants discussed cooperation on ICT Security-related issues within the framework of the ARF, UN and other international platforms.
🔹️This is the first ARF ISM on ICT Security held in hybrid format since the beginning of the COVID-19 pandemic. On its sidelines a number of bilateral meetings took place.
🗓 On 27 April 2023 the 11th ASEAN Regional Forum Open Ended Study Group on Confidence Building Measures to Reduce the Risk of Confict Stemming from the Use of ICTs (11th #ARF OESG) co-chaired by Russia 🇷🇺, Indonesia 🇮🇩 and the Republic of Korea 🇰🇷 was held in Moscow in a hybrid format to prepare for tomorrow's ARF Inter-Sessional Meeting (ISM) on ICT Security.
Delegates discussed future plans and cooperation within the framework of the ARF ISM on ICT Security and considered new initiatives proposed by ARF participants.
🗓On June 14, Deputy Minister of Foreign Affairs of the Russian Federation Andrey Rudenko 🇷🇺 participated in the ASEAN Regional Forum Senior Officials' Meeting (#ARF SOM) held online under Indonesian Chairmanship 🇮🇩.
🔹Senior officials discussed the progress achieved so far and issues related to preparation for the upcoming ARF Foreign Ministers' Meeting in July in Jakarta, Indonesia 🇮🇩.
🇷🇺 As part of the exchange of views on topical issues in the Asia-Pacific, Russian delegation voiced its approach towards the military-political risks associated with building up a network of minilateral blocs in the region and bringing NATO potential to the East Asia.
☝️ Russia reiterated its position on the maintaining and strengthening the central role of #ASEAN in regional affairs based on ASEAN-led platforms of multilateral cooperation.
🤝 Russia’s Foreign Minister Sergey Lavrov takes part in the 31th session of the ASEAN Regional Forum (#ARF) on security.
📍Vientiane, July 27, 2024
#RussiaASEAN
🗓 On June 10-11, Deputy Minister of Foreign Affairs of the Russian Federation Andrey Rudenko🇷🇺 participated in the East Asia Summit Senior Officials' Meeting (#EAS SOM) and ASEAN Regional Forum Senior Officials' Meeting (#ARF SOM) in Penang, Malaysia 🇲🇾.
🔹️Senior officials discussed issues related to preparation for the EAS Summit and EAS and ARF Foreign Ministers' Meetings later this year.
🇷🇺 The Russian Side emphasized the importance of continuing joint efforts in key areas of cooperation within the ARF and the EAS, including implementation of the leaders' decisions on launching Regional Mechanism of Emerging Infectious Diseases Prevention and Control and establishing interaction among the EAS Participating States on tourism. Russia introduced new initiatives as well – proposal to add issues of socio-cultural connectivity to the EAS agenda and increase of capacity building in the field of countering the use of ICT for criminal purposes within the framework of ARF.
🔹️ As part of the exchange of views on topical issues in the Asia-Pacific, Russian delegation voiced its approach towards the military-political risks associated with building up a network of minilateral blocs of high conflict potential in the region and bringing NATO potential to the East Asia.
☝️ Russia reiterated its position on the maintaining and strengthening the central role of ASEAN in regional affairs based on ASEAN-led platforms of multilateral cooperation such as EAS, ARF and ADMM-Plus as well as developing the platforms towards building an architecture of equal and indivisible security in the Asia-Pacific region.
#EAS#ARF
🗓 On June 7-8, Russia's Alternate SOM Leader, Director-General of the Department of Asian and Pacific Cooperation of the Russian MFA Mr. Alexey Ovchinnikov🇷🇺 participated in the East Asia Summit Senior Officials' Meeting (#EAS SOM) and ASEAN Regional Forum Senior Officials' Meeting (#ARF SOM) in Vientiane, Lao PDR 🇱🇦.
🔹️Senior officials discussed issues related to preparation for the EAS Summit and EAS and ARF Foreign Ministers' Meetings later this year.
🇷🇺 The Russian Side emphasized the importance of continuing joint efforts in key areas of cooperation within the ARF and the EAS including implementation of the leaders' decisions on launching Regional Mechanism of Emerging Infectious Diseases Prevention and Control as well as establishing interaction among the EAS Participating States on tourism.
🔹️As part of the exchange of views on topical issues in the Asia-Pacific, Russian delegation voiced its approach towards the military-political risks associated with building up a network of minilateral blocs of high conflict potential in the region and bringing NATO potential to the East Asia.
☝️ Russia reiterated its position on the maintaining and strengthening the central role of ASEAN in regional affairs based on ASEAN-led platforms of multilateral cooperation such as EAS, ARF and ADMM-Plus.
#EAS#ARF
🗓 On June 7-8, Russia's Alternate SOM Leader, Director-General of the Department of Asian and Pacific Cooperation of the Russian MFA Mr. Alexey Ovchinnikov🇷🇺 participated in the East Asia Summit Senior Officials' Meeting (#EAS SOM) and ASEAN Regional Forum Senior Officials' Meeting (#ARF SOM) in Vientiane, Lao PDR 🇱🇦.
🔹️Senior officials discussed issues related to preparation for the EAS Summit and EAS and ARF Foreign Ministers' Meetings later this year.
🇷🇺 The Russian Side emphasized the importance of continuing joint efforts in key areas of cooperation within the ARF and the EAS including implementation of the leaders' decisions on launching Regional Mechanism of Emerging Infectious Diseases Prevention and Control as well as establishing interaction among the EAS Participating States on tourism.
🔹️As part of the exchange of views on topical issues in the Asia-Pacific, Russian delegation voiced its approach towards the military-political risks associated with building up a network of minilateral blocs of high conflict potential in the region and bringing NATO potential to the East Asia.
☝️ Russia reiterated its position on the maintaining and strengthening the central role of ASEAN in regional affairs based on ASEAN-led platforms of multilateral cooperation such as EAS, ARF and ADMM-Plus.
#EAS#ARF
🎙 Russia's Foreign Minister Sergey Lavrov’s answers to media questions following his visit to Malaysia
📍Kuala Lumpur, July 28, 2024
❓Question: The US has been obsessively trying to create another training ground out of countries in the southeast. Is it relevant to say that cooperation between Russia and Asia can help the region maintain its sovereignty?
💬Sergey Lavrov: Of course. I think we had a chance to see it for ourselves yesterday and the day before in Laos during the East Asia Summit (#EAS) and the ASEAN Regional Forum (#ARF).
Russia is seen as a balancing and stabilising factor in the context of countering the extremely sharp-elbowed actions by the countries outside the region, led by the US, who push their military infrastructure, including strategic arms. <...>
Our balanced and clear stance always comes from the need to create platforms for negotiations and to agree on the basis of a balance of interests. This stance receives respect. Certainly, in contrast to the invasive and aggressive course of the US and NATO for military development of the region, our stance is closer to our #ASEAN friends.
❓Question: Last night saw another escalation in the Middle East, namely a missile attack on a football ground in the Israeli-occupied Golan Heights in which mostly children and teenagers were killed and injured. Israel has accused Lebanon, while Lebanon has put the blame on Israel. What is the likelihood of an all-out war between Israel and Lebanon? What could be done to prevent further bloodshed?
💬Sergey Lavrov: So far, we do not see any possibility of stopping the bloodshed. In response to numerous calls for a ceasefire, Israeli Prime Minister Benjamin Netanyahu has stated that Israel will not stop until it destroys Hamas completely. I believe, and many of my colleagues share this view, that the destruction of that organisation, which has significant capabilities and enjoys broad support, including in the Muslim world, is an unrealistic task.
Russia condemns all terrorist attacks committed by any group. We condemned Hamas’s terrorist attack on Israeli civilians on October 7, 2023. But Israel’s retaliatory actions have been unacceptable. They are a flagrant violation of international humanitarian law and amount to collective punishment of people, which international conventions prohibit. <...>
I am sure that the main condition for a lasting solution to the Middle East crisis is the fulfilment of the UN Security Council resolution on the establishment of a Palestinian state as soon as possible. This cannot be achieved without restoring Palestinian unity so that the Palestinians themselves can determine the format of negotiations regarding their life in a sovereign state. This goal has not yet been achieved. Efforts must continue towards this end.
Read in full
🎙 Russia's Foreign Minister Sergey Lavrov’s answers to media questions following his visit to Malaysia
📍Kuala Lumpur, July 28, 2024
❓Question: The US has been obsessively trying to create another training ground out of countries in the southeast. Is it relevant to say that cooperation between Russia and Asia can help the region maintain its sovereignty?
💬Sergey Lavrov: Of course. I think we had a chance to see it for ourselves yesterday and the day before in Laos during the East Asia Summit (#EAS) and the ASEAN Regional Forum (#ARF).
Russia is seen as a balancing and stabilising factor in the context of countering the extremely sharp-elbowed actions by the countries outside the region, led by the US, who push their military infrastructure, including strategic arms. <...>
Our balanced and clear stance always comes from the need to create platforms for negotiations and to agree on the basis of a balance of interests. This stance receives respect. Certainly, in contrast to the invasive and aggressive course of the US and NATO for military development of the region, our stance is closer to our #ASEAN friends.
❓Question: Last night saw another escalation in the Middle East, namely a missile attack on a football ground in the Israeli-occupied Golan Heights in which mostly children and teenagers were killed and injured. Israel has accused Lebanon, while Lebanon has put the blame on Israel. What is the likelihood of an all-out war between Israel and Lebanon? What could be done to prevent further bloodshed?
💬Sergey Lavrov: So far, we do not see any possibility of stopping the bloodshed. In response to numerous calls for a ceasefire, Israeli Prime Minister Benjamin Netanyahu has stated that Israel will not stop until it destroys Hamas completely. I believe, and many of my colleagues share this view, that the destruction of that organisation, which has significant capabilities and enjoys broad support, including in the Muslim world, is an unrealistic task.
Russia condemns all terrorist attacks committed by any group. We condemned Hamas’s terrorist attack on Israeli civilians on October 7, 2023. But Israel’s retaliatory actions have been unacceptable. They are a flagrant violation of international humanitarian law and amount to collective punishment of people, which international conventions prohibit. <...>
I am sure that the main condition for a lasting solution to the Middle East crisis is the fulfilment of the UN Security Council resolution on the establishment of a Palestinian state as soon as possible. This cannot be achieved without restoring Palestinian unity so that the Palestinians themselves can determine the format of negotiations regarding their life in a sovereign state. This goal has not yet been achieved. Efforts must continue towards this end.
Read in full