Getting started with design patterns in Java with Eunjong
You can learn design patterns to implement flexible and scalable object-oriented programming. Learn various patterns that can be used in the real world and apply them to your projects and code refactoring.
Kakao internal developer training course! Learn only carefully selected design patterns ð€
Design patterns learned through real-life examples âš
Why are many systems being developed in object-oriented programming languages? It is to make it more efficient to expand functions, change requirements, and maintain systems or solutions after they are developed. In order for these changes to be easy, proper object-oriented design must be done from the design stage. Learning design patterns will help you understand and apply various solutions for design.
Why should you study design patterns? ð€
If the same solution can be applied to a problem that occurs repeatedly, this design is called a pattern. Design patterns are a field in which the first four scholars, GoF, analyzed several existing systems and software and organized the direction of the most reasonable solution for each problem . Therefore, design patterns are not rules or grammar. Also, they are not limited to languages and can be applied to any object-oriented language.
Developers also use frameworks and good methodologies to develop flexible and maintainable programs. Design patterns are already applied to many frameworks . Learning about the patterns themselves is meaningful, but if you design an efficient solution to solve a problem, you can create your own patterns.
This lecture is used as a video for training internal developers at Kakao . It was created to help those who know Java grammar but have difficulty with object-oriented design using classes learn through design patterns. There are 23 patterns introduced by GoF, but in this lecture, we will introduce only 16 patterns that are actually used a lot in the field and useful in practice . Please study only the patterns that are widely used and applied in other frameworks and libraries! Studying this will also help you understand the framework later.
Learn with easy and fun examples âš
Each pattern can be easily understood through examples.
We provide sample code and apply design patterns to refactor the code for extensibility. You can learn by observing the code changing through pattern application.
We will teach you design methods that can be applied in the field.
I recommend this to these people ðââïž
For those who don't know how to do object-oriented programming
Developer job seekers or new or junior developers
Anyone who wants to experience OOP development using Java
For those who want to understand design principles before studying the framework
Learn things like this ð€
-Learning example of Strategy pattern
1. What is the problem?
First, let's explain what the problematic situation is that led to this pattern and what this pattern is designed to do and intended to improve.
2. Understanding patterns through class diagrams
Learn how patterns are applied through class diagrams and realistic, easy-to-follow examples.
3. Applying patterns and refactoring through realistic examples
ð¢ Please check before taking the class!
The GitLab address and the source GitHub address used in the lecture can be found in the lecture notes at the bottom of the Factory Method lecture in Section 1.
Preview of course reviews ð
*This is feedback on external mentoring that the knowledge sharer went through in the same process.
"I was able to learn effective patterns that are mainly used, from the singleton pattern to the adapter pattern. By understanding the characteristics of each pattern and the cooperative relationship between objects, I was able to better understand the Spring Framework that I will learn later."
Innovation Academy - Kang*su
"Before I started studying, I had a hard time understanding the patterns even when I read the book description and looked at the UML. As I was studying, after about 2-3 weeks, I mainly thought that design patterns were a methodology to use abstraction and interfaces well. However, as I continued studying, I began to understand why these patterns had to come out, and I was able to proceed with the study. After the study, I was surprised at how well I understood each pattern."
Innovation Academy - Lee*
"I applied for the study group after learning Java for the first time. The study group was conducted by refactoring code and solving assignments using various design patterns such as the bridge pattern, factory method pattern, and observer pattern every week. I was able to understand the parts that were difficult when studying design patterns on my own through assignments and study groups in a fun way."
Innovation Academy - Kim*Yeon
"This design pattern study was more fun than the last Java study! In particular, I remember the factory pattern, strategy pattern, and observer pattern well. I think I was able to experience, even if just a little, the tremendous power of ease of maintenance through design patterns. I am currently working on a project using Spring, and I hope to be able to write slightly better code by applying what I learned through this study."
Innovation Academy - Jo*jin
What you'll learn ð
1. What is a design pattern? What is refactoring?
2. Patterns for creating objects
Factory Method - Object creation and refactoring using factories
Abstract Factory - Create a set of instances by selecting a factory.
Singleton - Create only one instance
3. Make it more flexible by separating the algorithm skeleton or function and implementation.
Strategy - Separate policies or algorithms and allow for additional replacement as needed.
Bridge - Separates the part where the function is declared from the various implementations and connects them through a bridge.
Template Method - Fixed flow is defined as a template, and methods that can be implemented in various ways within it are implemented in subclasses.
4. Identify
Decorator - Add various functions flexibly (Identify Object and Decorator)
Composite - Identifies a simple object with a composite object that contains it.
5. Make it flexible by expressing the state as a class
State - When class-wide functionality is determined based on multiple values of the state.
Observer - When you need to notify changes to multiple objects (Observers) that depend on one object (Subject).
6. Make the complex simple
Facade - Provide a single interface for clients to use easily.
Mediator - Prevents multiple objects from communicating with each other and only communicates with one central object.
7. Patterns that move around the structure
Iterator - Provide a uniform interface for how to iterate over an object.
Visitor - Visits an object and performs a function.
8. How to control access
Proxy - A delegate for a real object
9. Compatibility
Adapter - Change the interface to what the client wants.
10. Command as an object
Command - Encapsulates and processes tasks that need to be performed in a variety of ways into a consistent interface.
11. Smart life with design patterns
Expected Questions Q&A ð¬
Q. Can I get started without knowing Java? Or do I need to be a beginner?
Even if you don't know Java, you can take the course if you know other OOP languages. However, if you have no basic knowledge at all, there is a free introductory Java course on Inflearn. I recommend you take that course first.
Q. I studied other object-oriented languages(C++, C#). Can I still take the course?
Most OOP languages are designed with similar concepts. Therefore, if you have already learned an object-oriented language, taking this course will allow you to learn Java and object-oriented design at the same time, killing two birds with one stone.
Q. What are the benefits of learning design patterns?
Design patterns are neither grammar nor rules. However, they identify problems and provide the best design method for the problem. By learning this process along with code, you can implement various applications and extensions when designing a new program. By learning well-made patterns, you can implement better designs.
Q. Can this be applied in practice?
Many of the frameworks and programs we use in practice already have design patterns applied to various parts. Therefore, learning design patterns will be very helpful in understanding existing code. It will also be helpful in many ways in helping students write more efficient code in the future.
Introducing the knowledge sharer âïž
I majored in computer engineering at Dongguk University and received a master's degree in computer engineering from Seoul National University. While working at the company, I worked on numerous development projects in languages such as Java, C, and C++, and gave lectures on Java, web, data structures and algorithms, mobile, and design patterns at Bit Computer and T Academy.
I taught programming classes for non-majors at Kookmin University and Kyunghee University, and taught Java programming and programming practice classes as a part-time professor at NHN NEXT. I worked as a developer for 10 years, so I know what's needed in the field, and I also taught for another 10 years, so I understand the minds of beginners.
My current main interest is to help people from all walks of life, from elementary school students to adults, to become interested in and study the wonderful world of programming. I am currently a mentor at Innovation Academy (42 Seoul).
History
Innovation Academy (42 SEOUL) Mentor
Author of 'Do It Java Programming Introduction' (Easy Publishing)
Fast Campus, creator of Inflearn's popular Java programming course
NHN NEXT part-time professor, Beat Education Center, TAcademy instructor
Spectra Development Team Leader
Modern Information Technology
Master's degree in Computer Science from Seoul National University
Bachelor of Computer Engineering, Dongguk University