Spring.net + FluorineFx one of the project structure. Build Spring environment (configuration files)

2010-09-12  来源:本站原创  分类:DotNet  人气:200 

First, set up Spring.net environment

1.1 Construction works and library

First of all we have to build solutions, and all the required libraries. Process, the preparation of a user login function.

Need to install the program 1.1.1

Microsoft Visual Studio 2008. (Development environment, goes without saying);
FX_setup.exe. (With the Flex front communication plug-ins);
Enterprise Library. (Enterprise library);
ODTwithODAC1110720. (Oracle client);

1.1.2 the establishment of various functional areas

First create a new "blank solution." Followed by about libraries.

Add item.

Serial number

Project

Class Library

Name

Use

Add a reference to

New Project

FuorineFx ServiceLibrary

Li. FuorineFx

Associated with the Flex Communications

Data, Extension, Interface, Service

New Website

FluorineFx ASP.NET Web Site

Li.WebService

Associated with the Flex Communications

New library

Aspect

Li. Aspect

Code Injection

Data,

New library

Data

Li.Data

Entity class

New library

DataAccess

Li. DataAccess

Database operations

Data

New library

Extension

Li. Extension

Add class methods

New library

Interface

Li. Interface

Excuse

New library

Service

Li. Service

Business processing

Data, Extension, Interface, Service

Finally the class library into the default namespace, Li, this can be built inside the package, the name is not repeated.

Spring.net + FluorineFx one of the project structure. Build Spring environment (configuration files)

1.2 Add, change the configuration file

1.3.2 Add the class library configuration file

File attributes, generate action: Embedded Resource. Will not change the error.

① Service class library configuration file

<?xml version="1.0" encoding="utf-8"?>
      <objects xmlns="http://www.springframework.net">
</objects>

② DataAccess class library configuration file

<?xml version="1.0" encoding="utf-8"?>
 <objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database">

  <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
    <property name="ConfigSections" value="dbSettings" />
  </object>

  <db:provider provider="Oracle.DataAccess.Client" connectionString="DATA SOURCE=${db.source};PERSIST SECURITY INFO=True;USER${db.user};PASSWORD=${db.password};MAX POOL SIZE=100" />

  <object type="Spring.Data.Generic.AdoTemplate, Spring.Data">
    <property name="DbProvider" ref="dbProvider" />
    <property name="DataReaderWrapperType" value="Spring.Data.Support.NullMappingDataReader, Spring.Data" />
  </object>

  <object type="Spring.Data.Core.AdoPlatformTransactionManager, Spring.Data">
    <property name="DbProvider" ref="dbProvider" />
  </object>

</objects>

1.3.3 change the Web.config configuration file

Add in the configSections ①

sectionGroup name="spring" >

            <section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core"/>

            <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>

            <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>

</sectionGroup>

② Add the configuration

<spring>

  <parsers>

    <parser type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop"/>

    <parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"/>

    <parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data"/>

  </parsers>

  <context type="Spring.Context.Support.WebApplicationContext, Spring.Web">

    <resource uri="config://spring/objects"/>

  </context>

  <objects xmlns="http://www.springframework.net" xmlns:aop="http://www.springframework.net/aop" xmlns:db="http://www.springframework.net/database" xmlns:tx="http://www.springframework.net/tx">

    <import resource="assembly://Li.DataAccess/Li.Config/Dao.xml"/>

    <import resource="assembly://Li.Service/Li.Config/Service.xml"/>  </objects>

</spring>

③ Adding in the httpHandlers

<remove path="*.aspx" verb="*"/>

<add path="*.aspx" verb="*" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>

④ add in httpModules

<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>

⑤ in system.webServer add modules under

<remove name="Spring"/>

<add name="Spring" preCondition="integratedMode" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>

⑥ add in system.webServer handlers

<remove name="SpringContextMonitor"/>

<remove name="SpringPageHandler"/>

<add name="SpringContextMonitor" verb="*" path="ContextMonitor.ashx" preCondition="integratedMode" type="Spring.Web.Support.ContextMonitor, Spring.Web"/>

<add name="SpringPageHandler" verb="*" path="*.aspx" preCondition="integratedMode" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>

⑦ add tag database

<!--  New database tags   -->

 Ⅰ.  configSections Add  

<section name="dbSettings" type="System.Configuration.NameValueSectionHandler"/>

 Ⅱ.  configuration Add  

  <dbSettings>

    <add key="db.source" value="192.1.1.108:1521/uims"/>

    <add key="db.user" value="uims"/>

    <add key="db.password" value="uims"/>

  </dbSettings>

⑧ statement code injection (where the corresponding class in the establishment of complete, add)

<object type="Li.Aspect.InterceptorMethod, Li.Aspect"/>

<object type="Li.Aspect.InterceptorThrow, Li.Aspect"/>

<object type="Li.Aspect.InterceptorTransaction, Li.Aspect"/>

<!--  Declare entry points  1 -->

<object type="Spring.Aop.Support.AttributeMatchMethodPointcut, Spring.Aop">

  <property name="Attribute" value="Li.Attributes.GeneralAttribute, Li.Aspects"/>

</object>

<!--  Declare entry points  2 -->

<object type="Spring.Aop.Support.AttributeMatchMethodPointcut, Spring.Aop">

  <property name="Attribute" value="Spring.Transaction.Interceptor.TransactionAttribute, Spring.Data"/>

</object>

<!-- The starting point is associated  1-->

<aop:config>

  <aop:advisor advice-ref="interceptorMethod" pointcut-ref="serviceMethodAttributePointcut"/>

  <aop:advisor advice-ref="interceptorThrow" pointcut-ref="serviceMethodAttributePointcut"/>

