Java8设计模式最佳实战-设计模式概述(第一天学习记录)

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
img

正文

and recurring problem regardless of the programming language they are using. With this,

以及反复出现的问题,而不管他们使用的是哪种编程语言。有了这个,

we are able to identify a problem and its solution by the name of the pattern and thinking

我们能够通过模式和思维的名称来识别问题及其解决方案

about a solution by a model point of view in a high abstraction level of language

从一个高抽象层次的语言模型的角度讨论一个解决方案

programming details.

编程细节。

The design patterns theme gained strength in 1994 after the Gang of Four (formed by Rich

1994年“四人帮”(Rich组建)之后,设计模式主题获得了发展

Gamma, Richard Helm, Ralph Johnson, and John Vlissides) wrote Design Patterns: Elements

Gamma、richardhelm、Ralph Johnson和johnvlissides)撰写了设计模式:元素

of Reusable Object‐Oriented Software. Here, they described 23 design patterns that were later

可重用的面向对象软件。后来在这里描述了23种模式

known as GoF design patterns and are still used today.

被称为GoF设计模式,至今仍在使用。

重点词汇


Explaining the Gang of Four design patterns

解释四人帮设计模式

The Gang of Four (GoF) design patterns are 23 patterns that are classified as creational patterns

四人帮(GoF)设计模式是23种被归类为创造性的模式

structural patterns, and behavioral patterns. The creational patterns control the

结构模式和行为模式。创造模式控制着

creation and initialization of the object and class selection; the structural patterns define the

对象和类选择的创建和初始化;结构模式定义

relationship between classes and objects, and the behavioral patterns control the

类和对象之间的关系,以及行为模式控制

communication and interaction between objects. As well as this, the GoF design patterns

对象之间的通信和交互。除此之外,GoF的设计模式

have two types of scope which define the focus of solutions. These scopes are object

有两种定义解决方案重点的范围。这些作用域是对象

scope, which resolves problems about object relations, and class scope, which resolves

scope用于解决有关对象关系的问题,类scope用于解决

problems about class relations.

关于类关系的问题。

The object scope works with composition and the behavior changes are done in a runtime.

对象作用域与组合一起工作,行为更改在运行时完成。

Thus, the object can have a dynamic behavior. The class scope works with inheritance and

因此,对象可以具有动态行为。类作用域使用继承和

its behavior is static-fixed at compile-time way. Then, to change the behavior of a classscope pattern, we need to change the class and recompile.

它的行为在编译时是静态固定的。然后,要更改类作用域模式的行为,我们需要更改类并重新编译。

Patterns classified as class scope solve problems about the relationship between classes and

此分类为类范围的模式解决了类之间关系

are static (fixed at compile time and cannot be changed once compiled). However, patterns

是静态的(在编译时是固定的,一旦编译就不能更改)。然而,模式

classified under the object scope solve problems about the relationship between objects and

在对象范围下进行分类,解决对象之间关系

can be changed at runtime

可以在运行时更改

重点词汇


  • As well as 既…又… ; 除…之外 ; 此外

  • types of 类型 ; 的型态 ; 债券的种类

  • resolves 解决 ; 决心 ; 决定 ; 作出决定 ; 作出决议 ; 表决 ; 坚定的信

The following diagram shows us the three classifications, as well as their patterns and

下图显示了三种分类,以及它们的模式和

scope:

范围:

在这里插入图片描述

In the preceding diagram, we can see the Factory Method pattern on the Class section and

在前面的图中,我们可以在Class部分和

the Abstract Factory pattern on the Object section. This occurs because the Factory Method

对象部分上的抽象工厂模式。这是因为工厂方法

works with inheritance and the abstract method pattern works with composition. Then, the

处理继承,抽象方法模式处理组合。然后

Factory Method is static-fixed at compile time and cannot be changed after compilation.

工厂方法在编译时是静态固定的,编译后不能更改。

However, the Abstract Factory is dynamic and can be changed at runtime.

但是,抽象工厂是动态的,可以在运行时更改。

GoF design patterns are generally described using a graphical notation such as a use case

GoF设计模式通常使用图形表示法来描述,例如用例

diagram, and an example of the implementation’s code. The used notation must be able to

图,以及实现的代码示例。使用的符号必须能够

describe the classes and objects as well as the relationship between these classes and

描述类和对象以及这些类和

objects.

对象。

The pattern’s name is an important part of the design patterns. This is because it is what the

模式的名称是设计模式的重要组成部分。这是因为

developer uses to quickly identify the problem related to the pattern and to understand

开发人员用来快速识别与模式相关的问题并理解

