| By Dave Ross, Chris Scott | Article Rating: |
|
| January 31, 2006 09:00 AM EST | Reads: |
24,217 |
Here we see the service configured with a value for the tax rate, inner beans for the ShippingMethodGateway and OrderDAO components, and references to the Product and User Services, as we discussed before. Next, we'll look at the configuration of the logOrderAdvisor, which is an instance of a ColdSpring "NamedMethodPointcutAdvisor":
<bean id="logOrderAdvisor"
class="coldspring.aop.support.NamedMethodPointcutAdvisor">
<property name="advice">
<bean id="logOrderAdvice" class="petmarket.aspects.LogOrderAdvice">
<property name="filename">
<value>petstoreOrders</value>
</property>
</bean>
</property>
<property name="mappedNames">
<value>placeOrder</value>
</property>
</bean>
Here we simply supply the target object and a list of any configured Advisors you would like to use on the component. It is worth noting that if you skip the configuration of a NamedPointcutAdvisor and simply put the name of a configured Advice bean in the list of interceptorNames, the ProxyFactory will automatically create a DefaultPointcutAdvisor for you, meaning that you would like to apply this advice to all methods in the target obejct. We give the ProxyFactoryBean the ID of OrderService, and when your application requests that service component with getBean('OrderService'), all the details of creating the proxy and wiring up all the necessary components will be handled for you, and, of course, as noted earlier, your application will treat the proxy as if it is the target component. It's also worth noting that the life cycle of these components are also completely managed for you, so successive calls to getBean() will not generally create new instances of these components, unless you have configured the bean to do so, as a non-singleton.
<bean id="OrderService" class="coldspring.aop.framework.ProxyFactoryBean">
<property name="target">
<ref bean="OrderServiceTarget" />
</property>
<property name="interceptorNames">
<list>
<value>logOrderAdvisor</value>
</list>
</property>
</bean>
Hopefully this article and the accompanying code will give you a good idea of what ColdSpring intends to do: it manages your model. ColdSpring is "non-invasive", meaning your model components will have no idea they are being managed by ColdSpring. ColdSpring's features enable you to write components that are easier to reuse and test, because they don't contain "hard-coded" knowledge of how to resolve their own dependencies. ColdSpring enables you to declaratively configure an application, and application maintenance becomes easier because you can quickly swap out your components or transparently add behavior via AOP. We believe that as your codebase gets larger, ColdSpring will be the tool you use to keep your model under control.
Published January 31, 2006 Reads 24,217
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Dave Ross
David Ross is a ColdFusion Developer.
More Stories By Chris Scott
Chris Scott is a ColdFusion Developer.
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Adobe Cans Another 9% of its Workforce
- Moyea DVD4Web Converter V2.0 Converts DVD to FLV Fast and Synchronously with Watermarks
- Adobe Fiddles with its Web Apps
- Adobe & Salesforce Cut Cloud Deal
- Hosting.com Launches ColdFusion 9 in the Cloud
- The Real Time Infrastructure Ultimatum
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- The Planet Named “Bronze Sponsor” of Cloud Computing Expo
- Microsoft Expression Web Has Got Game
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Bruce Chizen Joins Voyager Capital as Venture Partner
- My Top Seven Wishes From Adobe MAX 2009
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- Constructing an Application with Flash Forms from the Ground Up
- AJAX World RIA Conference & Expo Kicks Off in New York City
- CFEclipse: The Developer's IDE, Eclipse For ColdFusion
- Personal Branding Checklist
- Adobe Flex 2: Advanced DataGrid
- Has the Technology Bounceback Begun?
- Building a Zip Code Proximity Search with ColdFusion
- i-Technology Viewpoint: We Need Not More Frameworks, But Better Programmers
- The Asynchronous CFML Gateway
- Web Services Using ColdFusion and Apache CXF





























