Flyweight Pattern - DESIGN PATTERNS (C#/.NET)
Вставка
- Опубліковано 28 чер 2024
- Learn about the flyweight pattern, which is a structural design pattern that involves reusing objects to reduce memory usage. The reused object is known as the flyweight and contains immutable, intrinsic state.
Design patterns are important for implementing object-oriented designs and adhering to SOLID principles. Understanding these fundamental patterns helps software developers build clean and maintainable applications.
TIMESTAMPS:
0:00 - Pattern Introduction
0:16 - Demo Introduction
1:02 - Memory Usage without Flyweight
2:05 - Identifying Intrinsic State
2:53 - Extracting Intrinsic State
4:19 - Implementing a Flyweight Factory
6:58 - Using the Flyweight Factory
7:54 - Memory Usage with Flyweight
8:27 - Flyweight Usage Tips
9:01 - Making the Flyweight Immutable (IMPORTANT)
9:30 - Conclusion
SOURCE CODE: github.com/SingletonSean/desi...
OTHER LINKS:
Become a Member: / @singletonsean
Donations: www.paypal.com/biz/fund?id=UB... - Наука та технологія
Awesome, learn flyweight pattern and memory snap skill in 10 mininutes! Thanks for sharing, Sean!
Glad this was helpful William!
Thank you very much, I learned a lot!
Awesome stuff Sean
Thank you Sean. Good stuff as always.
Thanks Anecthor, glad this was helpful!!
i compare in my code with size = 10000000 and the Inclusive Size(Bytes) is more than origin(not using flyweightpattern) :((