From 87e08f7b994b4165fa86c58db39c653683c8f85e Mon Sep 17 00:00:00 2001 From: Mic Date: Tue, 29 Jan 2013 13:08:48 +0800 Subject: [PATCH] misc updates to tutorial page --- src/main/webapp/resources/html/tutorial.html | 127 +++++++------------ 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/src/main/webapp/resources/html/tutorial.html b/src/main/webapp/resources/html/tutorial.html index e1a408bc0..13250f174 100644 --- a/src/main/webapp/resources/html/tutorial.html +++ b/src/main/webapp/resources/html/tutorial.html @@ -31,22 +31,22 @@ frameworks that can be used independently or collectively to build industrial strength applications of many different types. The PetClinic sample application is designed to show how the Spring - application frameworks can be used to build simple, but powerful + framework can be used to build simple, but powerful database-oriented applications. It will demonstrate the use of Spring's core functionality:

- The Spring frameworks provide a great deal of useful infrastructure to + The Spring framework provides a great deal of useful infrastructure to simplify the tasks faced by application developers. This infrastructure helps developers to create applications that are:

@@ -55,15 +55,15 @@
  • concise by handling a lot of the complex control flow that is needed to use the - Java API's, such as JDBC, JNDI, JTA, RMI, and EJB. + Java API's, such as JDBC, JNDI, JTA, RMI.
  • flexible by simplifying the process of external application configuration - through the use of Reflection and JavaBeans. This allows the developer to + through the use of Reflection and POJOs (Plain Old Java Objects). This allows the developer to achieve a clean separation of configuration data from application code. All application and web application objects, including validators, - workflow controllers, and views, are JavaBeans that can be configured + workflow controllers, and views, are POJOs that can be configured externally.
  • testable @@ -77,8 +77,7 @@ from the Presentation layer. PetClinic demonstrates the use of a Model-View-Controller based web presentation framework that can work seamlessly with many - different types of view technologies. The Spring web application - framework helps developers to implement their Presentation as a clean + different types of view technologies. Spring MVC helps developers implement their Presentation as a clean and thin layer focused on its main missions of translating user actions into application events and rendering model data.
  • @@ -133,13 +132,8 @@

    The sample application should be usable with any Java EE web application container that is compatible with the Servlet 2.4 and JSP 2.0 - specifications. Some of the deployment files provided are designed - specifically for Apache Tomcat. These files specify container-supplied - connection-pooled data sources. It is not necessary to use these files. - The application has been configured by default to use a data source - with connection pooling. Configuration details are - provided in the Developer Instructions section. The view technologies - that are to be used for rendering the application are Java Server Pages + specifications. + The view technologies that are to be used for rendering the application are Java Server Pages (JSP) along with the Java Standard Tag Library (JSTL).

    @@ -147,10 +141,9 @@

    The sample application uses a relational database for data storage. Support has been provided for a choice of 1 of 2 database selections, - MySql or HypersonicSQL. HypersonicSQL version 1.8.0 is the default - choice. It is possible to - easily configure the application to use either database. Configuration - details are provided in the Developer Instructions section. + MySql or HypersonicSQL. HypersonicSQL is the default + choice. It is possible to easily configure the application to use either database. + Configuration details are provided in the Developer Instructions section.

    Development Environment

    @@ -162,10 +155,9 @@

    @@ -312,16 +304,15 @@

    Logging

    Spring supports the use of the Apache Commons Logging API. This API - provides the ability to use Java 1.4 loggers, the simple Commons loggers, - and Apache log4j loggers. PetClinic uses log4j to provide sophisticated - and configurable logging capabilities. The file, - src/main/resources/log4j.properties - configures the definition of log4jloggers. + provides the ability to use Java SE loggers, the simple Commons loggers, + and Apache Log4J loggers. PetClinic uses Log4J. The file, + src/main/resources/log4j.xml + configures the definition of Log4J loggers.

    Business Layer

    - The Business Layer consists of a number of basic JavaBean classes + The Business Layer consists of a number of basic Java classes representing the application domain objects and associated validation objects that are used by the Presentation Layer. The validation objects used in PetClinic are all implementations of the @@ -330,7 +321,7 @@

    - -

    Business / Persistence Layer

    @@ -391,9 +370,8 @@

    @@ -441,19 +419,14 @@ implementations of the org.springframework.transaction.PlatformTransactionManager interface. All of the implementations are by default configured - to use a local DataSource that - will work in any environment through the use of an instance of - org.springframework.jdbc.datasource.DriverManagerDataSource. - While this is appropriate for use in a demo or single user - program, a connection pooling DataSource, - such as an instance of org.apache.commons.dbcp.BasicDataSource, - is more appropriate for use in a multi-user application. Another - alternative is to obtain one through the Java EE environment + to use Database connection pooling through + an instance of org.apache.commons.dbcp.BasicDataSource. + Another alternative would be to obtain one through the Java EE environment using an instance of org.springframework.jndi.JndiObjectFactoryBean.

    -

    JDBC Clinic Implementation

    +

    JDBC Repository Implementations

    Spring provides a number of high-level database access convenience classes in the package @@ -479,18 +452,16 @@

    - The JDBC implementation of the Clinic interface is - org.springframework.samples.petclinic.jdbc.JdbcClinicImpl, - which uses Java 5 language features, - org.springframework.jdbc.core.simple.SimpleJdbcTemplate, and + The JDBC Repository implementations are located inside + org.springframework.samples.petclinic.repository.jdbc. + They use + org.springframework.jdbc.core.JdbcTemplate, and org.springframework.jdbc.core.simple.SimpleJdbcInsert. It also takes advantage of classes like org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource and org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper which provide automatic mapping between JavaBean properties and JDBC - parameters or query results. SimpleJdbcClinic is a rewrite of the - AbstractJdbcClinic which was the base class for JDBC implementations of - the Clinic interface for Spring 2.0. + parameters or query results.

    @@ -499,30 +470,20 @@ that can be used for local transactions.

    -

    Hibernate 3 Clinic Implementation

    +

    Java Persistence API (JPA) Repository Implementations

    - The Hibernate 3 implementation of the Clinic - interface is - org.springframework.samples.petclinic.hibernate.HibernateClinic. - To simplify using Hibernate, Spring provides the - org.springframework.orm.hibernate3.LocalSessionFactoryBean. - The Hibernate configuration is provided by the file src/main/resources/petclinic.hbm.xml. -

    - -

    Java Persistence API (JPA) Clinic Implementation

    -

    - The JPA implementation of the Clinic - interface is - org.springframework.samples.petclinic.jpa.JpaClinicImpl, - which is based on native JPA usage combined with Spring's + The JPA Repository implementations are located inside + org.springframework.samples.petclinic.repository.jpa. + They are based on native JPA usage combined with Spring's @Repository and @Transactional annotations but - otherwise has no dependencies on any Spring API's. + otherwise have no dependencies on any Spring API's. To simplify JPA usage, Spring provides (among other classes) the org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean. The JPA configuration is provided by src/main/resources/META-INF/orm.xml and src/main/resources/META-INF/persistence.xml. + The JPA implementation used by Petclinic is Hibernate.

    ApplicationContext

    @@ -533,7 +494,7 @@ constitute the Business/Persistence Layer of PetClinic. The following beans are defined in all 3 versions (1 per access strategy) of the PetClinic - src/main/webapp/WEB-INF/applicationContext-*.xml + src/main/resources/spring/applicationContext-*.xml file:

    @@ -545,7 +506,7 @@ properties file, in this case, JDBC-related settings for the dataSource bean described below - (see src/main/resources/jdbc.properties). + (see src/main/resources/spring/jdbc.properties).
  • dataSource, which is a singleton bean that defines the implementation of the source