kukooBlog
look to the master, follow the master, walk with the master, see through the master, become the master.

August 28, 2005

Top 5 Principles of Enterprise Architecture

Posted @ 3:12 am+8 in Programming, Patterns | Licensed under a Creative Commons License

上周在Colorado,Martin Fowler 和 Bruce Eckel 邀请了一些“大腕”级的人物,如Rod Johnson,Floyd Marinescu等,开了一个“座谈会”(现场的一些照片在这里)。 其中讨论到:“企业级架构最关键的原则问题是什么”。 这些“大腕”一共总结出来40条,然后投票得出了最关键的5条 (Top 5 Principles of Enterprise Architecture):

  1. Use a layered architecture.
  2. Build Automated Regression Tests, which was tied with:
  3. Manage your application as you would a software product. eg: frequent and numbered releases, same rigor as a product.
  4. Use the smallest team you possibly can tied with:
  5. Attack the domain problem first (or - work on your domain model before other parts of the app).

与之对应的Top Bottom 5则是(从后往前):

  1. Use Model Driven Architecture.
  2. Determine all your requirements upfront.

    and a three way tie between: (最后3个并列)
  3. Use EJBs.
  4. Prefer web based UI’s.
  5. Prefer open source projects.

Floyd Marinescu关于这次“研讨会”更详细的blog

Yourit Technorati cosmos Refresh Technorati

August 23, 2005

Recommended Reading List

Posted @ 2:44 am+8 in Java, Programming | Licensed under a Creative Commons License

Ted Neward, author of the best-selling book: Effective Enterprise Java, published an “old list” of his recommend reading list in his new blog.

Java Recommended Reading list:

  • Effective Java by Bloch.
  • Effective Enterprise Java by Neward.
  • Concurrent Programming in Java (2nd Ed) by Lea.
  • Either Inside Java2 Platform Security by Gong or Java Security (2nd Ed) by Oaks.
  • Component Development for the Java Platform by Halloway.
  • Inside the Java2 Virtual Machine by Venners.
  • Java Development with Ant by Hatcher and Loughran.
  • Either Java RMI by Grosso or java.rmi by McNiff and Pitt.
  • Servlets and Java Server Pages by Jones and Falkner, possibly Java Servlet Programming (2nd Ed) by Hunter, if you aren’t planning to use JSP. (Jason’s legendary bias against JSP, right or wrong, puts him somewhat out of tune with what a majority of Java web-client shops are doing. That said, it’s a great servlets resource.)

.NET Recommended Reading list:

  • C# In a Nutshell (2nd Ed) by Drayton, Albahari, and Neward.
  • Advanced .NET Remoting by Rammer.
  • Essential ADO.NET by Beauchemin.
  • Inside Microsoft .NET IL Assembler by Lidin.
  • SSCLI Essentials by Stutz, Neward and Shilling.
  • Debugging Applications by Robbins.
  • Inside Windows 2000 by Russinovich and Solomon.
  • Essential COM by Box. (Yes, I mean Essential COM and not his more recent Essential .NET book. The first chapter of Essential COM is probably the best well-written technical prose I’ve ever read in my life, and everybody who ever wanted to write reusable components in C++ needs to read it to understand why C++ failed so miserably at that goal. Once you’ve seen that, you’re ready to understand why components are so powerful and so necessary.)
  • The Common Language Infrastructure Annotated Standard by Miller
  • Programming in the .NET Environment by Watkins et al.

C++ Recommended Reading list:

  • The C++ Programming Language (3rd Ed) by Stroustrup.
  • Effective C++ (1st, 2nd or 3rd Ed) by Meyers.
  • More Effective C++ by Meyers.
  • Effective STL by Meyers.

Security-related Recommended Reading list:

  • Secrets and Lies by Schneier.
  • Either Cryptography Decrypted by (can’t remember the name offhand), Practical Cryptography by Schneier and Ferguson, or Applied Cryptography (2nd Ed) by Schneier. The first is a lightweight introduction to the subject, the second is a more detailed introspection, the third required reading for anybody who wants to be a security wonk.
  • The Code Book by Singh.

