- 浏览: 9248 次
最新评论
-
endual:
以前也写过英语博客,一边用软件翻译,一边修改复制粘贴。呵呵。
Eliminate unchecked warnings
文章列表
When you program with generics, you will see many compiler warnings:
unchecked cast warnings, unchecked method invocation warnings, unchecked
generic array creation warnings, and unchecked conversion warnings. The more
experience you acquire with generics, the fewer warnings you’ll get, but don’t
...
One common use of a static member class is as a public helper class, useful
only in conjunction with its outer class. For example, consider an enum describing
the operations supported by a calculator (Item 30). The Operation enum should
be a public static member class of the Calculator class. Clie ...
The rule of thumb is simple: make each class or member as inaccessible as
possible. In other words, use the lowest possible access level consistent with the
proper functioning of the software that you are writing.
For top-level (non-nested) classes and interfaces, there are only two possible
acce ...
public class ConcreteStrategy implements BaseStrategy {
@Override
public void execute(Object argument) {
// Work with passed-in argument.
}
}
public class ConcreteCommand implements BaseCommand {
private Object argument;
public ConcreteCommand(Object a ...
The processor thread (the await method)
while (!available) { wait(); }
Socket socket = this.socket;
available = false; notifyAll();
return socket;
The connector thread (the assign method)
while (available) { wait(); }
this.socket = socket;
available = true;
notifyAll();
Ini ...
Tomcat 系统构架(转)
- 博客分类:
- Web
Tomcat 总体结构
Tomcat 的结构很复杂,但是 Tomcat 也非常的模块化,找到了 Tomcat 最核心的模块,您就抓住了 Tomcat 的“七寸”。下面是 Tomcat 的总体结构图:
图 1.Tomcat 的总体结构
从上图中可以看出 Tomcat 的心脏是两个组件:Connector 和
Container,关于这两个组件将在后面详细介绍。Connector
组件是可以被替换,这样可以提供给服务器设计者更多的选择,因为这个组件是如此重要,不仅跟服务器的设计的本身,而且和不同的应用场景也十分相关,所以一
个 Container ...
Web Tier Design Goals
Naïve approaches toward J2EE web tier implementation typically result in JSP pages containing excessive
amounts of Java scriptlets, with a confused mixture of presentation and business logic. The result is an
untestable presentation layer, refactoring headaches, and maintenan ...
You have two options to configure the MemcachedClient:
using the app.config,
providing an object which implements IMemcachedClientConfiguration
App.config (or web.config) is recommended when your pool is
static or you rarely change it. Use the programmatic configuration
(either implementin ...
I'm including an encapsulation hierarchy table of several of the GoF
design patterns to help explain the differences between these two
patterns. Hopefully it better illustrates what each encapsulates so my
explanation makes more sense.
First off, the hierarchy lists the scope for which a given ...
https://cwiki.apache.org/WW/big-picture.html