2007年10月8日

          site: http://www.joachim-bauch.de/tutorials/red5/MigrationGuide.txt

          Author: Joachim Bauch
          Contact: jojo@struktur.de
          Date: 2006-11-15 00:22:04 +0100 (Mi, 15 Nov 2006)
          Revision: 1540
          Id: MigrationGuide.txt 1540 2006-11-14 23:22:04Z jbauch

          Preface

          This document describes API differences between the Macromedia Flash Communication Server / Flash Media Server 2 and Red5. It aims at helping migrate existing applications to Red5.

          If you don't have an application in Red5 yet, please read the tutorial about howto create new applications first.

          Application callbacks

          When implementing serverside applications, one of the most important functionalities is to get notified about clients that connect or disconnect and to be informed about the creation of new instances of the application.

          Interface IScopeHandler

          Red5 specifies these actions in the interface IScopeHandler. See the API documentation for further details.

          Class ApplicationAdapter

          As some methods may be called multiple times for one request (e.g. connect will be called once for every scope in the tree the client connects to), the class ApplicationAdapter defines additional methods.

          This class usually is used as base class for new applications.

          Here is a short overview of methods of the FCS / FMS application class and their corresponding methods of ApplicationAdapter in Red5:

          FCS / FMS Red5
          onAppStart appStart roomStart
          onAppStop appStop roomStop
          onConnect appConnect roomConnect appJoin roomJoin
          onDisconnect appDisconnect roomDisconnect appLeave roomLeave

          The app* methods are called for the main application, the room* methods are called for rooms (i.e. instances) of the application.

          You can also also use the ApplicationAdapter to check for streams, shared objects, or subscribe them. See the API documentation for further details.

          Execution order of connection methods

          Assuming you connect to rtmp://server/app/room1/room2

          At first, the connection is established, so the user "connects" to all scopes that are traversed up to room2:

          1. app (-> appConnect)
          2. room1 (-> roomConnect)
          3. room2 (-> roomConnect)

          After the connection is established, the client object is retrieved and if it's the first connection by this client to the scope, he "joins" the scopes:

          1. app (-> appJoin)
          2. room1 (-> roomJoin)
          3. room2 (-> roomJoin)

          If the same client establishes a second connection to the same scope, only the connect methods will be called. If you conect to partially the same scopes, only a few join methods might be called, e.g. rtmp://server/app/room1/room3 will trigger

          1. appConnect("app")
          2. joinConnect("room1")
          3. joinConnect("room3")
          4. roomJoin("room3")

          The appStart method currently is only called once during startup of Red5 as it currently can't unload/load applications like FCS/FMS does. The roomStart methods are called when the first client connects to a room.

          Accepting / rejecting clients

          FCS / FMS provide the methods acceptConnection and rejectConnection to accept and reject new clients. To allow clients to connect, no special action is required by Red5 applications, the *Connect methods just need to return true in this case.

          If a client should not be allowed to connect, the method rejectClient can be called which is implemented by the ApplicationAdapter class. Any parameter passed to rejectClient is available as the application property of the status object that is returned to the caller.

          Current connection and client

          Red5 supports two different ways to access the current connection from an invoked method. The connection can be used to get the active client and the scope he is connected to. The first possibility uses the "magic" Red5 object:

          import org.red5.server.api.IClient;
          import org.red5.server.api.IConnection;
          import org.red5.server.api.IScope;
          import org.red5.server.api.Red5;
          public void whoami() {
          IConnection conn = Red5.getConnectionLocal();
          IClient client = conn.getClient();
          IScope scope = conn.getScope();
          // ...
          }
          

          The second possiblity requires the method to be defined with an argument of type IConnection as implicit first parameter which is automatically added by Red5 when a client calls the method:

          import org.red5.server.api.IClient;
          import org.red5.server.api.IConnection;
          import org.red5.server.api.IScope;
          public void whoami(IConnection conn) {
          IClient client = conn.getClient();
          IScope scope = conn.getScope();
          // ...
          }
          

          Additional handlers

          For many applications, existing classes containing application logic that is not related to Red5 are required to be reused. In order to make them available for clients connecting through RTMP, these classes need to be registered as handlers in Red5.

          There are currently two ways to register these handlers:
          1. By adding them to the configuration files.
          2. By registering them manually from the application code.

          The handlers can be executed by clients with code similar to this:

          nc = new NetConnection();
          nc.connect("rtmp://localhost/myapp");
          nc.call("handler.method", nc, "Hello world!");
          

          If a handler is requested, Red5 always looks it up in the custom scope handlers before checking the handlers that have been set up in the context through the configuration file.

          Handlers in configuration files

          This method is best suited for handlers that are common to all scopes the application runs in and that don't need to change during the lifetime of an application.

          To register the class com.fancycode.red5.HandlerSample as handler sample, the following bean needs to be added to WEB-INF/red5-web.xml:

          <bean id="sample.service"
          class="com.fancycode.red5.HandlerSample"
          singleton="true" />
          

          Note that the id of the bean is constructed as the name of the handler (here sample) and the keyword service.

          Handlers from application code

          All applications that use handlers which are different for the various scopes or want to change handlers, need a way to register them from the serverside code. These handlers always override the handlers configured in red5-web.xml. The methods required for registration are described in the interface IServiceHandlerProvider which is implemented by ApplicationAdapter.

          The same class as above can be registered using this code:

          public boolean appStart(IScope app) {
          if (!super.appStart(scope))
          return false;
          Object handler = new com.fancycode.red5.HandlerSample();
          app.registerServiceHandler("sample", handler);
          return true;
          }
          

          Note that in this example, only the application scope has the sample handler but not the subscopes! If the handler should be available in the rooms as well, it must be registered in roomStart for the room scopes.

          Calls to client methods

          To call methods from your Red5 application on the client, you will first need a reference to the current connection object:

          import org.red5.server.api.IConnection;
          import org.red5.server.api.Red5;
          import org.red5.server.api.service.IServiceCapableConnection;
          ...
          IConnection conn = Red5.getConnectionLocal();
          

          If the connection implements the IServiceCapableConnection interface, it supports calling methods on the other end:

          if (conn instanceof IServiceCapableConnection) {
          IServiceCapableConnection sc = (IServiceCapableConnection) conn;
          sc.invoke("the_method", new Object[]{"One", 1});
          }
          

          If you need the result of the method call, you must provide a class that implements the IPendingServiceCallback interface:

          import org.red5.server.api.service.IPendingService;
          import org.red5.server.api.service.IPendingServiceCallback;
          class MyCallback implements IPendingServiceCallback {
          public void resultReceived(IPendingServiceCall call) {
          // Do something with "call.getResult()"
          }
          }
          

          The method call looks now like this:

          if (conn instanceof IServiceCapableConnection) {
          IServiceCapableConnection sc = (IServiceCapableConnection) conn;
          sc.invoke("the_method", new Object[]{"One", 1}, new MyCallback());
          }
          

          Of course you can implement this interface in your application and pass a reference to the application instance.

          SharedObjects

          The methods to access shared objects from an application are specified in the interface ISharedObjectService.

          When dealing with shared objects in serverside scripts, special care must be taken about the scope they are created in.

          To create a new shared object when a room is created, you can override the method roomStart in your application:

          import org.red5.server.adapter.ApplicationAdapter;
          import org.red5.server.api.IScope;
          import org.red5.server.api.so.ISharedObject;
          public class SampleApplication extends ApplicationAdapter {
          public boolean roomStart(IScope room) {
          if (!super.roomStart(room))
          return false;
          createSharedObject(room, "sampleSO", true);
          ISharedObject so = getSharedObject(room, "sampleSO");
          // Now you could do something with the shared object...
          return true;
          }
          }
          

          Now everytime a first user connects to a room of a application, e.g. through rtmp://server/application/room1, a shared object sampleSO is created by the server.

          If a shared object should be created for connections to the main application, e.g. rtmp://server/application, the same must be done in the method appStart.

          For further informations about the possible methods a shared object provides please refer to the api documentation of the interface ISharedObject.

          Serverside change listeners

          To get notified about changes of the shared object similar to onSync in FCS / FMS, a listener must implement the interface ISharedObjectListener:

          import org.red5.server.api.so.ISharedObject;
          import org.red5.server.api.so.ISharedObjectListener;
          public class SampleSharedObjectListener
          implements ISharedObjectListener {
          public void onSharedObjectUpdate(ISharedObject so,
          String key, Object value) {
          // The attribute <key> of the shared object <so>
          // was changed to <value>.
          }
          public void onSharedObjectDelete(ISharedObject so, String key) {
          // The attribute <key> of the shared object <so> was deleted.
          }
          public void onSharedObjectSend(ISharedObject so,
          String method, List params) {
          // The handler <method> of the shared object <so> was called
          // with the parameters <params>.
          }
          // Other methods as described in the interface...
          }
          

          Additionally, the listener must get registered at the shared object:

          ISharedObject so = getSharedObject(scope, "sampleSO");
          so.addSharedObjectListener(new SampleSharedObjectListener())
          
          Changing from application code

          A shared object can be changed by the server as well:

          ISharedObject so = getSharedObject(scope, "sampleSO");
          so.setAttribute("fullname", "Sample user");
          

          Here all subscribed clients as well as the registered handlers are notified about the new / changed attribute.

          If multiple actions on a shared object should be combined in one update event to the subscribed clients, the methods beginUpdate and endUpdate must be used:

          ISharedObject so = getSharedObject(scope, "sampleSO");
          so.beginUpdate();
          so.setAttribute("One", "1");
          so.setAttribute("Two", "2");
          so.removeAttribute("Three");
          so.endUpdate();
          

          The serverside listeners will receive their update notifications through separate method calls as without the beginUpdate and endUpdate.

          SharedObject event handlers

          Calls to shared object handlers through remote_so.send(<handler>, <args>) from a Flash client or the corresponding serverside call can be mapped to methods in Red5. Therefore a handler must get registered through a method of the ISharedObjectHandlerProvider interface similar to the application handlers:

          package com.fancycode.red5;
          class MySharedObjectHandler {
          public void myMethod(String arg1) {
          // Now do something
          }
          }
          ...
          ISharedObject so = getSharedObject(scope, "sampleSO");
          so.registerServiceHandler(new MySharedObjectHandler());
          

          Handlers with a given name can be registered as well:

          ISharedObject so = getSharedObject(scope, "sampleSO");
          so.registerServiceHandler("one.two", new MySharedObjectHandler());
          

          Here, the method could be called through one.two.myMethod.

          Another way to define event handlers for SharedObjects is to add them to the red5-web.xml similar to the file-based application handlers. The beans must have a name of <SharedObjectName>.<DottedServiceName>.soservice, so the above example could also be defined with:

          <bean id="sampleSO.one.two.soservice"
          class="com.fancycode.red5.MySharedObjectHandler"
          singleton="true" />
          

          Persistence

          Persistence is used so properties of objects can be used even after the server has been restarted. In FCS / FMS usually local shared objects on the serverside are used for this.

          Red5 allows arbitrary objects to be persistent, all they need to do is implement the interface IPersistable. Basically these objects have a type, a path, a name (all strings) and know how to serialize and deserialize themselves.

          Here is a sample of serialization and deserialization:

          import java.io.IOException;
          import org.red5.io.object.Input;
          import org.red5.io.object.Output;
          import org.red5.server.api.persistence.IPersistable;
          class MyPersistentObject implements IPersistable {
          // Attribute that will be made persistent
          private String data = "My persistent value";
          void serialize(Output output) throws IOException {
          // Save the objects's data.
          output.writeString(data);
          }
          void deserialize(Input input) throws IOException {
          // Load the object's data.
          data = input.readString();
          }
          // Other methods as described in the interface...
          }
          

          To save or load this object, the following code can be used:

          import org.red5.server.adapter.ApplicationAdapter;
          import org.red5.server.api.IScope;
          import org.red5.server.api.Red5;
          import org.red5.server.api.persistence.IPersistenceStore;
          class MyApplication extends ApplicationAdapter {
          private void saveObject(MyPersistentObject object) {
          // Get current scope.
          IScope scope = Red5.getConnectionLocal().getScope();
          // Save object in current scope.
          scope.getStore().save(object);
          }
          private void loadObject(MyPersistentObject object) {
          // Get current scope.
          IScope scope = Red5.getConnectionLocal().getScope();
          // Load object from current scope.
          scope.getStore().load(object);
          }
          }
          

          If no custom objects are required for an application, but data must be stored for future reuse, it can be added to the IScope through the interface IAttributeStore. In scopes, all attributes that don't start with IPersistable.TRANSIENT_PREFIX are persistent.

          The backend that is used to store objects is configurable. By default persistence in memory and in the filesystem is available.

          When using filesystem persistence for every object a file is created in "webapps/<app>/persistence/<type>/<path>/<name>.red5", e.g. for a shared object "theSO" in the connection to "rtmp://server/myApp/room1" a file at "webapps/myApp/persistence/SharedObject/room1/theSO.red5" would be created.

          Periodic events

          Applications that need to perform tasks regularly can use the setInterval in FCS / FMS to schedule methods for periodic execution.

          Red5 provides a scheduling service (ISchedulingService) that is implemented by ApplicationAdapter like most other services. The service can register an object (which needs to implement the IScheduledJob interface) whose execute method is called in a given interval.

          To register an object, code like this can be used:

          import org.red5.server.api.IScope;
          import org.red5.server.api.IScheduledJob;
          import org.red5.server.api.ISchedulingService;
          import org.red5.server.adapter.ApplicationAdapter;
          class MyJob implements IScheduledJob {
          public void execute(ISchedulingService service) {
          // Do something
          }
          }
          public class SampleApplication extends ApplicationAdapter {
          public boolean roomStart(IScope room) {
          if (!super.roomStart(room))
          return false;
          // Schedule invokation of job every 10 seconds.
          String id = addScheduledJob(10000, new MyJob());
          room.setAttribute("MyJobId", id);
          return true;
          }
          }
          

          The id that is returned by addScheduledJob can be used later to stop execution of the registered job:

          public void roomStop(IScope room) {
          String id = (String) room.getAttribute("MyJobId");
          removeScheduledJob(id);
          super.roomStop(room);
          }
          

          Remoting

          Remoting can be used by non-rtmp clients to invoke methods in Red5. Another possibility is to call methods from Red5 to other servers that provide a remoting service.

          Remoting server

          Services that should be available for clients need to be registered the same way as additional application handlers are registered. See above for details.

          To enable remoting support for an application, the following section must be added to the WEB-INF/web.xml file:

          <servlet>
          <servlet-name>gateway</servlet-name>
          <servlet-class>
          org.red5.server.net.servlet.AMFGatewayServlet
          </servlet-class>
          </servlet>
          <servlet-mapping>
          <servlet-name>gateway</servlet-name>
          <url-pattern>/gateway/*</url-pattern>
          </servlet-mapping>
          

          The path specified in the <url-pattern> tag (here gateway) can be used by the remoting client as connection url. If this example would have been specified for an application myApp, the URL would be:

          http://localhost:5080/myApp/gateway
          

          Methods invoked through this connection will be executed in the context of the application scope. If the methods should be executed in subscopes, the path to the subscopes must be added to the URL like:

          http://localhost:5080/myApp/gateway/room1/room2
          
          Remoting client

          The class RemotingClient defines all methods that are required to call methods through the remoting protocol.

          The following code serves as example about how to use the remoting client:

          import org.red5.server.net.remoting.RemotingClient;
          String url = "http://server/path/to/service";
          RemotingClient client = new RemotingClient(url);
          Object[] args = new Object[]{"Hello world!"};
          Object result = client.invokeMethod("service.remotingMethod", args);
          // Now do something with the result
          

          By default, a timeout of 30 seconds will be used per call, this can be changed by passing a second parameter to the constructor defining the maximum timeout in milliseconds.

          The remoting headers AppendToGatewayUrl, ReplaceGatewayUrl and RequestPersistentHeader are handled automatically by the Red5 remoting client.

          Some methods may take a rather long time on the called server to complete, so it's better to perform the call asynchronously to avoid blocking a thread in Red5. Therefore an object that implements the interface IRemotingCallback must be passed as additional parameter:

          import org.red5.server.net.remoting.RemotingClient;
          import org.red5.server.net.remoting.IRemotingCallback;
          public class CallbackHandler implements IRemotingCallback {
          void errorReceived(RemotingClient client, String method,
          Object[] params, Throwable error) {
          // An error occurred while performing the remoting call.
          }
          void resultReceived(RemotingClient client, String method,
          Object[] params, Object result) {
          // The result was received from the server.
          }
          }
          String url = "http://server/path/to/service";
          RemotingClient client = new RemotingClient(url);
          Object[] args = new Object[]{"Hello world!"};
          IRemotingCallback callback = new CallbackHandler();
          client.invokeMethod("service.remotingMethod", args, callback);
          

          posted @ 2007-10-12 14:09 zibeline 閱讀(549) | 評(píng)論 (0)編輯 收藏


          site: http://www.flashseer.org/bbs/viewthread.php?tid=614&extra=page%3D1

          要用到openlaszlo,配置了一下開(kāi)發(fā)環(huán)境。
          把過(guò)程記錄下來(lái)。如果其他人也需要用,希望有幫助。

          http://www.openlaszlo.org/download 下載安裝文件

          安裝完成后可以看到openlaszlo自帶了一個(gè)tomcat,你訪問(wèn)的就是這個(gè)自帶的tomcat的一個(gè)應(yīng)用。
          openlaszlo和flex類似。也是根據(jù)xml語(yǔ)言,編譯生成文件,不過(guò),openlaslzo可以選擇生成swf,dhtml兩種格式。
          openlaszlo的開(kāi)發(fā)工具比較原始,ide4laszlo已經(jīng)被廢棄掉了。文檔上的兩種開(kāi)發(fā)方式,
          第一是在laszlo in 10 minutes 里面,有個(gè)界面,寫代碼,然后編譯,這個(gè)方式在學(xué)習(xí)的時(shí)候用
          第二在開(kāi)發(fā)的時(shí)候用,用文本編輯器編輯,然后輸入網(wǎng)址訪問(wèn)這個(gè)lzx文件。根據(jù)下面的控制面板編譯。

          我機(jī)器上本來(lái)就有tomcat,還有其它應(yīng)用。要用到的僅僅是安裝文件里面的那個(gè)應(yīng)用。

          用myeclipse建立一個(gè)j2ee工程,名稱為laszlo。

          把安裝目錄下:
          x:\Program Files\OpenLaszlo Server 4.0.5\Server\lps-4.0.5

          lps                            laszlo的組件庫(kù)
          WEB-INF\lps               laszlo的配置文件
          WEB-INF\lib                jar包
          WEB-INF\web.xml       web應(yīng)用的配置文件

          分別拷貝到webapp對(duì)應(yīng)的目錄下 。

          然后在建立一個(gè)client目錄,新建一個(gè)hello.lzx。
          輸入
          <canvas>
              <text>Hello Laszlo!</text>
          </canvas>

          你可以發(fā)布,或者在tomcat中指向現(xiàn)在這個(gè)工程。

          重啟你的tomcat,訪問(wèn) http://localhost:8080/laszlo/hello.lzx 就可以訪問(wèn)了。

          編輯lzx文件,我裝了一個(gè)xmlbuddy的eclipse插件,把它當(dāng)xml來(lái)編輯。
          但是xmlbuddy和myeclipse的xml editor有沖突,xml editor又不能指定去編輯lzx,有點(diǎn)郁悶,但是可以忍。不用了,再把xmlbuddy卸了就行了。

          還有想查閱laszlo的文檔。就把x:\Program Files\OpenLaszlo Server 4.0.5\Server\lps-4.0.5拷貝到你tomcat的webapps下,當(dāng)成一個(gè)應(yīng)用,直接用
          http://127.0.0.1:8080/lps-4.0.5
          就可以訪問(wèn)了。

          posted @ 2007-10-09 14:29 zibeline 閱讀(610) | 評(píng)論 (1)編輯 收藏

          site: http://www.javaeye.com/topic/52992

          《Java程序員的推薦閱讀書籍》

          JavaEye (http://www.javaeye.com)

          范凱(http://robbin.javaeye.com)

          作為Java程序員來(lái)說(shuō),最痛苦的事情莫過(guò)于可以選擇的范圍太廣,可以讀的書太多,往往容易無(wú)所適從。我想就我自己讀過(guò)的技術(shù)書籍中挑選出來(lái)一些,按照學(xué)習(xí)的先后順序,推薦給大家,特別是那些想不斷提高自己技術(shù)水平的Java程序員們。

          一、Java編程入門類

          對(duì)于沒(méi)有Java編程經(jīng)驗(yàn)的程序員要入門,隨便讀什么入門書籍都一樣,這個(gè)階段需要你快速的掌握J(rèn)ava基礎(chǔ)語(yǔ)法和基本用法,宗旨就是“囫圇吞棗不求甚解”,先對(duì)Java熟悉起來(lái)再說(shuō)。用很短的時(shí)間快速過(guò)一遍Java語(yǔ)法,連懵帶猜多寫寫代碼,要“知其然”。

          1、《Java編程思想》

          在有了一定的Java編程經(jīng)驗(yàn)之后,你需要“知其所以然”了。這個(gè)時(shí)候《Java編程思想》是一本讓你知其所以然的好書,它對(duì)于基本的面向?qū)ο笾R(shí)有比較清楚的交待,對(duì)Java基本語(yǔ)法,基本類庫(kù)有比較清楚的講解,可以幫你打一個(gè)良好的Java編程基礎(chǔ)。這本書的缺點(diǎn)是實(shí)在太厚,也比較羅嗦,不適合現(xiàn)代人快節(jié)奏學(xué)習(xí),因此看這本書要懂得取舍,不是每章每節(jié)都值得一看的,挑重點(diǎn)的深入看就可以了。

          2、《Agile Java》中文版

          這本書是出版社送給我的,我一拿到就束之高閣,放在書柜一頁(yè)都沒(méi)有翻過(guò),但是前兩天整理書柜的時(shí)候,拿出來(lái)一翻,竟然發(fā)現(xiàn)這絕對(duì)是一本好書!這本書一大特點(diǎn)是以單元測(cè)試和TDD來(lái)貫穿全書的,在教你Java各種重要的基礎(chǔ)知識(shí)的過(guò)程中,潛移默化的影響你的編程思維走向敏捷,走向TDD。另外這本書成書很新,以JDK5.0的語(yǔ)法為基礎(chǔ)講解,要學(xué)習(xí)JDK5.0的新語(yǔ)法也不錯(cuò)。還有這本書對(duì)于內(nèi)容取舍也非常得當(dāng),Java語(yǔ)言畢竟類庫(kù)龐大,可以講的內(nèi)容太多,這本書選擇的內(nèi)容以及內(nèi)容的多寡都很得當(dāng),可以讓你以最少的時(shí)間掌握J(rèn)ava最重要的知識(shí),順便培養(yǎng)出來(lái)優(yōu)秀的編程思路,真是一本不可多得的好書。

          雖然作者自己把這本書定位在入門級(jí)別,但我不確定這本書用來(lái)入門是不是稍微深了點(diǎn),我自己也準(zhǔn)備有空的時(shí)候翻翻這本書,學(xué)習(xí)學(xué)習(xí)。

          二、Java編程進(jìn)階類

          打下一個(gè)良好的Java基礎(chǔ),還需要更多的實(shí)踐經(jīng)驗(yàn)積累,我想沒(méi)有什么捷徑。有兩本書值得你在編程生涯的這個(gè)階段閱讀,培養(yǎng)良好的編程習(xí)慣,提高你的代碼質(zhì)量。

          1、《重構(gòu) 改善既有代碼的設(shè)計(jì)》

          這本書名氣很大,不用多介紹,可以在閑暇的時(shí)候多翻翻,多和自己的實(shí)踐相互印證。這本書對(duì)你產(chǎn)生影響是潛移默化的。

          2、《測(cè)試驅(qū)動(dòng)開(kāi)發(fā) by Example》

          本書最大特點(diǎn)是很薄,看起來(lái)沒(méi)有什么負(fù)擔(dān)。你可以找一個(gè)周末的下午,一邊看,一邊照做,一個(gè)下午就把書看完,這本書的所有例子跑完了。這本書的作用是通過(guò)實(shí)戰(zhàn)讓你培養(yǎng)TDD的思路。

          三、Java架構(gòu)師之路

          到這個(gè)階段,你應(yīng)該已經(jīng)非常嫻熟的運(yùn)用Java編程,而且有了一個(gè)良好的編程思路和習(xí)慣了,但是你可能還缺乏對(duì)應(yīng)用軟件整體架構(gòu)的把握,現(xiàn)在就是你邁向架構(gòu)師的第一步。

          1、《Expert One-on-One J2EE Design and Development》

          這本書是Rod Johnson的成名著作,非常經(jīng)典,從這本書中的代碼誕生了springframework。但是好像這本書沒(méi)有中譯本。

          2、《Expert One-on-One J2EE Development without EJB》

          這本書由gigix組織翻譯,多位業(yè)界專家參與,雖然署名譯者是JavaEye,其實(shí)JavaEye出力不多,實(shí)在是忝居譯者之名。

          以上兩本書都是Rod Johnson的經(jīng)典名著,Java架構(gòu)師的必讀書籍。在我所推薦的這些書籍當(dāng)中,是我看過(guò)的最仔細(xì),最認(rèn)真的書,我當(dāng)時(shí)讀這本書幾乎是廢寢忘食的一氣讀完的,有小時(shí)候挑燈夜讀金庸武俠小說(shuō)的勁頭,書中所講內(nèi)容和自己的經(jīng)驗(yàn)知識(shí)一一印證,又被無(wú)比精辟的總結(jié)出來(lái),讀完這本書以后,我有種被打通經(jīng)脈,功力爆增的感覺(jué)。

          但是后來(lái)我看過(guò)一些其他人的評(píng)價(jià),似乎閱讀體驗(yàn)并沒(méi)有我那么high,也許是因?yàn)槊總€(gè)人的知識(shí)積累和經(jīng)驗(yàn)不同導(dǎo)致的。我那個(gè)時(shí)候剛好是經(jīng)驗(yàn)知識(shí)積累已經(jīng)足夠豐富,但是還沒(méi)有系統(tǒng)的整理成型,讓這本書一梳理,立刻形成完整的知識(shí)體系了。

          3、《企業(yè)應(yīng)用架構(gòu)模式》

          Martin的又一本名著,但這本書我只是泛泛的看了一遍,并沒(méi)有仔細(xì)看。這本書似乎更適合做框架的人去看,例如如果你打算自己寫一個(gè)ORM的話,這本書是一定要看的。但是做應(yīng)用的人,不看貌似也無(wú)所謂,但是如果有空,我還是推薦認(rèn)真看看,會(huì)讓你知道框架為什么要這樣設(shè)計(jì),這樣你的層次可以晉升到框架設(shè)計(jì)者的角度去思考問(wèn)題。Martin的書我向來(lái)都是推崇,但是從來(lái)都沒(méi)有像Rod Johnson的書那樣非常認(rèn)真去看。

          4、《敏捷軟件開(kāi)發(fā) 原則、模式與實(shí)踐》

          Uncle Bob的名著,敏捷的經(jīng)典名著,這本書比較特別,與其說(shuō)是講軟件開(kāi)發(fā)過(guò)程的書,不如說(shuō)講軟件架構(gòu)的書,本書用了很大篇幅講各種面向?qū)ο筌浖_(kāi)發(fā)的各種模式,個(gè)人以為看了這本書,就不必看GoF的《設(shè)計(jì)模式》了。

          四、軟件開(kāi)發(fā)過(guò)程

          了解軟件開(kāi)發(fā)過(guò)程不單純是提高程序員個(gè)人的良好編程習(xí)慣,也是增強(qiáng)團(tuán)隊(duì)協(xié)作的基礎(chǔ)。

          1、《UML精粹》

          UML其實(shí)和軟件開(kāi)發(fā)過(guò)程沒(méi)有什么必然聯(lián)系,卻是軟件團(tuán)隊(duì)協(xié)作溝通,撰寫軟件文檔需要的工具。但是UML真正實(shí)用的圖不多,看看這本書已經(jīng)足夠了,完全沒(méi)有必要去啃《UML用戶指南》之類的東西。要提醒大家的是,這本書的中譯本翻譯的非常之爛,建議有條件的看英文原版。

          2、《解析極限編程 擁抱變化》XP

          這是Kent Beck名著的第二版,中英文對(duì)照。沒(méi)什么好說(shuō)的,必讀書籍。

          3、《統(tǒng)一軟件開(kāi)發(fā)過(guò)程》UP

          其實(shí)UP和敏捷并不一定沖突,UP也非常強(qiáng)調(diào)迭代,測(cè)試,但是UP強(qiáng)調(diào)的文檔和過(guò)程驅(qū)動(dòng)卻是敏捷所不取的。不管怎么說(shuō),UP值得你去讀,畢竟在中國(guó)真正接受敏捷的企業(yè)很少,你還是需要用UP來(lái)武裝一下自己的,哪怕是披著UP的XP。

          4、《敏捷建模》AM

          Scott Ambler的名著,這本書非常的progmatic,告訴你怎么既敏捷又UP,把敏捷和UP統(tǒng)一起來(lái)了,又提出了很多progmatic的建議和做法。你可以把《解析極限編程 擁抱變化》、《統(tǒng)一軟件開(kāi)發(fā)過(guò)程》和《敏捷建模》這三本書放在一起讀,看XP和UP的不同點(diǎn),再看AM是怎么統(tǒng)一XP和UP的,把這三種理論融為一爐,形成自己的理論體系,那么你也可以去寫書了。

          五、軟件項(xiàng)目管理

          如果你突然被領(lǐng)導(dǎo)提拔為項(xiàng)目經(jīng)理,而你完全沒(méi)有項(xiàng)目管理經(jīng)驗(yàn),你肯定會(huì)心里沒(méi)底;如果你覺(jué)得自己管理項(xiàng)目不善,很想改善你的項(xiàng)目管理能力,那么去考PMP肯定是遠(yuǎn)水不解近渴的。

          1、《快速軟件開(kāi)發(fā)》

          這也是一本名著。可以這樣說(shuō),有本書在手,你就有了一個(gè)項(xiàng)目管理的高級(jí)參謀給你出謀劃策,再也不必?fù)?dān)心自己不能勝任的問(wèn)題了。這本書不是講管理的理論的,在實(shí)際的項(xiàng)目管理中,講這些理論是不解決問(wèn)題的,這本書有點(diǎn)類似于“軟件項(xiàng)目點(diǎn)子大全”之類的東西,列舉了種種軟件項(xiàng)目當(dāng)中面臨的各種問(wèn)題,以及應(yīng)該如何解決問(wèn)題的點(diǎn)子,你只需要稍加變通,找方抓藥就行了。

          六、總結(jié)

          在這份推薦閱讀書籍的名單中,我沒(méi)有列舉流行的軟件框架類學(xué)習(xí)書籍,例如Struts,Hibernate,Spring之類,也沒(méi)有列舉AJAX方面的書籍。是因?yàn)檫@類書籍容易過(guò)時(shí),而上述的大半書籍的生命周期都足夠長(zhǎng),值得你去購(gòu)買和收藏。

          posted @ 2007-10-08 23:08 zibeline 閱讀(183) | 評(píng)論 (0)編輯 收藏

          主站蜘蛛池模板: 象山县| 防城港市| 偏关县| 甘泉县| 麻栗坡县| 揭东县| 长汀县| 青神县| 宿迁市| 平阴县| 崇左市| 石泉县| 阳原县| 突泉县| 霍山县| 新昌县| 东安县| 博兴县| 沾化县| 突泉县| 富平县| 淮滨县| 汤原县| 河北区| 兴安县| 张北县| 平顶山市| 合阳县| 临清市| 寻甸| 资兴市| 凉山| 确山县| 合阳县| 视频| 泰宁县| 仪陇县| 崇州市| 军事| 濉溪县| 石台县|