how the pattern will solve it. The name of the pattern must be brief and refer to the problem

模式将如何解决它。模式的名称必须简短并引用问题

and its solution.

以及它的解决方案。

重点词汇


  • 在前面 farther on ; fore

  • 继承 inherit ; succeed ; carry on ; carry forward

  • 抽象方法 abstract method

  • 编译 compile ; translate and edit

  • 静态 static state ; quiescent condition ; steady state ; statics

  • 更改 change ; alter ; alteration

  • 抽象 abstract

pattern is a great tool for designing software development, but its use needs to be

模式是设计软件开发的一个很好的工具,但是它的使用需要

analyzed to determine if the design pattern is really required in order to solve the problem.

分析以确定是否确实需要设计模式来解决问题。

The catalog of Gang of Four design patterns

四人帮设计模式分类目录

Names of design patterns need be succinct, making them easy to identify. This is because

设计模式的名称必须简洁,使其易于识别。这是因为

design patterns create a vocabulary for communicating between developers independent of

设计模式创建了一个独立于

programming language, permitting developers to identify problems and solutions only by

编程语言,允许开发人员通过

name of a design pattern.

设计模式的名称。

In design patterns, a catalog is a set of pattern names which are designed to permit a better

在设计模式中,目录是一组模式名,它们被设计成允许更好的的沟通在

communication between developers.

开发人员之间。

The catalog of GoF’s design patterns has 23 patterns, as 在shown in the preceding diagram.

GoF的设计模式目录有23个模式,如上图所示。

Here is a description of these patterns:

以下是对这些模式的描述:

Abstract Factory: This provides an interface to create objects without specifying

抽象工厂:这提供了一个接口来创建对象,而无需指定

their concrete class, making it possible to decouple the business logic and

它们的具体类,使业务逻辑和

the object creation logic. With this, we can update the object creation logic in an

对象创建逻辑。这样,我们就可以更新对象的创建逻辑

easy way.

简单点。

Adapter: This provides an interface that makes it possible for two incompatible

适配器:这提供了一个接口,使两个不兼容的

interfaces to work together. The adapter pattern works as a bridge between

接口协同工作。适配器模式在

interfaces, adapting these interfaces to work together. Furthermore, the adapter

接口,调整这些接口以协同工作。此外,适配器

can adopt a class or objects.

可以采用一个类或对象。

Bridge: This pattern decouples an abstraction from its implementation, making

桥:这个模式将抽象从它的实现中分离出来,使得

them vary independently. With this, we can modify the implementations without

它们各不相同。有了它,我们可以修改实现而不需要

impacting the abstractions and we can also modify the abstractions without

影响抽象,我们也可以在没有

impacting the implementations. The class of abstraction hides implementations

影响实施。抽象类隐藏了实现

and its complexity.

以及它的复杂性。

Builder: This pattern separates the construction of a complex object from its

Builder:此模式将分开复杂对象的构造与其

representation. With this, we can construct the objects of several representations

表现 。有了它,我们就可以构造多个表示的对象

using the same process to that. Thus, we create a standard process of

用同样的方法。因此,我们创建了一个

construction of objects that have a complex process to construct.

构造一个复杂的过程。

Chain of responsibility: This pattern avoids coupling the sender and receiver of

责任链:这种模式避免了

a request creating some objects that have a chance to treat the requests. These

创建一些对象的请求,这些对象有机会处理这些请求。这些

objects create a chain of receiver objects for a sender’s request. Each object of this

对象为发送方的请求创建接收方对象链。每一个目标

最后

由于文案过于长,在此就不一一介绍了,这份Java后端架构进阶笔记内容包括:Java集合,JVM、Java并发、微服务、SpringNetty与 RPC 、网络、日志 、Zookeeper 、Kafka 、RabbitMQ 、Hbase 、MongoDB、Cassandra 、Java基础、负载均衡、数据库、一致性算法、Java算法、数据结构、分布式缓存等等知识详解。

image

本知识体系适合于所有Java程序员学习,关于以上目录中的知识点都有详细的讲解及介绍,掌握该知识点的所有内容对你会有一个质的提升,其中也总结了很多面试过程中遇到的题目以及有对应的视频解析总结。

image

image

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
以上目录中的知识点都有详细的讲解及介绍,掌握该知识点的所有内容对你会有一个质的提升,其中也总结了很多面试过程中遇到的题目以及有对应的视频解析总结。

[外链图片转存中…(img-mqrzAwps-1713386519772)]

[外链图片转存中…(img-f8ieIv92-1713386519772)]

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-tUCs4qFZ-1713386519772)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 10
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值