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
閱讀全文
摘要: 靜態(tài)分派(Static Dispatch),發(fā)生在編譯時(shí)期,分派是根據(jù)靜態(tài)類型信息發(fā)生的,方法重載就是靜態(tài)分派。
動(dòng)態(tài)分派(Dynamic Dispatch),發(fā)生在運(yùn)行時(shí)期,動(dòng)態(tài)分派動(dòng)態(tài)地置換掉某個(gè)方法。面向?qū)ο蟮恼Z言用動(dòng)態(tài)分派實(shí)現(xiàn)多態(tài)性。
Java語言支持靜態(tài)多分派和動(dòng)態(tài)的單分派,復(fù)用設(shè)計(jì)模式Java可以實(shí)現(xiàn)Double Dispatch,即訪問者模式。
閱讀全文
摘要: 要設(shè)計(jì)良好的架構(gòu),必須做到關(guān)注點(diǎn)分離,這樣可以產(chǎn)生高內(nèi)聚、低耦合的系統(tǒng),這是美麗架構(gòu)的終極原則
閱讀全文
摘要: 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
閱讀全文