摘要: 工厂模式(Factory Pattern)属于创建型模式的一种,简单的说就是通过输入参数调用工厂类创建产品的方法创建出相应的产品。 代码如下: 1、Ball /** * Created with IntelliJ IDEA. * Description: 产品-球 * User: guaniu * 阅读全文
posted @ 2020-11-27 15:35 Sunrise2750 阅读(76) 评论(0) 推荐(0)
摘要: 设计模式共有23种,分为3大类:创建型设计模式(Creational Pattern)、结构型设计模式(Structure Pattern)和行为模式(Behavior Pattern)。 序号模式 & 描述包括 1 创建型模式这些设计模式提供了一种在创建对象的同时隐藏创建逻辑的方式,而不是使用 n 阅读全文
posted @ 2020-11-27 14:58 Sunrise2750 阅读(129) 评论(0) 推荐(0)
摘要: 1.多表关联时尽量使用 [inner] join 代替 (where)连接查询 select A.*,B.* from A [inner] join B on A.id = B.id; select A.*,B.* from A,B where A.id = B.id; join 查询时显性连接,w 阅读全文
posted @ 2020-11-27 10:37 Sunrise2750 阅读(58) 评论(0) 推荐(0)