Platform-agnostic Recommended Reading list:

  • Design and Evolution of C++ by Stroustrup. It’s fascinating hearing how a language develops over time, and what was behind some of the decisions in the features of the language. For example, why did multiple inheritance come before templates or RTTI? Not because it was more important, but because Stroustrup wanted to tackle MI first because he wasn’t sure if or how he could do it. He describes that as a great regret, that he didn’t do templates first.
  • Component Software (2nd Ed) by Szyperski.
  • Rapid Development by McConnell. Read this before you read any of the Extreme Programming books, because this book describes a whole taxonomy of what I think a lot of people are reaching for in agile and other methodologies.
  • The Inmates Are Running the Asylum by Cooper.
  • The Invisible Computer by Norman.
  • Principles of Transaction Processing by Bernstein and Newcomer.
  • Transaction Processing: Concepts and Techniques by Gray and Reuter. What to read when you’re done with the Bernstein and Newcomer book and still want to know more about the Zen of Transactional Processing.
  • Refactoring by Fowler.
  • Design Patterns by Gamma, Helm, Johnson and Vlissides.
  • Pattern Oriented Software Architecture, Vol 1 by Stal et al.
  • Pattern Oriented Software Architecture, Vol 2 by Schmidt et al.
  • Patterns of Enterprise Application Architecture by Fowler.
  • Enterprise Integration Patterns by Hohpe and Woolf. Excellent discussion of message-based architecture. I personally think the title is something of a misnomer, but it’s understandable since message-oriented communication is the easiest means by which to integrate heterogeneous systems.

June 30, 2005

JavaOne 2005上的畅销书

Posted @ 6:42 am+8 in Java, Programming, Books | Licensed under a Creative Commons License

想知道在JavaOne 2005上,哪些书最畅销吗? 这是J1上的图书销售商给出的Top 10:

其中有2本JBoss的书,3本Spring的书和1本Hibernate的。你是否需要补充一下你的书架了?


JavaOne bestsellers

Yourit Technorati cosmos Refresh Technorati

June 27, 2005

JavaOne Day 0: NetBeans Day

Posted @ 9:08 am+8 in Java, Programming | Licensed under a Creative Commons License

java.net上已经充满了各种关于JaveOne 2005的blog了。 而且,NetBeans Day 0先于JavaOne在昨天就举行了。 我虽然不是NetBeans的“fans”,但是这个优秀的IDE还是吸引了我去看相关的blog。

在NetBeans Day 0上,主要是宣布和演示了以下一些内容:

  1. Project Looking Glass的演示,一个3D的用户界面,以及如何在NetBeans中使用Project Looking Glass
  2. “code-aware developer collaboration”,这是用Sun的COO, Jonathan Schwartz宣布的。 简单的说,这个就是一个NetBeans IDE中的Instant Messenger。 使用这个合作工具,你不仅可以talk,还可以共享文件,同时编辑文件,甚至是你的NetBeans环境,让你的同事远程操作你的NetBeans(比如帮你编译一个文件)。这个本是Java Studio Enterprise中的一个功能,现在公开源码,提供给NetBeans使用。
  3. 在Java IDE市场,竞争是多么重要 (注:如果没有Eclipse这个竞争者,NetBeans在这几年来,叶不一定发展这么快。反之也是一样,NetBeans有很多东西值得Eclipse去学习,比如那个code-aware collaboration)
  4. NetBean三的新功能(有些还不在4.1中)。比如,类似于Eclipse中的QuickFix的功能
  5. NetBeans profile和JXTA插件
  6. James Gosling做了Matisse这个项目的演示。 Matisse是NetBeans中新一代的UI设计工具。 在Matisse的主页上,有一个使用Matisse设计UI的演示,挺有意思的。

Bob Foster是一个用Eclipse的engineer,就住在旧金山,所以他去参加了NetBeans Day。 在他的blog中,我们可以看看一个Eclipse工程师如何看待NetBeans Day 0。更多的关于JavaOne和NetBeans Day 0,可以参考Related Links中给出的链接。



