JavaRush /Java Blog /Random EN /Bookmarking: Design Pattern Collection - Theory, Intervie...

Bookmarking: Design Pattern Collection - Theory, Interview Questions, and Book Review

Published in the Random EN group
For the convenience of CodeGym students, we decided to collect lectures and articles on the most important topics in programming. The first selection is about design patterns. In the mini-guide, we briefly outline the essence of the articles, and if you follow the link, you can learn more about the topic of interest. Add a collection to your bookmarks and return to it when you need to. Bookmarking: Design Patterns Collection - Theory, Interview Questions, and Book Review - 1

Lectures on the main design patterns

Singleton design pattern

A singleton is one of the simplest design patterns that can be applied to a class. It is sometimes said "this class is a singleton", implying that this class implements the singleton design pattern. Sometimes it is necessary to write a class that can only have one object. For example, a class responsible for logging or connecting to a database.

Design pattern "Adapter"

In this lecture, we will get acquainted with a pattern called "Adapter". "It has a name that speaks, and you have met with adapters in real life more than once. One of the most common adapters is card readers, which are equipped with many computers and laptops," the author says about the pattern. As in the previous lectures, the code example explains how the pattern works.

Design pattern "Strategy"

The article considers one of the most common patterns called "Strategy". The Strategy pattern defines a family of algorithms, encapsulates each of them, and makes them interchangeable. It allows you to modify the algorithms regardless of their use on the client side.

Bridge design pattern

Bridge solves this problem by separating one or more classes into separate hierarchies - abstraction and implementation. A change in functionality in one hierarchy does not entail changes in another. The article lists the pros and cons of the pattern, where it is applied, and in practice analyze how it works.

Proxy design pattern

The Proxy pattern helps solve the problems associated with controlled access to an object. Using examples, the author analyzes in what situations knowledge of this pattern may be needed, its advantages and disadvantages. And a lot of useful code!

Factory design pattern

In this lecture, the author talks about the Factory: what problem is solved using this template, we will show an example of how the Factory helps to open a coffee shop. And in this lecture there are 5 simple steps to create a Factory.

FactoryMethod design pattern

You will learn what a factory method is and what tasks this pattern is suitable for. We will look at this design pattern in practice and study its structure. The factory method design pattern solves the problem of creating different groups of products, each of which has some specifics.

AbstractFactory design pattern

The lecture should be read to find out what an abstract factory is and what problem this pattern solves. The lecture also shows an example of creating a framework for a cross-platform application for ordering coffee with a user interface. As a bonus, there is an easter egg hidden in the lecture, thanks to which you will learn how to determine the name of the operating system using Java and, depending on the result, perform one or another action.

Design Patterns in Java [Part 1]

A short article on design patterns in Java. It will be useful to those who are already in the subject for repetition and generalization. Or vice versa, for those who approached patterns for the first time - for the very first overview of the topic, before digging deeper.

Design Patterns in Java [Part 2]

In continuation of the previous article, the author shows how to use patterns.

Design patterns in interview questions and answers

Analysis of questions and answers from interviews for a Java developer. Part 1

When interviewing juniors, employers like to ask about patterns. This article will help you prepare for such questions. Among other things, it contains a lot of other useful information for a technical interview.

Level 37

The entire text is devoted to the analysis of interview questions related to design patterns. What are patterns, what they are, why they are needed and where to apply - everything is in this article.

Lectures on antipatterns

It may well be that at the interview you may be asked about anti-patterns - the evil twin brothers of patterns, so we decided to add them to this collection.

What are antipatterns? Parsing examples (part 1)

This article deals with anti-patterns in the field of management, architecture, and development problems.

What are antipatterns? Parsing examples (part 2)

The text analyzes such anti-patterns as the golden hammer, premature optimization, spaghetti code, magic numbers. In general, go read!

Bonus

Review of the book "Design Patterns" (Head First Design Patterns)

This book is one of the top 10 most popular books on Stackoverflow, and for good reason. Ease of presentation, fundamental theme and quality examples make the book in demand. Among people who are at least minimally familiar with the Head First series, there are many who consider such literature to be rather superficial reading matter for beginners. We recommend reading the review, and maybe the book, and draw your own conclusions.

Useful resource: Refactoring.Guru

“Refactoring.Guru” is dedicated to the dark matters of programming: refactoring, design patterns, SOLID principles and other important topics from the programming world. The site contains a catalog of patterns, describes the history of their appearance, benefits and disadvantages. Bookmarking: Design Patterns Collection - Theory, Interview Questions, and Book Review - 2
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION