Design Patterns Tutorial Home / Video /

Singleton Design Pattern Explained πŸ”„ | LambdaTest

Singleton Design Pattern Explained πŸ”„ | LambdaTest

About the Video

In Part 3 of our Design Patterns Tutorial series, 𝑨𝒏𝒕𝒐𝒏 π‘¨π’π’ˆπ’†π’π’π’— (@π’‚π’π’ˆπ’†π’π’π’—π’”π’•π’‚π’π’•π’π’, Co-founder & CTO of Automate The Planet Ltd., who dive deep into the Singleton Design Pattern and expertly guides you through the intricacies of Design Patterns. This session covers everything from reviewing a test project to understanding Basic and Thread-safe Singleton Design Pattern implementations.

Video Chapters

00:00 Introduction

02:47 What is a Design Pattern?

03:44 Review Test Project

18:30 Basic Singleton Design Pattern Implementation

26:44 Thread-safe Singleton Design Pattern Implementations

37:30 Closing Words

Key Topics Covered

Introduction to Design Patterns: The video starts with an introduction to design patterns, explaining them as prescribed solutions to common software challenges. It emphasizes that design patterns are templates for solving design problems, facilitating smart grouping of logic, reusability, and maintainability of code.

Previous Design Patterns Covered: The presenter briefly revisits the adapter and proxy design patterns discussed in earlier videos. These patterns were applied to extend the WebDriver interface, adding new methods and enhancing test maintainability.

Decorator Design Pattern: A recap of the Decorator design pattern is provided, showcasing its utility in extending the mini test library with functionalities like highlighting, scrolling into view, building toast messages, and logging.

Singleton Design Pattern for API Usability: The core of the video focuses on the Singleton design pattern. The presenter explains how this pattern can improve API usability by providing a single instance of page objects, factories, builders, and other services. This segment includes examples of refactoring existing solutions to implement the Singleton pattern.

Dependency Injection Pattern: A teaser for the next video, mentioning that it will cover the Dependency Injection pattern to further enhance the mini test library, aiming for a loosely coupled architecture and improved test maintenance.

Further Design Patterns and Techniques: The video outlines plans to cover additional design patterns such as Chain of Responsibility and Strategy Design Pattern for building troubleshooting features and implementing waiting and finding strategies. Test data management techniques, including the use of factories, repositories, and builders, are also mentioned.

Data Driven Testing: A brief introduction to data-driven testing is given, highlighting its benefits in reducing redundancy and enhancing test parameter reuse.

Practical Application and Examples: Throughout the video, practical examples and code refactoring are demonstrated to apply the discussed design patterns to a mini test library. This includes working with page object models and adapting the codebase to incorporate Singleton and other patterns for more efficient testing practices.

Related Blogs & Hubs

A Beginner’s Guide To Mobile Design Patterns For Automation Testing

JavaScript Design Patterns: A Complete Guide With Best Practice

Selenium Waits Tutorial: Guide to Implicit, Explicit, and Fluent Waits

NUnit Tutorial: A Complete Guide With Examples and Best Practices

Anton Angelov

Anton Angelov

Anton Angelov, a distinguished figure in software testing, is the CTO & Co-founder of Automate The Planet. Widely recognized for his innovative contributions, he is the inventor of the BELLATRIX Test Automation Framework, a powerful tool transforming the landscape of automated testing.

......
...

TestΞΌ 2024

Join the free online conference to decode the future of testing!

...21 - 23 August, 2024

More Videos from Design Patterns Tutorial