Click here to Skip to main content
15,896,415 members
Articles / Programming Languages / XML

AOP Using Spring.NET - Part 1

Rate me:
Please Sign up or sign in to vote.
4.80/5 (30 votes)
6 Jun 2008CPOL7 min read 122.2K   1.7K   65  
Aspect Oriented Programming and how Spring.NET supports this.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
    </sectionGroup>
  </configSections>
  
  <spring>
    <context><resource uri="config://spring/objects" /></context>
    <objects xmlns="http://www.springframework.net">
      <!--Presenters-->
      <object name="CustomerPresenter" type="WinClient.Presenters.Customer, WinClient" singleton="false" />
      <object name="EmployeePresenter" type="WinClient.Presenters.Employee, WinClient" singleton="false" />

      <!--Business Logic Layers-->
      <object name="CustomerBLL" type="BLL.Customer.CustomerBLL, BLL" singleton="false" />
      <object name="EmployeeBLL" type="BLL.Employee.EmployeeBLL, BLL" singleton="false" />

      <!--Data Access Layers-->
	<object name="EmployeeDAL" type="DAL.Employee.EmployeeDAL, DAL" singleton="false" />
	<object name="CustomerDAL" type="DAL.Customer.CustomerDAL, DAL" singleton="false" />

      <object id="CustomerDALWithAdvice" type="Spring.Aop.Framework.ProxyFactoryObject">
        <property name="Target">
          <object type="DAL.Customer.CustomerDAL, DAL" />
        </property>
        <property name="InterceptorNames">
          <list>
            <value>TraceAroundAdvice</value>
          </list>
        </property>
      </object>
      <!--Advices-->
      <object id="TraceAroundAdvice" type="AOP.Advice.TraceAroundAdvice, AOP" >
      </object>
    </objects>
  </spring>
	
  <connectionStrings >
    <add name="Northwind" connectionString ="server=.\sqlexpress;database=northwind;uid=sa;pwd=password;"/>
  </connectionStrings>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Cognizant Technology Solutions
United States United States
Solution Architect working for Cognizant Technology Solutions.

Comments and Discussions