Romain Guy’s Blog

NetBeans Day 2005: A Huge Success
Day 0: NetBeans Day
More JavaOne 2005 Photos

Yourit Technorati cosmos Refresh Technorati

June 26, 2005

Patterns and Practice [Erich Gamma]

Posted @ 9:22 am+8 in Programming, Patterns | Licensed under a Creative Commons License

这是Artima Developer的总编 Bill Venners对Erich Gamma的采访中的第四部分。在前三部分中,Bill和Erich讨论了如何思考和使用Design Pattern灵活性以及可重用性如何对Interface编程以及使用使用object composition而不是类继承

在第四部分中,Bill和Erich讨论了设计模式如何与解决问题相配对,设计模式如何帮助你理解问题解决得意图,以及如何通过练习成为一个好的设计师。

[Update: 一些心得]:

如何成为一个好的设计师?理解这些设计模式是不够的,仅仅只读完了GoF这本书也是不够的。还需要做甚呢?你需要练习,需要看代码,看其它好的设计师是如何设计系统的。

In addition to reading books, you need to read and understand lots of code, see how existing systems solve a particular problem and what experienced designers did. Basically what design patterns do is to tell you what these developers have done. But, just reading about it isn’t enough. You become a master by mimicking the work of excellent developers. ….. Not only do you learn about a particular development process you will also learn how to communicate about a design in a group of developers. As a good designer you not only come up with good designs you also communicate and defend them. You have to practice, like an apprentice in a way. Over time you’ll become as experienced as experienced designers.

作为一个新手,就算理解了GoF中的所有设计模式,也还是不够的,重要的,要知道,在什么时候,什么情况下,使用什么样的patterns。 而这往往是非常难的。 通常只有完成了之后,仔细思考自己的设计和代码的时候才会发现需要使用某个模式,或者某一种模式使用错了。 这个时候,就需要使用“重构”技术,来应用你觉得正确的模式。 只有练习再练习。

记住这句话:look to the master, follow the master, walk with the master, see through the master, become the master…


第一部分
第二部分
第三部分

Yourit Technorati cosmos Refresh Technorati

Design Principles from Design Patterns [Erich Gamma]

Posted @ 8:38 am+8 in Programming, Patterns | Licensed under a Creative Commons License

这是Artima Developer的总编 Bill Venners对Erich Gamma的采访中的第三部分。Bill 和 Erich 讨论了设计模式中的两个原则:对接口编程(program to an interface), 使用object composition而不是类继承。 在前两部分中,Bill和Erich讨论了如何思考和使用Design Pattern灵活性以及可重用性

[读后的一些心得]:

Erich第三部分中谈到,他希望支持Eclipse的整个社群,可以维持10到20年的生命期(“We always keep in mind as we design Eclipse that it has to last ten or twenty years. ….. I really mean that Eclipse should still be able to support an active community in ten or twenty years. ”),甚至更长(虽让他不敢奢望Eclipse社群会像埃及的金字塔一样保存上千年)。这种想法,现在确实已经非常普遍了,就连Sun的首席执行官Jonathan Schwartz也认为,“you can compete against a product, but it’s close to impossible to compete against a community. (和一个产品竞争容易,但是和一个社群竞争几乎接近不可能)”(Ecology, Communities and Platform Adoption)。所以,Sun也在不断的培养Solaris和Netbean的开发和使用者的社群。

Eclipse需要保持竞争力,关键也在于开发和使用者的这个社团。 Eclipse的plug-in架构,已经保证了这个社群会很快的成长(因为会有大量的开发者去写plug-in),大公司(如IBM,BEA,Borland)的加入和支持,也扩大了Eclipse的知名度,使得更多的开发者加入进去。 但是如何更好的融合这个社群,如何保证Eclipse的核心基础架构不受外部的困惑(变得更加庞大,或者臃肿)但又会不断创新,如何协调好Eclipse和其他Eclipse.org下面的顶级项目(如BIRT,WTP,AspectJ等)的整合关系,这些,确实也值得思考。

