Introduction to Java Software Design Patterns: Singleton, Factory Pattern, and Observer Pattern

Bryant Jimin Son
9 min readNov 10, 2019

If you are a programmer or a student pursuing computer science or a similar discipline, sooner or later, you will encounter the term “software design pattern.” According to Wikipedia, “a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.” Here is my take on the definition: When you have been working on a coding project for a while, you often begin to think, “Huh, this seems redundant. I wonder if I can change the code to be more flexible and accepting of changes?” So, you begin to think about how to separate what stays the same from what needs to change often.

A design pattern is a way to make your code easier to change by separating the part that stays the same and the part that needs constant changes.

Not surprisingly, everyone who has worked on a programming project has probably had the same thought. Especially for any industry-level project, where it’s common to work with dozens or even hundreds of developers; the collaboration process suggests that there have to be some standards and rules to make the code more elegant and adaptable to changes. That is why we have object-oriented programming (OOP) and software framework tools. A design pattern is somewhat similar to OOP, but it goes further by considering changes as part of the natural development process. Basically, the design pattern leverages some ideas from OOP, like abstractions and…

--

--

Bryant Jimin Son
Bryant Jimin Son

Written by Bryant Jimin Son

A cloud practitioner talking about technology, travels & career tips. But I will sometimes cover financial advises and some random stuffs.

No responses yet