The Sweet Life of Design Patterns

29 Apr 2021

Baking Frenzy

Starting as child, I have always had a sweet tooth, especially for chocolate. Whether it be cakes, cookies, ice cream, or candy, my craving for baked goods and sweets in general was always present. Growing up, I began to learn how to make these baked goods on my own by entering the hobby of baking - and let me tell you, it was absolutely amazing. From one recipe to another, I was able to catch onto patterns within various online recipes to improve my own. If you enjoy your cookies fluffy, the more flour, the better. Enjoy them thin and crispy? Try adding more baking powder and sugar. These patterns not only helped me gain a head start into creating my own recipes but also provided me with a general path to follow to achieve the perfect delectable desserts for me and loved ones.

Paving the Sweet Path for Developers

Comparing this concept to the world of software engineering and development, the idea of finding patterns between multiple recipes and using them in the creation of my own recipes, design patterns in software development can also be repurposed in various projects. As the purpose of design patterns is to serve more as design templates rather than specific solutions, developers are able to utlize and implement them in a variety of ways. By incorporating each project’s different objectives and the creativity of their developers, design patterns simply pave a path to new innovations.

Using Patterns for Data Collection

As a full-time Computer Engineering student here at the University of Hawaii at Manoa, I have noticed that many of the projects I have been able to take part in require some form of data collection. From general user information to specific data, many projects require the implementation of receiving data from users to perform the application’s various capabilities. As a recent project, I have developed an application with my fellow team members of the Embryo Image Analysis subteam of the Microrobotics VIP Project. This application was created to analyze the results of uploaded videos of embryos to gain insight on their viability and growth rate. Within this project, we have mainly implemented the composite pattern as we utilized TKinter, a Python graphical user interface (GUI) toolkit, to implement various widgets in an efficient way. By implementing the composite pattern, we were able to simplify the creation of multiple widgets by creating a common operation between them.

Also utilizing Python, I was able to develop multiple scripts that served the purpose of augmenting large amounts of images using different image augmentation methods. For instance, scripts were made for each of the following image augmentation methods: mirroring, splicing, and rotating. By utilizing the iterator pattern, I was able to streamline the process of augmentation by using ‘for’ loops to perform the same augmentation method to each image of a large dataset and saving them to the user’s desired file location. Doing so allows users to simply specify the dataset’s location before running the script, leaving the process of augmentation simple and efficient.