对interface编程,这个似乎是个老生常谈的问题了,但是却从来没有思考过,这种编程方式会影响到这个开发团队的协同工作,特别是一个超过10人的开发团队,而对一个分布在不同地方的开发团队(比如项目外包以后,不同的开发小组位于不同的城市,甚至国家),这种编程方式带来的影响更大。

为什么会这样呢? 在一个只有3-4人的开发团队里面,任何的改动,可以快速的通知其他的人,而且,现在IDE中的重构工具会解决大部分的工作。 但是,当一个开发团队变大的时候,通常就会分成小组,不同的小组对不同的部分负责。 在这种情况下,你在自己的模块中发布了API,你就必须确保这个API是稳定的。

“Once you have published an API then it is your responsibility to keep them stable. Otherwise you will break the other components and nobody is able to make progress. Having stable APIs is a key to making progress in a project of this size.”

所以这是一个是否把API发布以及发布了以后如何维护的问题:“So it’s the difference, as Martin Fowler would say, between public and published. Something can be public, but that doesn’t mean you have published it. ”即使定义了API,公开发布(publish)和这个API是公共的(public)是有区别的:API公开发布以后,就需要非常的小心,因为任何的API改动都可能会破坏其他在使用这个API的代码。


第一部分
第二部分

Yourit Technorati cosmos Refresh Technorati

灵活性和可重用 [Eric Gamma]

Posted @ 8:27 am+8 in Programming, Patterns | Licensed under a Creative Commons License

这是Artima Developer的总编Bill Venners对Erich Gamma的采访中的第二部分,Bill 和 Eric 讨论了重用性的重要性 (importance of reusability)。

重用的最高境界是什么?我们创建一个非常高层的,面向具体应用的框架,然后只要做简答的客户化,并且重用这个框架中现有的设计。(“We thought the way to create software was to build high-level, domain-specific frameworks, and then you just customize them and reuse all the design that is codified into them. That was the reuse nirvana.”)但是,连Eric都意识到,这太理想化了,因为 “I have learned that it’s hard to create highly reusable frameworks.”

在谈到可重用的framework的时候,Eric提到了Eclipse:

“A good example of how I like to see reuse at work is Eclipse. It’s built of components we call plug-ins. A plug-in bundles your code and there is a separate manifest where you define which other plug-ins you extend and which points of extension your plug-in offers. Plug-ins provide reusable code following explicit conventions to separate API from internal code. The Eclipse component model is simple and consistent too. It has this kernel characteristic. Eclipse has a small kernel, and everything is done the same way via extension points. The combination of a component model and the focus on APIs is one of the key ingredients of Eclipse. Controlled extensibility is another important one. (Eclipse是构构建在我们称之为plug-in的组件上面的。一个plug-in含有你的代码,而且详细定义了你从哪些其他的plug-in扩展而来,以及你的plug-in提供了哪些扩展点给别人使用。Plug-in提供了可重用的代码,而且遵循将API和内部的代码分离开。同时,Eclipse的组件模式简单而且一致。Eclipse只有一个很小的核心,所有其他的都市通过扩展点这种同样的方式来做的。Eclipse中的一个重要组成部分就是组件模型和面向API的方式的结合。另一个重要点则是受到控制的扩展性。)”

那么,什么又是Controlled extensibility呢?为什么要对扩展性进行控制呢?

