Java Nio (6) 更多

  • 第116页
    * eight-byte buffer is used to send/recieve. But getLong() * eight-byte buffer is used to send/receive. But getLong()
  • 第110页
    Socket channels are thread-safe. Multiple threads do not need to take special steps to protect against concurrent access, but only one read and one write operation will be in progress at any given ...
  • 第55页
    View buffers can potentially be much more efficient when derived from direct byte buffers. If the byte order of the view matches the native hardware byte order, the low-level code may be able to ac...
  • 第51页
    If a buffer was created as a view of a ByteBuffer object (see Section 2.4.3), then the value returned by the order() method is the byte-order setting of the originating ByteBuffer at the time the v...
  • 第35页
    The effect of calling compact() is to drop the data elements already drained, preserve what hasn't been drained, and make the buffer ready to resume filling to capacity. You can use a buffer in thi...
  • 第32页
    for (int i = 0; buffer.hasRemaining(), i++) { myByteArray [i] = buffer.get(); } int count = buffer.remaining(); for (int i = 0; i < count, i++) { } myByteArray [i] = buffer.get()...

Groovy for Domain-Specific Languages (5)

  • 第200页
    When we declare a Groovy method that accepts a closure as its last parameter, Groovy allows us to define the body of the inline closure immediately after the method call containing the other parame...
  • 第259页
    void testUpgradeToPlusReward() { assert account.points == 120 bbPlus.upgrade(account, "PLUS") // Should have 250 for PLUS and 100 bonus assert account.points == 350 bbPlus.upgrade(account, "PREMI...
  • 第236页
    [勘误] // lookup account in binding def account = new Account() binding.account = account binding.monthSpend = account.spend = Account.&credit 应为 // lookup account in binding d... (1回应)
  • 第254页
    勘误 shell.evaluate("on_consume.delegate = this;onConsume()") 应为 shell.evaluate("onConsume.delegate = this;onConsume()") shell.evaluate("on_purchase.delegate = this;onPurchase()") 应为 shell.eval...
  • 第68页
    [勘误] 可能是印刷问题 本页代码中 [1..9]* each { 应为 [1..9]*.each { ["three","two","one","liftoff"] each { 应为 ["three","two","one","liftoff"].each {

深入浅出设计模式(影印版) (1)

  • 第100页
    Don't feel alone if you said "whoa" the first (and second and third) time you looked at this API.

Spring Batch in Action (2)

  • 第41页
    What are the benefits of the persistent job repository? The benefits are monitoring, restart, and clustering. You can browse the batch execution metadata to moni- tor your batch executions. When a ...
  • 第39页
    (Don't worry if you see an exception in the console: we purposely fail one job execution)

POJOs IN ACTION中文版 (6) 更多

  • 第359页
    Transaction Script模式... 所以,这种模式只应该在这样的情况下应用:应用程序的业务逻辑及其简单,或者持久层框架访问数据库的效率不够高时。
  • 第247页
    这些类按如下方式阻止在一起。当表示层调用PlaceOrderFacade时,Spring TransactionInterceptor便开始一项事务,并打开一个持久层框架连接,供仓库使用。PlaceOrderFacadeImpl则调用领域模型类验证输入并执行计算...
  • 第245页
    另一个主要区别是POJO facade向表示层返回领域对象而不返回DTO。例如,稍后你将看到,实现“下订单”用例的POJO facade会返回PendingOrder领域对象,而不返回包含其数据拷贝的DTO。由于你不必为每个领域对象定义D...
  • 第116页
    ORM的限制 另外,你也许设计了一个领域模型,无法映射到合乎要求的数据库模式。如果真的碰到这种情况,你久必须修改领域模型和数据库模式两者之一...但是,一旦修改了数据库模式,那我就需要相应地更改领域模型。
  • 第88页
    访问仓库的各种选择 仓库主要由领域服务使用,不过它们也被一些实体如PendingOrder调用。要对仓库对象调用方法,调用者必须明显持有该对象的引用。此前你已看到仓库如何作为构造函数参数传入PlaceOrderSerivce。...
  • 第74页