</aop:config>

<tx:attribute-driven/>

<!-- The starting point is associated  2-->

<aop:config>

  <aop:advisor advice-ref="interceptorTransaction" pointcut-ref="transactionAttributePointcut"/>

</aop:config>

相关文章
  • Spring.net + FluorineFx one of the project structure. Build Spring environment (configuration files) 2010-09-12

    First, set up Spring.net environment 1.1 Construction works and library First of all we have to build solutions, and all the required libraries. Process, the preparation of a user login function. Need to install the program 1.1.1 Microsoft Visual Stu

  • Spring.net + FluorineFx project structures of the three. Write code for Flex Interface 2010-09-12

    Third, the preparation of the Remoting call interface code for Flex 3.1 Sample preparation of the default content type When creating a "FluorineFx ServiceLibrary" class library, the default will generate a Sample class, in such a way to add, the

  • J2EE project structure best practices 2010-06-18

    J2EE project structure best practices article Category: Java programming project-based worst practice can be summarized as a set of best practice principles of project structure for future use and improvement of the complex. Principle 1. Time is alwa

  • Project Structure Plug-in Project 2010-11-13

    1) plug-in configuration files: MANIFEST.MF, plugin.xml 2) java class file: must include the Activator, Application, Perspective and 3 Adivsor class 3) Component properties file: build.properties 4) The specific structure of image files and other res

  • WEB Integration Project in the Spring Framework 2010-11-20

    1. Create WEB engineering the process. 2. Spring2.5.6 have to add the jar package. spring.jar and common-logging.jar, 3. New spring configuration file. May be one or more configuration files, most of all is the development of multiple profiles 4. In

  • ibatis + spring + struts environment configuration 2009-10-23

    ibatis + spring + struts environment configuration Steps: 1, the new project, add ibatis, spring and struts of the jars; Second, the database design. 3, POJO class. 4, pojo class configuration file to prepare 5, ibatis main configuration file to prep

  • Spring Framework's design concept and design patterns (7)-Spring AOP features and implementation in 2010-08-31

    Keywords: Spring, AOP, Proxy, proxy, blocker the last chapter: Spring Framework's design concept and design patterns (6)-Ioc container and BeanFactory factory http://javapub.javaeye.com/blog/751635 Next Chapter: Spring Framework's design concept and

  • environment configuration spring mvc Series 1 2010-10-02

    Nonsense: Hot? = Spring + hibernate + struts Hot? = Spring + jpa + struts Hot? = Spring + ibate + struts Personally feel that sub-fan complex configuration, began to turn spring, because spring is said to have their own set of things, and thus be to

  • integration of spring and hibernate configuration files 2010-11-04

    For ease of operation, we often hibernate in the spring of the WEB project integration eliminates the trouble of using hibernate.cfg.xml will hibernate configuration information directly Spring configuration file The following are Spring integration

  • S2SH project to build process 2009-11-18

    S2SH project to build process

  • ZkExample (zk project to build a simple login) 2009-09-12

    ZkExample (zk project to build a simple login) Source in the annex This example demonstrates the following main elements: 1, zk web project to build 2, zk front associated with the java code 3, zk events and the background binding of java code

  • The combination of spring and hibernate configuration files. And independent 2010-04-02

    A lot of people like the spring and hibernate configuration files together that is configured in such a xml beans.xml: <? Xml version = "1.0" encoding = "UTF-8"?> <Beans xmlns = " http://www.springframework.org/schema/bea

  • Detail using SVN + Trac + Eclipse Build project management and development environment 2010-05-24

    Svn is the source code version control system, Trac is a free open source bug tracking system, Eclipse is the IDE, the three together can build a relatively complete project management and development environment. The assumption that your Svn and Tra

  • Use Hudson's project to build 2009-12-10

    Translated: http://wiki.hudson-ci.org/display/HUDSON/Building+a+software+project First, build a common project Hudson can be used to perform specific work of building a server, such as continuous / formal / night build, run tests, or perform repeatab

  • Use Eclipse SVN add to their Google code project to build their own code on the SVN repository 2011-09-05

    Use Eclipse SVN add to their Google code project to build their own code on the SVN repository 1 Create a new project in google code testproject There are many online concrete creation process here is not to say. https: / / testproject.googlecode.com

  • Spring.net + FluorineFx project structures of the four. Spring.net database calls written 2010-09-12

    Fourth, the database call 4.1 Dao class methods General operation of the database, new, query, modify, delete 4.1.1 New data written Add a staff, incoming data: the names of persons, the sector key; return after additional personnel key. C # Code / /

  • Seam project to build records (2) - unit testing structure 2010-03-29

    Seam project to be able to run the unit test is first necessary to build up the environment JBoss Embedded Container Tomcat is used to build the time of the embedded-jboss-beta3.SP10 1. The JBoss Embedded container in the bootstrap directory copied t

  • Use maven2 project structure to create a custom project 2010-03-11

    1. The first to use the command: mvn archetype: create-DgroupId = com.jwu-DartifactId = jwu-archetype-DarchetypeArtifactId = maven-archetype-archetype Create arche type. The command created in the current directory called jwu-archetype of the maven p

  • Android project structure, and HelloWorld 2010-04-28

    1, set up development environment, see the text configuration Android development environment 2 new projects: 1) New -> Android Project Expand directory structure: src in com.leoms.hello under a HelloWorld.java, his name on the new project from the t

  • Android Development Learning II. Android project structure 2010-12-24

    Second, the code structure 2.1 Android procedural framework for We build a Android Project project, expand the project file, project file structure is: 2.1.1 src The following is the main class in the src. If in the establishment of the project, sele