“You can go and expose everything, and people can change anything. The original Smalltalks had some of this flavor. The problems start when the next version comes along. If you have exposed everything, you cannot change anything or you break all your clients. …
Also when you study the Eclipse API you will find that we go further than just specifying which classes are published API. The Eclipse API also specifies whether a class is intended to be subclassed. (你可以把一切都公布出来,SmallTalk就是这样做的。但是,当下一个版本出来的时候,可能就会碰到问题。如果你公布了一切,那么你就不能做改动了,活着你可能会破坏你的客户端使用的东西….在Eclipse里面,我们不仅仅定义了哪些类是公开的API,我们处理得更深层次,我们甚至定义了哪些API是可以被扩展的,哪些不可以。”

Eric对于重用,定义了三个级别:最低一级,重用类(classes);最高一级,框架(framework);而中间一级,就是设计模式(Design Pattern)

“This is where I see patterns. Design patterns are both smaller and more abstract than frameworks. They’re really a description about how a couple of classes can relate to each other and interact with each other. The level of reuse increases when you move from classes to patterns and finally frameworks. ”

Eric提到了一个有趣的现象。通常,我们拿到一个需求,会先做设计,做设计的时候,我们会使用设计模式(Design Pattern)。但是,使用XP (eXtreme Programming)方式的人不这样做,他们先写测试(“They write a test”)。

那么,设计一个framework的时候,要注意什么呢?要避免frameworkitis.

“Frameworks abstract and provide higher level default functionality. To do so the framework needs to be in control. This loss of control can lead to what is sometimes called frameworkitis. ”

Frameworkitis就是说,一个framework想要做的东西太多,或者它并不是按照你设想的做的而你又不能去改动它。(“Frameworkitis is the disease that a framework wants to do too much for you or it does it in a way that you don’t want but you can’t change it.”)

而且,一个framework要做的比较小,因为,如果framework太大了,那么它可能就会做太多(可能会frameworkitis),而且,不容易学习,学习曲线太长,也不容易维护。

Eria的论述真是非常精彩,而且也解释了Eclipse的一些内部设计。一定要阅读全文


第一部分

Yourit Technorati cosmos Refresh Technorati

如何思考Design Pattern?

Posted @ 8:14 am+8 in Programming, Patterns | Licensed under a Creative Commons License

Artima Developer的总编Bill Venners在对Erich Gamma的一次采访中,仔细讨论了Design Pattern(设计模式)的问题。当我们做设计的时候,我们首先会想到使用设计模式。那么如何使用设计模式?如何用设计模式进行思考?是否当你解决一个问题的时候,必须要使用设计模式?

Bill Venners将把这次访谈的内容分多次,发表在Artima Developer上。Erich Gamma的论述确实精彩,他不仅谈到了当初如何进入Design Pattern这个领域的过程,也谈到了在他开发JUnit的过程中,如何设计JUnit,以及如何在JUnit中使用Design Pattern。

“I think patterns as a whole can help people learn object-oriented thinking: how you can leverage polymorphism, design for composition, delegation, balance responsibilities, and provide pluggable behavior. Patterns go beyond applying objects to some graphical shape example, with a shape class hierarchy and some polymorphic draw method. You really learn about polymorphism when you’ve understood the patterns. So patterns are good for learning OO and design in general.”

“Patterns are distilled from the experiences of experts. They enable you to repeat a successful design done by someone else. By doing so you can stand on the shoulders of the experts and do not have to re-invent the wheel. ”

“Do not start immediately throwing patterns into a design, but use them as you go and understand more of the problem. Because of this I really like to use patterns after the fact, refactoring to patterns. …..
Trying to use all the patterns is a bad thing, because you will end up with synthetic designs—speculative designs that have flexibility that no one needs. These days software is too complex. We can’t afford to speculate what else it should do. We need to really focus on what it needs. ”

“We didn’t just string patterns together when we designed JUnit. We did it test-driven, starting with a test that we wanted to succeed and once it passed we looked into how we could improve the code. ”

第一次访谈的内容。

Who is Erich Gamma?(这个问题好像问的有些傻)
《Design Patterns: Elements of Reusable Object-Oriented Software》,《Contributing to Eclipse: Principles, Patterns, and Plug-Ins》的作者之一;JUnit的作者之一;EclipseJDT的负责人。他目前在IBM的瑞士苏黎世OTI实验室工作。

Yourit , Technorati cosmos Refresh Technorati

June 22, 2005

ProgrammingIcon 2005 June WebSphere Dev Tech Journal

Posted @ 1:45 pm+8 in Programming | Licensed under a Creative Commons License

The June 2005 issue of IBM WebSphere Developer Technical Journal is now available.

Some especially articles that I am interested in this issue:
 

Browse the journal online or download the PDF.

 

Yourit Technorati cosmos Refresh Technorati

ProgrammingIcon [收藏] “那本”J2EE书

Posted @ 9:21 am+8 in Programming | Licensed under a Creative Commons License

目前正在重读《Core J2EE Patterns》这本书。经历了几年的编程生活和系统设计,重读这本书的第二版,感触良多。 恰好看到gigix在blog中发表的“那本”J2EE书——《J2EE核心模式》(第二版)译者序 。 虽然我很少看中文的技术书籍,但是这篇译者序却值得收藏,收录在自己的blog中。借此,感谢译者翻译这本书,为广大的中国程序员带来了一本好书。

 

“那本”J2EE书
 
刘天北 熊节
 
(原文刊登于《中华读书报》2005年2月23日号)
 

  翻开这本《J2EE核心模式》,你首先就会注意到软件方法论领域的两位大师GradyBooch和MartinFowler撰写的序言。在这样两份序言后面再附上一篇“译序”,这个念头本身就足够荒谬和僭越,不啻于在莎翁之后再写一出关于丹麦王子复仇的剧本。大师们的判断是中肯而毫不含糊的:“没有这本书,就别开发EJB。”他们的担保足以确认本书在其论域中舍我其谁的地位。它就是“那本”J2EE书(THEJ2EEbook)。

  当然,对于广大中国开发者而言,我们早就已经在“没有这本书”的条件下开发了大量J2EE、乃至EJB应用系统。那些充满了波折和磨难的开发历程似乎让不少程序员产生了某种自信;在掌握了若干API细节、若干应用服务器配置诀窍、若干框架类库用法之后,他们或是公开、或是暗自地把自己当成了当之无愧的Java企业开发专家———不,这些话没有任何揶揄的意思:我们想说的其实是,本书恰恰是为以上这一类开发者写的。对于他们想成为
“Java企业开发专家”的隐秘欲望,这本《J2EE核心模式》就是最大限度的补救和成全。如果说,此前的各种教程都是在介绍J2EE开发中的“内容”要素———也就是,教给我们“做什么”———的话,本书关注的则是这里的“形式”要素,是“怎样做”才能开发出高效的、优雅的J2EE系统。读者从中学到的,将不仅仅是“J2EE技术”,而是“如何使用J2EE技术进行设计”。

  换句话说,如果你以前没有过J2EE实践,但明早将应聘一个需要“1年J2EE开发经验”的职位,本书中不包含你今晚要彻夜吞咽的那一类知识;相反,如果你,这位隐形的“Java企业开发专家”,追求的职位是“资深Java应用系统架构师”,如果你预料到未来的上司明天将问起“怎样实现访问控制”、“何时采用细粒度的接口设计”等“高阶”问题,那么恭喜你,今晚———乃至今后———你选对了补课的读物。

  作为本书第一版的忠实读者,我们(半是欣喜、半是惊讶)发现眼前的这部第二版构成了全新的阅读经验。作者们按照最新版J2EE技术规范(尤其是EJB2.1)全面修订了技术细节;根据模式社区的研究交流,作者们补入了若干模式;即使是一些不涉及技术更新的部分,论述方式、示例也完全不同于第一版;原有的PSA项目(第一版“尾声”一章)融入了其余各章的“示例代码”部分;而新增的整整一章讨论“微架构”的尾声、对WebService
等技术的关注、对各种的持久化方案(定制持久化、EJB、JDO等)的深入讨论,都体现出作者们对本书新版的持续投入。

  受益于本书有年,在此我们也想不揣冒昧地为本书的中国读者们建议一条高效的阅读路径:与第一章相比,第五章“J2EE模式概览”是读者更合理的起步点。请尤其关注其中对“分层”、“术语”和模式/策略区别的讨论,这些都是贯穿全书的重要概念!其次,应该通读第二章“表现层设计考虑和不佳实践”和第三章“业务层设计考虑和不佳实践”:即使你不打算使用任何模式,甚至,即使你根本不关心J2EE开发,只要你的工作与分布式企业应用系统有关,这两章考察的问题都是你迟早会遇到的。至于每个具体模式本身,我们则推荐读者留意其中详尽的“策略”部分和那些散布其中的“设计手记”。前者讨论了对同一个模式的多种实现方案,后者则突出介绍了特定开发领域的一些核心概念和考虑。

  一部英文技术论著在汉语中的旅行,永远是一段难以捉摸的行程。对于本书的汉语译者,“技术难度”并非挑战:全书讨论的正是译者们最为熟知的一个领域,所以我们能够负责任地说,在这个中译本里,没有任何技术细节会因为译者的无知或生疏而发生变形或曲解。这次翻译的原则和前提是对原文的彻底领会。

  事实上,译者的工作中遇到的困难主要发生在“语汇”层面。简单地说,J2EE专著的译者总要面对“翻,还是不翻”的两难处境:对象、函数的名称,UML图中的各种元素,这些内容由英语表示早就是约定俗成,即使是英语程度略低的开发者大概也都能读懂,所以,在读者能够理解的部分尽可能保留原文似乎是一种合理的做法———毕竟开发工作最终是与代码有关,而代码则肯定是要出之以“英文”的。但在另一方面,翻译的责任就在于让不谙原文的读者也能通达作品,如果译文中大量段落(不包括示例代码)都仍保留为英文或“类英文”,那么读者也就无法直观地获得原文包含的信息。反复权衡之后,在这个译本中译者的解决方式还是折衷的。工作中我们采取了以下原则:

  首先,术语尽可能采用通用文献定译,不自创译法。对于各个模式的名称、模式文档模版各部分名称、重构手法名称,我们参考了李英军等译《设计模式》、熊节等译《重构》等译作,以及IBMDe鄄veloperWorks中文网站的部分资源。

  其次,本领域的一些常见术语,如果没有定译,本书也不自我作古、强译为中文,而是保留英文原字。这一类的术语包括:applet、
servlet、bean、entitybean、sessionbean、cookie、WebService等。根据我们的观察,在日常工作中,国内的开发者已经习惯按原文使用以上术语。在一些情况下,我们也以注释形式澄清了这些术语的用法。

  第三,模式中的对象名称,往往按照代码风格命名,比如“BusinessObject”、“CustomerTO”等。如果对此完全不加翻译,那么很多充斥这类表达的段落就很难理解。我们的原则是,在每个自然段第一次出现某个这类表达方式时,用括号注明,比如 “BusinessObject(业务对象)”、“CustomerTO(客户传输对象)”等。希望这个做法能够维持易懂和简洁之间的平衡。

  第四,书中示例代码占有相当大的比重,而代码注释则是理解这些代码的关键。我们把所有代码注释译为中文。而对在视图中显示特定结果的代码(比如调试信息等),我们没有改为中文,只是在必要时对输出信息的涵义加以注解。如果读者更信赖代码原貌,还可以从本书官方网站http //www.corej2eepatterns.com/下载。

  第五,原书不包含注释。目前的所有注解都是译注。书中申义未畅处,译文中以方括号“
”加以解释、补足,略去生涩。这与上面两条原则一样,都类似于在原作讲话时的插嘴———但翻译任务本身,似乎本就已经是一种“插嘴”了。在博学的读者看来,有时候译者或许还不如保持体面的沉默———但我们只能力图做到插嘴而不多嘴。

  原书经多人、多版修订完成,难免存在打字、排印错误。译本根据本书官方网站的最新勘误表订正,并结合参照本书第一版,另外修正了数十处错误。

  (本文为即将于2005年3月出版的《J2EE核心模式》中文版的译序,本报刊登时有删节)

Get free blog up and running in minutes with Blogsome | Theme designs available here