V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Cbdy  ›  全部回复第 100 页 / 共 140 页
回复总数  2797
1 ... 96  97  98  99  100  101  102  103  104  105 ... 140  
2018-10-13 19:47:37 +08:00
回复了 shayuvpn0001 创建的主题 程序员 统计一下,现在用 Guava 和 Apache 库的公司有多少?
Java 8 之后很少用了
2018-10-12 19:58:51 +08:00
回复了 kideny 创建的主题 Java Java 到底有哪些不好或者说比如其他语言的地方呢?
@Kaiv2 比如 Valhalla,Boxing 的出现
@TommyLemon
JDBC Template 原生 SQL 解决复杂查询
JPA 解决简单增删改查
MyBatis 方便动态 SQL 和多行字符串
Spring Data REST 直接根据数据表生成 REST API

成熟而流行的方案很多了,不要去做“半吊子的设计”

为什么不用数据库的储存过程?因为复杂度,这么做不能 handle 软件开发的复杂度(调试复杂、维护复杂、依赖平台、不好懂),所以不流行
Java 的话,JDBC Template 这种抽象很合理了,等 Java12 出了,支持多行字符串就可以告别 MyBatis 了(当然,我现在也不用)

ORM 的话,用 JPA 吧。你这套东西,恕我直言,半吊子的设计
2018-10-10 09:44:16 +08:00
回复了 Bestda 创建的主题 问与答 图书馆太冷了,有什么好的办法
空调了解一下
依赖注入的实质是代码生成,生成样板代码
2018-10-07 16:31:50 +08:00
回复了 YTS 创建的主题 Windows Windows 10 1809 更新以后部分个人文件丢失
还是重装稳一点
2018-10-07 13:44:57 +08:00
回复了 Oathbinder 创建的主题 Java 如何更省事地用 Java 写一个命令行交互的 CRUD 应用
给用户装一个 DataGrip
2018-10-07 13:42:01 +08:00
回复了 ft3312591 创建的主题 程序员 关于 html5 的桌面通知,如何实现实时推送
sse 和 ws 都行吧,倾向于用 ws,灵活没跨域,可以弄一个专门的消息服务
2018-10-07 10:44:23 +08:00
回复了 oldIron 创建的主题 职场话题 该如何处理这种压力
及时沟通,不要大恩成仇😄
2018-10-02 15:45:30 +08:00
回复了 zsh1995 创建的主题 Java effective Java 已经有新版了,国内啥时候能引进?
求人不如求己,建议学好洋文
用自家的域名做一下 cname 很难吗?
2018-09-29 19:24:19 +08:00
回复了 aLazarus 创建的主题 程序员 有时候和同事一起工作简直就是降低效率…
换 node,前后都自己写,没有这么多幺蛾子
2018-09-29 12:56:18 +08:00
回复了 vjnjc 创建的主题 问与答 求问聊天信息该怎么存储?
tidb
2018-09-28 20:08:55 +08:00
回复了 v2byy 创建的主题 程序员 typora bug 有点多啊
你更新一下吧,现在最新是 0.9.9.18.1
2018-09-28 15:02:40 +08:00
回复了 Wang1990 创建的主题 问与答 有偿征集店名,采用发 5000 利是
刺激吃鸡
2018-09-27 19:08:13 +08:00
回复了 bbbai 创建的主题 程序员 一个 Java 的小问题
Effective Java 第三版第二章第一节有详细介绍

我简单摘录一下:

### 优点

One advantage of static factory methods is that, unlike constructors, they have names.

A second advantage of static factory methods is that, unlike constructors, they are not required to create a new object each time they ’ re invoked.

A third advantage of static factory methods is that, unlike constructors, they can return an object of any subtype of their return type.

A fourth advantage of static factories is that the class of the returned object can vary from call to call as a function of the input parameters.

A fifth advantage of static factories is that the class of the returned object need not exist when the class containing the method is written.

### 缺点

The main limitation of providing only static factory methods is that classes without public or protected constructors cannot be subclassed.

A second shortcoming of static factory methods is that they are hard for programmers to find.

### 一些常见的静态构造方法

**from**: A type-conversion method that takes a single parameter and returns a corresponding instance of this type, for example:

```java
Date d = Date.from(instant);
```

**of**: An aggregation method that takes multiple parameters and returns an instance of this type that incorporates them, for example:

```java
Set<Rank> faceCards = EnumSet.of(JACK, QUEEN, KING);
```

**valueOf**: A more verbose alternative to from and of, for example:

```java
BigInteger prime = BigInteger.valueOf(Integer.MAX_VALUE);
```

**instance** or **getInstance**: Returns an instance that is described by its parameters (if any) but cannot be said to have the same value, for example:

StackWalker luke = StackWalker.getInstance(options);

**create** or **newInstance**: Like instance or getInstance, except that the method guarantees that each call returns a new instance, for example:

```java
Object newArray = Array.newInstance(classObject, arrayLen);
```
根据我的实践,在 windows 上用 docker 最佳的方案是虚拟机,里面装个 Linux,然后再用 docker。虚拟化可以用 VirtualBox
1 ... 96  97  98  99  100  101  102  103  104  105 ... 140  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5005 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 70ms · UTC 07:28 · PVG 15:28 · LAX 00:28 · JFK 03:28
Developed with CodeLauncher
♥ Do have faith in what you're doing.