本周 Spring 动态,2011 年 12 月 20 日(节日版)

工程 | Josh Long | 2011年12月20日 | ...
<IMG src = "http://www.springsource.org/files/rod-holidays.png" width = "300" style = " float : right;  margin-left : 10px;  " />
	<P> 
		Well, it's that time of the year again!  

节日季来临,许多人将欢庆!无论您庆祝什么节日(或者是否庆祝),我都祝您度过美好的一周和最快乐的节日。
为了让您有所期待,本周的汇总内容满满的。
祝您使用愉快!



  1. 圣诞老人的精灵们可以从 SpringSource 的工程师那里学到不少东西!Alan Stewart 于周六宣布了 Spring Roo 1.2.0 GA。这个版本的 Roo 引起了很多人的关注。虽然有许多新功能,但我最喜欢的一些是多模块 Maven 项目支持(例如,允许您将模型类构建在一个独立于 Web 应用程序的项目中),支持 JSF / PrimeFaces 脚手架(而不是仅支持 GWT、Spring MVC、Vaadin 和 Flex),支持服务 / 存储库(使用 Spring Data JPA 和 Spring Data MongoDB;这补充了已有的 Active record 风格的数据访问对象),以及(更)灵活的 GWT 支持。

    			  </LI>
    		<LI>  When Spring 3.1 was released last week, I imagine <a href= "http://www.springsource.org/spring-gemfire">Spring Data Gemfire</a> and <a href = "http://www.springsource.org/spring-data/redis">Spring Data Redis</a> lead Costin Leau hit a big red button that he had prepared for just this occasion. 
    		First, Costin released <a href ="http://www.springsource.org/node/3336">Spring Data Gemfire 1.1.0</a> , 
    			which has <EM>numerous</EM> features!  
    			 Besides supporting Spring 3.1 (including a 3.1-compatible implementation of the Spring Cache API), Spring Data Gemfire 1.1.0  supports PDX (the binary object serialization type supported by Gemfire) attributes on the <CODE>&lt;cache/&gt;</code>, <CODE>&lt;client-cache/&gt;</CODE> namespace, it provides dedicated support for indices, better support for <CODE>Region</CODE> creation, <CODE>CacheServer</CODE> support, queries with variable parameters, and a <code>MessageListenerContainer</CODE> like abstraction that works with Gemfire's continuous queries (CQs). The CQ support is the basis of the GemFire inbound adapter support available in Spring Integration 2.1, due any minute now.. 
    			
    			   </LI>
    		<LI> Then, Costin released <a href ="http://www.springsource.org/node/3337">Spring Data Redis 1.0.0</a>, a major milestone in of itself!   
    			
    				This release, besides being compatible with Spring 3.1, supports atomic counters, a <CODE>RedisTemplate</CODE>, data access exception translation (consistent with the support you expect from all of Spring's data access technologies), a <CODE>MessageListenerContainer</CODE> abstraction that builds on Redis' pub-sub support, and much more!
    			</LI>
     	
    		<LI> But Costin wasn't the only one sitting on a Spring 3.1 compatible release. <a href ="http://www.springsource.org/spring-social">Spring Social</a>   lead Craig Walls    <a href= "http://www.springsource.org/spring-social/news/1.0.1-released">announced Spring Social 1.0.1</a>, which, besides being Spring 3.1- and Spring Security 3.1-compatible, also provides numerous bug fixes and updates.  </LI>
    		
    		 <LI>  
    				Did you guys miss <a href= "http://www.springone2gx.com">SpringOne 2GX 2011</a>? Or, were you, like me, just not able to see all concurrent sessions because those rascally laws of physics prevented you from being in many rooms at the same time? Well, don't fret, <A href ="http://www.infoq.com">InfoQ</a> has recorded many sessions from the conference, and will put them up periodically. 
    
    • 第一个视频是 Roy Clarkson(Spring MobileSpring Android 项目的负责人)和 Keith Donald(Spring “Web” 领域专家和 SpringSource 联合创始人)谈论如何使用 PhoneGap 构建更好、更原生的移动 Web 应用程序。说实话,我错过了这场精彩演讲的唯一原因是当时我正忙于准备我自己的演讲。的借口是什么,嗯?
    • Michael Hunger(Neo4J 的疯狂科学家和一位很棒的家伙)在 SpringOne2GX 上就 Spring Data Neo4J 发表了演讲。再次感谢 InfoQ
    • <LI> SpringSource consultant and engineer and all around great guy (seriously, if he's coming to your town, buy him a beer) <a href   = "http://www.dzone.com/links/r/messaging_for_modern_applications.html">Tom McCuch's talk about  messaging architectures in modern applications</a>  from SpringOne 2GX is up.    
      </li>
      <li>
      <a href="http://blog.springsource.org/author/peter-ledbrook/">Peter Ledbrook</a>, Developer Advocate for Grails, discusses running <a href="http://www.infoq.com/presentations/Grails-in-the-Cloud">Grails in the Cloud</a>. He compares the different cloud providers out there and looks at some of the best solutions for hosting your Grails applications.
      </lI>
      
  2. Oleg Zhurakousky(SpringSource 的高级工程师,Spring Integration 的主要贡献者)今年在 JavaOne 上接受了 InfoQ 的采访。

    观看这次采访,了解 Srini Penchikala(来自 InfoQ)和 Oleg Zhurakousky 谈论消息传递、Spring Integration 和云架构

    			  </LI> 
    		 			
    
        <LI> Greg Turnquist just announced <a href = "http://blog.springsource.org/2011/12/20/spring-python-1-1-1-1-2-1-and-1-3-0-rc1-are-released/">the latest releases of Spring Python, versions 1.1.1, 1.2.1, and 1.3.0.RC1</a>, the <em>Pythonic</EM> implementation of the Spring framework. These are two maintenance releases and one release candidate. Great stuff!
    		<LI> 
    			
    			Mihai Dinca-Panaitescu has written up a quick, but concise, blog on <a href= "http://java.dzone.com/articles/spring-3-and-application">how to configure beans using external values (property files, or external systems, all together) using Spring 3.0</a>.  
    			
    

    当然,Spring 3.1 现在也支持 Environment 抽象,这使得从 Java 配置中检索属性变得非常容易。因此,一如既往,Spring 会给你提供多种选择,在这种特定情况下,你有三种不同的方式可以达成目标。

  3. 同样,Aurelien Broszniowski 发表了博客,介绍 如何使用 Maven 的属性过滤在运行时设置系统属性

    对于不熟悉 Maven 的人来说,Maven 会自动替换属性(形式与 Spring 的属性支持相同:例如 ${foo}),如果您启用了资源过滤。因此,构建可以根据激活的 Maven 配置文件进行区分。结果是,一个配置文件会得到一个构建,另一个配置文件会得到另一个构建。

    处理这类问题的另一种方法可能是使用 Spring 3.1 的 @Profile 支持。

  4. Alex Staveley 撰写了一篇博客,几乎不使用代码就介绍了 如何使用 Spring 的 RestTemplate。这个说法有两个方面:Alex 具有简洁的写作天赋(长期关注本专栏的读者会知道我显然不具备这一点),而且 RestTemplate 确实就是那么简单!
  5. Eugen Paraschiv 又来了!这次他谈论的是 Spring 3 和 JPA 的持久层数据访问。这紧随 《简化 Spring 和 Java 泛型的 DAO 层》《Spring 3.1 和 Hibernate 的持久层》。所有这些都是很好的资源,我强烈推荐。有一点值得指出,Spring 框架提交者 Chris Beams 确实指出了,虽然这篇博客的示例使用了 Hibernate 3,但 Spring 3.1 也支持 Hibernate 4。
  6. 			Willie Wheeler has written up a blog detailing his approach to domain modeling using  <a href = "http://java.dzone.com/articles/domain-modeling-spring-data">Neo4j and Spring Data Neo4j</a>. 
    			
    			<a href ="http://www.neo4j.org">Neo4J</a>, of course, is the leading,  open source graph database, and <a href = "http://www.springsource.org/spring-data/neo4j">Spring Data Neo4j</a> makes taking advantage of Neo4j, and integrating graph domain models with existing JPA domain models, a sinch. Check out this blog for a real-world example of how. 
    			  
    			  </LI>		<LI>
    					 The many enhancements in Spring 3.1 sure have gotten a lot of people excited. Blogger Rafal Borowiec is among them, and has put together a comprehensive enumeration of <a href = "http://blog.goyello.com/2011/12/16/enhancements-spring-mvc31/">the top five
    					new features in Spring MVC 3.1</a>, citing the flash attributes support, improved JSR 303 validation support,     form-encoded <code>PUT</CODE> requests, and Java based configuration, among others. For more, and for examples, check out the blog!
    				</LI>
    				<LI> Long time Spring community superstars Cake Solutions has a great blog on <a href = "http://www.cakesolutions.net/teamblogs/2011/11/28/we-still-like-spring/">using Spock Extensions to simply integration testing with Spring</a>. Definitely worth a read, so check it out!   </LI>
    		<LI>  
    			Have you read Jim Webber's seminal <EM><a HREF = "http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CC4QFjAC&url=http%3A%2F%2Fshop.oreilly.com%2Fproduct%2F9780596805838.do&ei=WWvvTunRFMGQiAKftPi8Ag&usg=AFQjCNEWzzYfeDrtYro1a5A3NH6jjUx-Eg&sig2=f7lkOqKfdKuxs2Q_Y14DhQ">REST in Practice</a></EM>? The book describes, among other things, how to use REST. That is, it's one thing to think of REST as being an HTTP-centric RPC mechanism, but to really grok it is something else entirely. On this subject, I can recommend no finer reference than Jim's book and  of course <a href = "http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm">Roy Fielding's original work</a>. In Jim's book, however, he establishes an example of an automated coffee shop, <EM>RestBucks</EM>, which exposes an API. (This example itself is a twist on the example established in the simialarly seminal <EM>Patterns of Enterprise Architecture</EM>)  
    			It's a wonderful book, a fantastic example, and, more to the point,  it makes perfect fodder for blogger "Furious Bob" to <a href= "http://www.dzone.com/links/r/spring_31_rest_no_xml_caching_support_etag_and_ha.html">demonstrate a cleanly architected   application using Spring 3.1's enhanced REST support</a>.   
    			
    			 </LI> 
    
        <LI>  Tobias Flohre has put together a rather inspired post on <a href  = "http://blog.codecentric.de/en/2011/12/swt-and-springs-configurable-dependency-injection-for-the-ui">using Spring (and <CODE>@Configurable</CODE>) together with SWT</a>, the UI toolkit used to build such popular applications as Eclipse and SpringSource's very own <a href = "http://www.springsource.com/developer/sts">SpringSource Tool Suite</a>.  </LI>
    		<LI> GWT 2.4 surfaced the <CODE>RequestFactory</CODE> SPI, which is a framework SPI for the <EM>Service Locator</EM> pattern.  
    			So, blogger <EM>imrabti</EM> has details <a href  = "http://crazygui.wordpress.com/2011/09/23/spring-gwt-integration-using-the-requestfactory-api/">how to wire Spring as the <em>service locator</EM> for your GWT applications</a>. Naturally. There were actually a couple of blogs along this thread this week, but I saw this one first and the recipe is fundamentally the same. 
                        
    			</LI>
    		<LI>  
    			Jasypt, a simplified encryption library that integrates naturally with Spring and Spring Security, has <a href = "http://www.dzone.com/links/r/jasypt_19_published_java_simplified_encryption_su.html">just released Jasypt version 1.9.0</a>. Check out the <a href = "http://www.jasypt.org/whatsnew19.html"><EM>What's New</EM></a> section for the lowdown on the new features. Of particular   interest to the  Spring developer of late? The  3.1 support! 
    			</LI>
    		<LI> Blogger and <a href = "http://www.packtpub.com/spring-roo-1-1-cookbook/book"><EM>Spring Roo 1.1 Cookbook</EM></a> author Ashish Sarin has written a blog on how to <a href = "http://spring-roo.blogspot.com/2011/12/adding-json-support-to-domain-objects.html">add JSON support to domain entities and controllers using Spring Roo</a>. Nice job, Ashish!  </LI>
    		<LI>
    

    Spring in Practice 的作者兼博主 Willie Wheeler 写了一篇博客,这篇博客在上周一定会帮到我!在这篇博客中,Willie 描述了 如何配置 Jackson(一个 JSON 序列化库)使用 JAXB2(一个具有多种实现的 XML 序列化标准)的注解,并结合 Spring OXM 库。Spring 当然将其对象到 XML(或 OXM)模块作为其核心部分提供。其灵感在于,如果您想生成实体资源的 RESTful 视图,就需要使用像 JAXB 这样的 XML 视图生成器和 Jackson 这样的 JSON 视图生成器。如果您想配置从 Java 对象到另一种序列化的映射,通常会在 Java 对象上添加注解,这会导致领域实体带有冗余的映射注解(一个用于 JSON,一个用于 XML!)。现在,您可以为这两种目的使用相同的 JAXB2 注解。现在,如果我们也能减少 JAXB 和 JPA 之间的冗余就好了……

    			 </LI>
    		<LI> 
    			 Self described "Spring afficianado" (he certainly seems like one to me!) Shekhar Gulati has written about how he bootstrapped a proof-of-concept using  <a href = "http://www.springsource.org/roo">Spring Roo</a> and then added support for MongoDB replica sets using <a href = "http://www.springsource.org/spring-data/mongodb">Spring Data MongoDB</a>.  
    			
    			The blog shows <a href = "http://whyjava.wordpress.com/2011/12/12/using-mongodb-replica-set-with-spring-mongodb-1-0-0-rc1/">the Spring Roo commands and the Spring Data MongoDB integration</a> in detail.
    			  </LI>
                  		
                        <LI>Shekhar has got another post worthy of inclusion this week on how to <a href ="http://www.dzone.com/links/r/deploying_spring_roo_applications_on_jboss_as7.html">use Spring Roo to deploy an application against JBoss 7</a> (leveraging a <CODE>javax.sql.DataSource</CODE> configured in JBoss). Short and simple, as is the Roo way.  </LI>
    
                  
    		<LI>
    			
    			Gee, there's lots of GWT represented in this week's roundup! Frank Hinkel has contributed a blog about <a href = "http://frankhinkel.blogspot.com/2011/12/spring-web-and-smartgwt-integration.html">using Spring as the REST endpoint to a GWT  client</a>. To keep things interesting (if a bit odd!), he even uses a CDI security library through a Spring-CDI bridge on top of Spring to secure the Spring controller. He goes through the nitty gritty detail of how the development workflow works for a particular, open source application he's building called  "openKanban."  
    	
    	 </LI>	
     		<LI>  
    	 The Java Code Geeks have a blog that details <a href = "http://www.javacodegeeks.com/2011/12/configure-logback-logging-with-spring.html">how to use a <CODE>BeanPostProcessor</CODE> to systematically inject 
    	  SL4J <CODE>Logger</CODE> for any field that has a <CODE>@Log</CODE> annotation on it</a>. 
    	 This post is memorable for many reasons: one, it's <EM>useful</EM>! Additionally, it demonstrates how easy it is to have the container handle situations that  it doesn't already know how to handle without waiting for a new release. Remember, the very large majority of the Spring framework APIs are built on the same SPIs that are extended for everyday users!  
    	 </LI>
    	</OL>
    

    本周内容就到这里!节日快乐,下周再见!

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有