Spring in practice Spring was originally conceived as a way to simplify Java Enterprise Edition (JEE) evelopment, but it’s not exactly a simple framework. It’s huge. The core framework is large, and dozens of portfolio projects extend that core, covering things like security,web flow, SOAP web services (REST web services are part of the core), enterprise integration,batch processing, mobile, various flavors of social , various flavors of NoSQL,Yet Spring does simplify Java development. As a general rule, it does so by isolating infrastructural concerns (such as persistence management and transaction management) from domain concerns. The framework handles the former so app developers can focus on the latter. In this respect, Spring is like JEE and even its earlier J2EE incarnation.40337
Spring’s approach—based on POJOs, dependency injection, and support for a wide variety of third-party libraries—proved to be more effective than J2EE with EJB. JEE closed the gap by adopting key elements of that approach. That Spring simplifies development without itself being simple isn’t paradoxical. Tools that simplify work don’t themselves have to be simple to learn. IDEs are a case in point.论文网
Model-view-controller (MVC) pattern, Spring’s approach to MVC, and its architectural underpinnings. Next you’ll try your hand at writing some Spring Web MVC code, with your goal being to get an intuitive feel for how things work in Spring Web MVC. The rest of the chapter offers a more systematic treatment of writing controllers and configuring web applications to use them. and so forth), the view involves JSPs or similar technologies, and the controller is usually servlet-based. HTTP requests come into the servlet, which routes the request to a handler component (sometimes called an action, sometimes called a controller) that in turn processes the request. The handler makes any necessary calls against the service tier and grabs any domain objects1 it needs to populate the view. Finally, the handler figures out which view to deliver and forwards processing to that view. Figure 3.1 shows the typical flow. The flow works like this. As shown in figure in 3.1, an HTTP request comes into the controller B. The controller accesses the model C, possibly getting data D, possibly updating the model, and possibly both. The controller then uses the view E to generate a response F, passing any relevant data it pulled out of the model. The client Spring Web MVC, as you might guess, is Spring’s web-centric MVC framework. Its primary job is to support the MVC way of piding application functionality, so it provides explicit support for organizing the web layer into models, views, and controllers. Separation between the three concerns is clean; for example, when a controller selects a view, it does so by selecting only a view name (not a View object, not a hardcoded path), and dependency injection makes it possible to treat even view names as injected values. Besides a clean separation of concerns, another major design goal for Spring Web MVC is lexibility. There are many ways for you to customize the way it works. If you want to use POJO controllers, you can do that. If you prefer defining an interface for controllers, you can do that too. You can control how requests map to controllers, how view names are generated, and how view names are resolved to views. You can define interceptor chains and exception handling for your controllers, and you can choose from different strategies for resolving locales, UI themes, multipart resolvers, and more.注:[Spring in practice willie wheeler with Joshua white]
Spring in practice
在最初的设想中,Spring作为一个用来简化Java企业的一个技术,这样才能够得到更好的发展,如果你认为这只是一个简单的框架的话,那就错了。Spring是一个核心框架,其核心是由十多个小的组件构成,并且可以在各个核心组件上进行多个发展,主要涵盖了数据安全,网路的流量等其中SOAP是作为web服务的一个核心部分,企业整合,批量处理。其中在基础方面看上去是复杂的,但在一定的开发中是简化了java开发。作为常规的规则,通过关注一些基础的配置和设施比如持久化和事务性管理中分割开来,实现代码和流程的解耦和。是程序员从需求设计和代码设计中分离出来,是开发人员更加专注与框架的使用,在耦合度的分离方面Spring较之于之前的任何框架是有过之而不及的。 java spring英文文献和中文翻译:http://www.youerw.com/fanyi/lunwen_38623.html