05 2011 檔案
摘要: The Java community is now swamped with discussions about Oracle's patent suit against Google's Android platform. I've been contributing my opinion in several places, but there is one critical topic that needs repeating the same comments everywhere... so, this blog spills the beans once and completely.
閱讀全文
摘要: Activities in the system are managed as an activity stack. When a new activity is started, it is placed on the top of the stack and becomes the running activity -- the previous activity always remains below it in the stack, and will not come to the foreground again until the new activity exits.
閱讀全文
摘要: The one question I get more than any other is "How does Google test?" It's been explained in bits and pieces on this blog but the explanation is due an update
閱讀全文
摘要: Dependency injection asks us to separate the new operators from the application logic. This separation forces your code to have factories which are responsible for wiring your application together. However, better than writing factories, we want to use automatic dependency injection such as GUICE to do the wiring for us. But can DI really save us from all of the new operators?
閱讀全文
摘要: Everyone seems to think that they are writing OO after all they are using OO languages such as Java, Python or Ruby. But if you exam the code it is often procedural in nature
閱讀全文
摘要: 靜態分派(Static Dispatch),發生在編譯時期,分派是根據靜態類型信息發生的,方法重載就是靜態分派。
動態分派(Dynamic Dispatch),發生在運行時期,動態分派動態地置換掉某個方法。面向對象的語言用動態分派實現多態性。
Java語言支持靜態多分派和動態的單分派,復用設計模式Java可以實現Double Dispatch,即訪問者模式。
閱讀全文
摘要: 要設計良好的架構,必須做到關注點分離,這樣可以產生高內聚、低耦合的系統,這是美麗架構的終極原則
閱讀全文
摘要: A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point. CyclicBarriers are useful in programs involving a fixed sized party of threads that must occasionally wait for each other. The barrier is called cyclic because it can be re-used after the waiting threads are released.
閱讀全文
摘要: A java.util.concurrent.CountDownLatch is a concurrency construct that allows one or more threads to wait for a given set of operations to complete
閱讀全文