|By Dave Ross, Chris Scott||
|January 31, 2006 09:00 AM EST||
ColdSpring is a framework for ColdFusion Components, inspired by the Spring Framework for Java, and its core focus is to manage the dependencies within your CFC "model."
Dependencies are more common than you think: when one CFC needs another CFC to perform a task, it depends on that other CFC (and those two CFCs are known as "collaborators"). When a CFC needs a piece of configuration data, such as a datasource name, it depends on that piece of data. ColdSpring enables you to declaratively supply your CFCs with their dependencies, freeing you from having to write the code to do so (which unfortunately ends up in just about each and every component). ColdSpring practices what many refer to as "inversion-of-control." This simply means that the control of creating objects and resolving their dependencies is lifted out of the code and into the code's "container," which in this case is ColdSpring. "Dependency-Injection" is probably a better term to describe what ColdSpring does: it injects dependencies into your CFCs as they are created.
Also part of ColdSpring is the first aspect-oriented-programming (AOP) framework for CFCs (which we'll cover in further detail shortly).
For building an application like the Pet Market, ColdSpring would typically be used in conjunction with one of the other MVC application frameworks like Fusebox, Mach-II, or Model-Glue. However, for the purposes of this article, we were unable to use one of those frameworks, so we took the approach of attempting to retrofit a brand new ColdSpring-managed model on top of the existing Pet Market application. This means that our version of the Pet Market should be used to examine how ColdSpring manages a model regardless of the application framework used. (The code for this article can be downloaded from www.cfpetmarket.com.)
Figure 1 provides a picture of where ColdSpring sits in the overall Pet Market application architecture.
Figure 1 is an example of typical MVC (Model-View-Controller) architecture. The "Service," "DAO," "Gateway," and "Utility" components are part of our Pet Market model. Each component is "managed" by ColdSpring, meaning ColdSpring is responsible for both creating the component and resolving its dependencies. When the controller layer needs to talk to a model component, it simply asks ColdSpring for the component. After retrieving a component from ColdSpring, the controller layer would call methods directly on that component, so ColdSpring doesn't really "sit between" the controller and the model.
To use ColdSpring with your application, you need to write some code to create a ColdSpring "BeanFactory". The BeanFactory is typically the only ColdSpring CFC that you will interact with, thus setting up ColdSpring for use within an application is trivial. It's worth mentioning that none of this is necessary if you are using the Mach-II or ModelGlue application frameworks, as both offer hooks to handle creating the ColdSpring BeanFactory automatically. However, to see how we set up ColdSpring in the Pet Market application, take a look at our application.cfm, the relevant part of which is shown here:
All we are doing here is creating the ColdSpring BeanFactory and placing it in the application scope. The <cfif/> and <cflock/> blocks are necessary to ensure that the BeanFactory starts up in a thread-safe manner, because as you can see from the code, we are storing the BeanFactory in the application scope and we want to make sure that all requests wait while the BeanFactory is created (this only happens once during application "startup"). In order to tell ColdSpring about your CFCs, we need to supply it with a set of "bean definitions," which are written in a simple XML format. We named our configuration file components.xml. You can see this done in the code above, where we are passing components.xml's file path into the BeanFactory using the loadBeans() method. Here's a quick sample of our bean definitions:
<cfif not structKeyExists(application,"beanFactory")
<cflock name="PetMarket_Startup" timeout="25">
<cfif not structKeyExists(application,"beanFactory")
<cfset application.beanFactory = createObject('component',
Use <bean/> tags to define your CFCs. You may have heard the term "bean" used in a number of different contexts related to CFC development, but here it's chosen because ColdSpring expects that, in order to take advantage of certain features, you adhere to the Java programming language's JavaBean specification/conventions. Now we will take a look at the XML above in detail. First we defined a <bean/> and gave it an ID of "SessionService". The class attribute, "petmarket.util.UsageSessionService", tells ColdSpring which CFC it should use when asked for the "SessionService". You will also see the "UserService" <bean/> definition, but this one is a bit more complex. We define the ID and class just like our SessionService, however, we also define some <property/> tags within the <bean/> tag. First we define a "UserDAO" <property/> (DAO stands for "Data Access Object", it's part of the gritty details of our Pet Market model but has nothing to do with ColdSpring itself). Whatever you put between the <property></property> tags will be injected, by ColdSpring, when the CFC is actually created. Thus, we have defined an "inner-bean" within the UserDAO property, meaning ColdSpring will create a UserDAO CFC and pass that into the UserService when it is created. You must provide ColdSpring with a way to do this, and, in the case of <property/>, ColdSpring expects there to be a "setter method" that will accept the UserDAO, and it must be named "setUserDAO". This is where ColdSpring relies on the JavaBeans spec, meaning that you adhere to the JavaBean convention of providing setter methods for public properties. The setter method within our UserService that accepts the UserDAO looks like this:
<!-- Session Service Definition -->
<!-- User Service -->
<!-- needs a UserDAO -->
<!-- also needs the session service -->
<cffunction name="setUserDAO" access="public"
returntype="void" output="false" hint="Dependency: userDAO">
<cfargument name="UserDAO" type="petmarket.component.user.UserDAO"
<cfset variables.userDAO = arguments.UserDAO />
Things are changing so quickly in IoT that it would take a wizard to predict which ecosystem will gain the most traction. In order for IoT to reach its potential, smart devices must be able to work together. Today, there are a slew of interoperability standards being promoted by big names to make this happen: HomeKit, Brillo and Alljoyn. In his session at @ThingsExpo, Adam Justice, vice president and general manager of Grid Connect, will review what happens when smart devices don’t work togethe...
Mar. 29, 2017 06:30 PM EDT Reads: 2,708
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
Mar. 29, 2017 03:15 PM EDT Reads: 2,224
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
Mar. 29, 2017 02:30 PM EDT Reads: 3,819
SYS-CON Events announced today that Auditwerx will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Auditwerx specializes in SOC 1, SOC 2, and SOC 3 attestation services throughout the U.S. and Canada. As a division of Carr, Riggs & Ingram (CRI), one of the top 20 largest CPA firms nationally, you can expect the resources, skills, and experience of a much larger firm combined with the accessibility and attent...
Mar. 29, 2017 02:30 PM EDT Reads: 692
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
Mar. 29, 2017 02:30 PM EDT Reads: 2,279
SYS-CON Events announced today that HTBase will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
Mar. 29, 2017 02:15 PM EDT Reads: 3,269
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Mar. 29, 2017 01:30 PM EDT Reads: 1,757
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud enviro...
Mar. 29, 2017 12:15 PM EDT Reads: 7,909
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
Mar. 29, 2017 11:45 AM EDT Reads: 2,582
SYS-CON Events announced today that Infranics will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
Mar. 29, 2017 11:00 AM EDT Reads: 3,451
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Mar. 29, 2017 10:15 AM EDT Reads: 1,741
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
Mar. 29, 2017 10:00 AM EDT Reads: 2,353
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
Mar. 29, 2017 08:45 AM EDT Reads: 953
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Mar. 29, 2017 08:00 AM EDT Reads: 7,568
Microservices are a very exciting architectural approach that many organizations are looking to as a way to accelerate innovation. Microservices promise to allow teams to move away from monolithic "ball of mud" systems, but the reality is that, in the vast majority of organizations, different projects and technologies will continue to be developed at different speeds. How to handle the dependencies between these disparate systems with different iteration cycles? Consider the "canoncial problem" ...
Mar. 29, 2017 06:00 AM EDT Reads: 9,080
The Internet of Things is clearly many things: data collection and analytics, wearables, Smart Grids and Smart Cities, the Industrial Internet, and more. Cool platforms like Arduino, Raspberry Pi, Intel's Galileo and Edison, and a diverse world of sensors are making the IoT a great toy box for developers in all these areas. In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists discussed what things are the most important, which will have the most profound e...
Mar. 29, 2017 04:00 AM EDT Reads: 15,132
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
Mar. 29, 2017 03:45 AM EDT Reads: 2,189
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Mar. 29, 2017 03:30 AM EDT Reads: 3,272
Web Real-Time Communication APIs have quickly revolutionized what browsers are capable of. In addition to video and audio streams, we can now bi-directionally send arbitrary data over WebRTC's PeerConnection Data Channels. With the advent of Progressive Web Apps and new hardware APIs such as WebBluetooh and WebUSB, we can finally enable users to stitch together the Internet of Things directly from their browsers while communicating privately and securely in a decentralized way.
Mar. 29, 2017 03:00 AM EDT Reads: 6,109
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Mar. 29, 2017 01:15 AM EDT Reads: 2,550