2022-09-20

https://www.jianshu.com/p/e1d9ddc86c7d
系统架构:https://www.bilibili.com/video/BV1J54y167jf?p=1
01-20 设计模式
21-27 热门框架 RxJava,eventBus,retrofit,okhttp,glide,手写核心部分(设计模式)
28-31 开发模式mvc,mvp
32-40 项目实战。

学习不能停,利他原则(使用者方便),

面向对象的六大基本原则:面向接口和抽象。

泡在网上的日子:https://paonet.com/oss

1. 单一职责原则Simple Responsibility Principle

定义:一个类中应该是一组相关性很高的函数、数据的封装。

image.png

2. 开闭原则 Open close Principle

软件中的对象(类,模块,函数等),对扩展是开发的,对修改是关闭的。

3. 里氏替换原则 Liskov Substitution Principle

定义:父类能出现的地方,子类就可以出现。主要体现就是实现和继承。

// 1.网络请求:

HttpUtils.initHttpRequest(new XUtilsRequest());

HttpUtils.initHttpRequest(new OKHttpRequest());

// 2.Rv的layoutManager

mRecyclerView.setLayoutManager(new LinearLayoutManager(this))

mRecyclerView.setLayoutManager(new GridLayoutManager(this,3))

// 3. Retrofit添加解析工厂。

4. 依赖倒置。Dependence inverse principle

定义:只依赖底层的抽象(接口),不依赖具体的底层实现细节。

5. 接口隔离原则:Interface Segregation principle

定义:接口拆分,单接口。Eg:Closeable接口

  1. 迪米特原则:Law of Demeter

定义:一个对象应该对其他对象有最少的了解,调用者也是。 :

你可能感兴趣的:(2022-09-20)