Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
🥊 Listing $DFC on Bitget — is it worth buying a token?
$DFC is the main token of the Definer ecosystem on the TON blockchain with more than 100 services on one platform. At the moment, the project has the largest community on the blockchain — more than 450k people, and the token itself is trading at a price of $3.14 on MEXC, is in the top projects on TVL and in the top 500 projects on CoinMarketCap.
Often, at the start of the listing, you can catch the best entry point and pick up the icons in the future.
🔍 Several reasons why you should look at buying $DFC:
1. The $DFC token is listed on MEXC and added to the telegram @wallet wallet. This means that new users coming to the $TON ecosystem see it. And this gives an even greater boost to the price and potential x's.
2. More than 25,000 active DFC wallets. The distribution of DFC on holders' wallets indicates the interest of whales.
3. The project and the token have direct support from $TON, Binance Labs and #DWF, the largest players in the ecosystem pumping market.
4. Capitalization is only $ 80 million, there is room to grow, cap #PEPE is $ 3 billion.
In addition, the Token2049 conference is approaching, where Durov will speak. This means that $TON and all the projects around it will get a big boost.🔥
Bidask Protocol — New DEX on TONand a Giveaway💵33,000
🅱️Bidask launched in mainnet just a few days ago — before that, the exchange was in the testnet for almost three months. The team claims that their swap model is faster, cheaper and more efficient than its analogues. Practice confirms: exchanges are instantaneous, and the 10-15 sec delay is just the time it takes for the wallet to pick up the transaction. Further optimization is already on the TonCore side.
💰The seed investor is DWF Labs (market maker and validator #TON). For a young project, this is a serious resource — #DWF is building its own ecosystem and strengthening the platforms it is a part of.
#Bidask — partner 🌑#TONFest. The festival will feature a raffle 💵 33,000, and you only need to complete three tasks:
✔️Make $10 swaps
✔️Provide $10 to liquidity pools
✔️Provide $20 to liquidity pools (first $10 does not count). Your $20 is locked in the pool until June 30, 2025.
We recommend the $TON/$USDT pairand be sure to follow the buttons inside TON Fest — otherwise the quest will not be counted.
Bidask DEX | Channel
🚀 DWF Labs Founder Predicts Older Coins Unlikely to Reach All-Time Highs
DWF Labs founder Andrei Grachev has expressed skepticism about the potential for older cryptocurrencies to achieve their previous all-time highs. According to NS3.AI, Grachev noted that while the market dynamics have evolved, many of these older projects have not adapted accordingly. This observation suggests a challenging future for legacy cryptocurrencies in the rapidly changing digital asset landscape.
#DWF Labs #Andrei Grachev #cryptocurrencies#all-time highs #NS3.AI #legacy cryptocurrencies #digital assets
The first HACK-A-TON by The Open Network (TON) in South Korea has just started! 🔥
Super excited to be one of their main sponsors 🚀🫡
Pop by to meet up with us, or any rep from BoomLabs, Ozys, and TAV (The Open Network, Alphanonce, VistaLabs).
Address: B1, 126, Teheran-ro, Gangnam-gu, Seoul, Republic of Korea
주소: 서울 강남구 테헤란로 126 B1 수호아이오
KR page: https://lnkd.in/g9e-eDtb
EN page: https://lnkd.in/gpsPXMWG
#dwf#TheOpenNetwork#TON#Telegram#Hackathon#Seoul#Boomlabs#Ozys#TAV#Alphanonce#Vistalabs
🚀 Market Conditions Present Opportunities for Strategic Investments, Says DWF Labs Co-Founder
The cryptocurrency market is currently experiencing a "very boring" phase, according to ChainCatcher. DWF Labs Co-Founder Andrei Grachev expressed on social media that while participants may engage in discussions or humor, significant activities such as financing, trading, investing, and business expansion are quietly underway.
Grachev noted that the current market environment poses challenges for major projects, exchanges, and companies to make new listings or significant announcements, as high-profile actions may not be effective at this time. He advised maintaining patience in investment portfolios and waiting for more opportune moments.
He emphasized that the market is not in decline but rather offers opportunities for seemingly mundane activities, such as buying and holding Bitcoin long-term or engaging in altcoin speculation. Grachev concluded that there is still much to do for builders and investors, while smaller investors should focus on learning, avoid lamenting losses, and enjoy the market they have chosen to enter.
#cryptocurrency#marketconditions#investmentopportunities#DWF Labs #AndreiGrachev#bitcoin#altcoin#longtermholding#speculation#investors#builders#patience#learning#BTC
DuckChain Secures $5M Funding
TON’s consumer layer for Web3 DuckChain has successfully raised $5 million in a funding round with participation from multiple investors including dao5, Offchain Labs, DWF Ventures, and others.
#DuckChain#Web3#Funding#TON#dao5#OffchainLabs#DWF#Investors#Ventures#Kenetic#Skyland#GeekCartel#GateLabs#PrestoLabs#Camelot#Quantstamp#Blockchain#Finance#Investment#Technology