As an aspiring software developer, over the course of 314, I’ve discovered the hard way that there’s an infinite amount of issues you can run into while making and maintaining an app. But thankfully, for every problem, there’s a solution. This is where Design Patterns come in. Design Patterns don’t only help to simplify and expand code, but will also save you time and reduce bugs and errors to aid you in the long run.
There are 3 main types of Design Patterns: Creational, Structural, and Behavioral. Creational Design Patterns focus on object creation, which increases flexibility and reuse of existing code. An example of this would be the Singleton, which ensures only one instance of a class is created and should be available through the code. Structural Patterns on the other hand deal with organization and composition of classes and objects to form larger structures. This includes the Observer, which defines a dependency between objects so that when one changes, all the dependents are notified and updated automatically. Behavioral Patterns manage algorithms, and support the communication between objects and classes.
To be completely honest, I haven’t utilized Design Patterns to their fullest potential, much less more than once or twice. It’s still a relatively new concept to me and we haven’t talked about them in class, so I don’t find myself thinking about it when writing code. But after reading over Design Patterns and what they are, I’ve drawn out steps for implementing them in the future.
While I haven’t used Design Patterns yet, I can see myself benefitting from them in the future. I tend to be a bit all over the place and quickly get overwhelmed by my code, and kind of regret not using them sooner. Hopefully implementing them will make my life a lot easier in the future. It may seem kind of annoying to think about what patterns I should use when I just want to jump right into the project, but the journey will definitely become a lot smoother once I get used to following the steps.