Logo

dev-resources.site

for different kinds of informations.

Memento Design Pattern O'zbek tilida

Published at
12/24/2024
Categories
momento
designpatterns
uzbek
react
Author
turdaliyev_ismoil
Author
17 person written this
turdaliyev_ismoil
open
Memento Design Pattern O'zbek tilida

Memento Design Pattern

– obyektning ichki holatini (state) vaqtinchalik saqlab qo‘yish va uni keyinchalik tiklash imkonini beruvchi konseptual yechim. Bu pattern undo/redo funksionalliklarini yaratishda juda qo‘l keladi.

Hayotiy taqqoslash
Aytaylik Kitob, Xatcho'p, Kitobxon. Kitobni kitobxon o'qish jarayonida kerakli varoqlarga xatcho'p qoyib ketadi. Kerakli vaqtda xatcho'p joylashga varoqni ochadi va kerakli joy bo'ladi.

Kitob — bu Originator, uning sahifasi hozir qayerda ekanligini biladi.
Xatcho’p — bu Memento, u faqat qaysi sahifada ekaningizni saqlab turadi.
Kitobxon (o‘quvchi) — bu Caretaker, siz xatcho’pni saqlaysiz va kerak bo‘lsa kitobga qaytarib qo‘yasiz.


Bu patternda 3 ta asosiy komponent ishlaydi:

  • 1. Originator: Saqlanishi kerak bo‘lgan holatni o‘zida ushlab turadi va memento (eslatma) yarata oladi yoki mementodan holatini tiklaydi.
  • 2. Memento: Obyektning saqlangan holatini ifodalovchi narsa. U ma’lumotlarni o‘zida saqlaydi, lekin boshqa komponentlar bilan o‘zaro muloqot qilmaydi.
  • 3. Caretaker: Mementoni boshqaradi (saqlaydi va kerak bo‘lganda tiklaydi), lekin memento ichidagi ma’lumotni bilmaydi.

Qo'llash mumkin caselardan: Grafik dasturlar, Formalar, O'yinlar, Editorlar, ...


Ammo har bir stateni saqlash memorydan ko'p joy oladi.

Yechimlar:

  1. Delta saqlash usulidan foydalanish
  2. Compress qilish, misol, JSON qilish orqali

MOMENTO #DESIGN_PATTERN

Image description

designpatterns Article's
30 articles in total
Favicon
ISP - O Princípio da Segregação de Interface
Favicon
7 Essential Design Patterns for JavaScript Developers: Boost Your Coding Mastery
Favicon
Usando Strategy Pattern para evitar condicionamento exagerado
Favicon
Singleton ou Observable? A Escolha Errada Pode Custar Sua Promoção!
Favicon
Disadvantages of the Single Responsibility Principle(SRP)
Favicon
Color Theory in UI Design
Favicon
Builder Pattern in C#: Practical Implementation and Examples
Favicon
[Boost]
Favicon
Cloud Design Patterns 01-10
Favicon
Observer Design Pattern | Low Level Design
Favicon
Foundations of Interior Design: Mastering the Art with the Best Interior Design Courses in Bangalore
Favicon
GRASP Pattern - Nguyên Tắc Thiết Kế Trách Nhiệm Hướng Đối Tượng
Favicon
🌟 Exciting Update: LivinGrimoire Wiki Revamp! 🌟
Favicon
Giới Thiệu Về Pattern Trong Phát Triển Phần Mềm
Favicon
Giới Thiệu Về Pattern Trong Phát Triển Phần Mềm
Favicon
Fallback Pattern in .NET Core: Handling Service Failures Gracefully
Favicon
Learn Design Patterns: Understanding the Adapter Pattern for Compatibility
Favicon
Top 10 Design Patterns for Programming Interviews
Favicon
Handling NullPointerException with Optional
Favicon
SOLID: Dependency Inversion Principle (DIP) in C#
Favicon
Introducing TheShell: A Game-Changer in LivinGrimoire
Favicon
O que é o hikari pool?
Favicon
Concurrency Patterns: Balking Pattern
Favicon
Observer Design Pattern O'zbek tilida
Favicon
Memento Design Pattern O'zbek tilida
Favicon
Command design pattern 🥷 O'zbek tilida
Favicon
Mediator design pattern O'zbek tilida
Favicon
Concurrency Patterns: Active Object
Favicon
Learn Design Patterns: Understanding the Factory Method Pattern
Favicon
Understanding the State Pattern

Featured ones: