SlideShare une entreprise Scribd logo
1  sur  21
ColdSpring 
The Basics
Ted Steinmann 
 Lead Developer 
 Hospital Dev Team 
 ImageTrend, Inc. 
 CF User 6 years 
 http://www.linkedin.com/in/tedsteinmann
Questions 
Working on ColdSpring driven apps? 
 Built/implemented ColdSpring? 
 Not using ColdSpring? 
 Using something else? 
 Not Using components/cfcs?
What Does ColdSpring Do? 
 Object/Bean (Component) Factory 
 Singleton 
 Manage Dependencies 
 Much, much more…
ColdFusion Component 
 .cfc File containing data & functions 
 Building blocks to CF in an OO manner 
 Encapsulation 
 Inheritance 
 Introspection
What's a Singleton? 
 Design pattern 
 Single instance 
 Global access 
 One object 
 No State
What is a Transient Object? 
 Container 
 Short lived 
 Not Persisted
Example (user list)
Dependency 
 One piece of a 
program depends 
on another to get 
it’s job done. 
 a state in which 
one object uses a 
functionality of 
another object 
UserService 
UserGateway 
Config
Dependency 
 MVC/SOA 
 Dependencies between layers 
 Dependencies between objects 
Controller Model View
What does that give us? 
 Prevents duplication of code/config 
 Separation of Concerns 
 Modularity 
 Encapsulation
Questions?
Configuration
BeanFactory 
 Container or holder for components 
 Instantiate 
 Configure 
 Resolve Dependencies
Resolve Dependencies 
 Constructor Arguments 
 Setter Injection
Before moving on… 
 Questions on: 
 Dependencies? 
 How ColdSpring injects dependencies?
Additional functionality 
 Import XML directive 
 Dynamic Properties
Others 
 Parent Beans 
 Factory Beans 
 AOP 
 Remote proxies 
 Mock Objects 
 Factory-post-processor
Benefits of DI/IOC 
 Separation of concerns 
 Less coupling 
 Configuration without changing code 
 Components become easier to test 
 Birds eye view of the dependencies 
 Components are not tied to ColdSpring
Cost of DI/IOC 
 Configuration required 
 Longer startup times 
 Other?
References 
 ColdSpring 
 Quickstart 
 Reference Guide 
 What’s new in 1.2 
 ColdSpring Lite 
 Annotation-based 
Dependency 
Injection using 
ColdSpring 
 Other 
 Dependency 
Injection (Martin 
Fowler) 
 ColdFusion 
Components 
 Derby DB 
 Environment Config 
 Object Oriented 
Programming

Contenu connexe

Similaire à ColdSpring the basics

Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
PHP - Procedural To Object-Oriented
PHP - Procedural To Object-OrientedPHP - Procedural To Object-Oriented
PHP - Procedural To Object-OrientedVance Lucas
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFSMehdi Khalili
 
Case Study: University of California, Berkeley and San Francisco
Case Study: University of California, Berkeley and San FranciscoCase Study: University of California, Berkeley and San Francisco
Case Study: University of California, Berkeley and San FranciscoForgeRock
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Refactoring your legacy app to a MVC framework
Refactoring your legacy app to a MVC frameworkRefactoring your legacy app to a MVC framework
Refactoring your legacy app to a MVC frameworkColdFusionConference
 
Dependency Injection & IoC
Dependency Injection & IoCDependency Injection & IoC
Dependency Injection & IoCDennis Loktionov
 
Putting it All Together: Securing Systems at Cloud Scale
Putting it All Together: Securing Systems at Cloud ScalePutting it All Together: Securing Systems at Cloud Scale
Putting it All Together: Securing Systems at Cloud ScaleAmazon Web Services
 
SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011Paul Rogers
 
SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011Paul Rogers
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSelenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSathya Technologies
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Sathya Technologies
 
20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Controldonnfelker
 
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File Management
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File ManagementForge - DevCon 2016: Cloud PDM Demystified – The Future of File Management
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File ManagementAutodesk
 
OA Framwork Presentation.pptx
OA Framwork Presentation.pptxOA Framwork Presentation.pptx
OA Framwork Presentation.pptxwadierefky1
 
Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD IntegrationMahesh Vallampati
 

Similaire à ColdSpring the basics (20)

Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
PHP - Procedural To Object-Oriented
PHP - Procedural To Object-OrientedPHP - Procedural To Object-Oriented
PHP - Procedural To Object-Oriented
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
 
Case Study: University of California, Berkeley and San Francisco
Case Study: University of California, Berkeley and San FranciscoCase Study: University of California, Berkeley and San Francisco
Case Study: University of California, Berkeley and San Francisco
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Spring 2
Spring 2Spring 2
Spring 2
 
Refactoring your legacy app to a MVC framework
Refactoring your legacy app to a MVC frameworkRefactoring your legacy app to a MVC framework
Refactoring your legacy app to a MVC framework
 
Dependency Injection & IoC
Dependency Injection & IoCDependency Injection & IoC
Dependency Injection & IoC
 
Putting it All Together: Securing Systems at Cloud Scale
Putting it All Together: Securing Systems at Cloud ScalePutting it All Together: Securing Systems at Cloud Scale
Putting it All Together: Securing Systems at Cloud Scale
 
SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011
 
SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSelenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabad
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...
 
20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control
 
EF Core (RC2)
EF Core (RC2)EF Core (RC2)
EF Core (RC2)
 
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File Management
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File ManagementForge - DevCon 2016: Cloud PDM Demystified – The Future of File Management
Forge - DevCon 2016: Cloud PDM Demystified – The Future of File Management
 
OA Framwork Presentation.pptx
OA Framwork Presentation.pptxOA Framwork Presentation.pptx
OA Framwork Presentation.pptx
 
Jbpm online training
Jbpm online trainingJbpm online training
Jbpm online training
 
Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD Integration
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

ColdSpring the basics

  • 2. Ted Steinmann  Lead Developer  Hospital Dev Team  ImageTrend, Inc.  CF User 6 years  http://www.linkedin.com/in/tedsteinmann
  • 3. Questions Working on ColdSpring driven apps?  Built/implemented ColdSpring?  Not using ColdSpring?  Using something else?  Not Using components/cfcs?
  • 4. What Does ColdSpring Do?  Object/Bean (Component) Factory  Singleton  Manage Dependencies  Much, much more…
  • 5. ColdFusion Component  .cfc File containing data & functions  Building blocks to CF in an OO manner  Encapsulation  Inheritance  Introspection
  • 6. What's a Singleton?  Design pattern  Single instance  Global access  One object  No State
  • 7. What is a Transient Object?  Container  Short lived  Not Persisted
  • 9. Dependency  One piece of a program depends on another to get it’s job done.  a state in which one object uses a functionality of another object UserService UserGateway Config
  • 10. Dependency  MVC/SOA  Dependencies between layers  Dependencies between objects Controller Model View
  • 11. What does that give us?  Prevents duplication of code/config  Separation of Concerns  Modularity  Encapsulation
  • 14. BeanFactory  Container or holder for components  Instantiate  Configure  Resolve Dependencies
  • 15. Resolve Dependencies  Constructor Arguments  Setter Injection
  • 16. Before moving on…  Questions on:  Dependencies?  How ColdSpring injects dependencies?
  • 17. Additional functionality  Import XML directive  Dynamic Properties
  • 18. Others  Parent Beans  Factory Beans  AOP  Remote proxies  Mock Objects  Factory-post-processor
  • 19. Benefits of DI/IOC  Separation of concerns  Less coupling  Configuration without changing code  Components become easier to test  Birds eye view of the dependencies  Components are not tied to ColdSpring
  • 20. Cost of DI/IOC  Configuration required  Longer startup times  Other?
  • 21. References  ColdSpring  Quickstart  Reference Guide  What’s new in 1.2  ColdSpring Lite  Annotation-based Dependency Injection using ColdSpring  Other  Dependency Injection (Martin Fowler)  ColdFusion Components  Derby DB  Environment Config  Object Oriented Programming

Notes de l'éditeur

  1. Intro Only
  2. Questions:How many of you are working on applications which utilize ColdSpring?How many of you built those applications or understand how ColdSpring is setup?How many of you are not using ColdSpring?Using something else for DI/Object Factory not using compomentsFrom Description:(My opinion) - you should be using ColdSpring to manage your singletonsbrief overview of basic concepts and benefits of ColdSpringTalk about what a singleton, a transient object & dependency injection isWe'll walk through configuration of ColdSpring, inject some dependencies, cover some core features & review environmentConfig – former pilot (keep applications up and running)Hopefully those of you already using ColdSpring will stick around to the end of the preso or join us for drinks to share your experiences.
  3. Interchangably (Java backgrounds may disagree) but in CF, ColdSpring is issuing ColdFusion components and it’s borrowed stuff from Java.
  4. CFCs are building blocks that let you develop ColdFusion code in an object-oriented mannerEncapsulation: The technique of incorporating both code and data into one object such as a CFCCFCs can also enforce data types, check for required parameters, and optionally assign default values.Inheritance: One CFC can inherit the methods and properties of another CFC. Inheritance lets you build multiple specific components without rewriting the code for the basic building blocks of the components.Introspection: CFCs support introspection; that is, they can provide information about themselves. (such as getMetaData())
  5. Concept create once and reuseComponentTypicallypersisted in the application scope.Update application startup, create necessary components that will be globally accessible
  6. AKA, Domain objectMay be persisted in session or some other short lived scope
  7. List: Showing us a list of usersBased on the ColdSpring QuickStart “ColdSpring in 5 minutes”Using an MCV approach to obtaining user recordsKnow want MVC stands for?Since we’re using an MVC approach: Service, Gateway, ConfigShow list page interfaceShow list page codeBear with me on the getting the user service from the bean factoryJust understand that the factory provides a instance of a user service cfcShow User Service Docs (getUsers Method)Show User Gateway Docs (getUsers Method)Show Config Bean Docs (getDSN)Show singleton interface and .cfmJust coldfusion components, and we’re getting them from the object factory.Show transient interface and .cfmSetters & gettersReturn to slides
  8. http://en.wikipedia.org/wiki/Dependencyalso called Coupling (computer science), a state in which one object uses a functionality of another objectColdSpringquickstart refers to the MVC problem of Services depending on gateways which depend on configuration
  9. What does coldspring do for us?Show dependents interface and .cfmNotice that I’m getting the gateway via the service, and config via the gatewayUserService has a method to getUsers, may not know how to actually query the database for those users, but it knows the userGateway doesLikewise, the UserGateway may not know what configuration is necessary to access database, but it knows the ConfigBean does know that.
  10. What does this gain us?Prevents us from duplicating code (configuration)Separation of concernsMore gateways, config bean knowsModularityMakes it possible to remove/change individual components and how they function w/out distruptingChange database connection: Config, maybe gateways, Services don’t need to changeEncapsulationDifferent layers are protected from sharing too much information
  11. Show ColdSpring.xml fileStore references to components & their dependenciesShow class path and filesSingletonsBorrows XML syntax from SpringShow Application PageNotice the application specific mappingsthis.root -> com & coldspringonApplicationStart: Create an instance of the ColdSpring factoryInitialize it and pass in coldspring file as a pathInvoking method “loadbeans” on the DefaultXmlBeanFactoryonRequestStart: init methodNeed a way to re-load singletons
  12. From the ColdSpring Reference Guide:Think of a ColdSpring BeanFactory as the container, or holder, for your application's components. It will instantiate, configure, and resolve the dependencies among the components (beans) you place inside it. May have already said this:Don't get hung up on the "bean" syntax, coldspring relies on the "Java-bean" specification to resolve dependencies, but all the syntax says is register a component at this path under the name [myComponent] and return an instance of that object when asked for.  Typically an instance is shared among all (Singleton)
  13. When ColdSpring initializes it will inspect components and call any setters necessary injecting instantiated objectsConstructor argumentsSpecify dependencies in ColdSpring XML fileShow Config BeanCalls init function on components defined in XML fileSimple valuesShow UserGatewaygetUsersdatasourceSetter injectionUserService and Gateway don’t have dependencies defiendDon’t need to because of autowiringDuring Bean ColdSpring inspects component and says if I have a bean defined for this setter, instantate itShow UserServicesetUserGatewayColdSpring, “Do I have a UserGateway?”Pass instance of the userGateway to the userServiceRequires a little more codeWhy usePrevents Circular Dependency ComponentA Depends on ComponentB and ComponentB depends on ComponentA
  14. What else can we do with ColdSpring?Import XML directive - New in ColdSpring 1.2Show ColdSpring FileDynamic PropertiesShow in codeSpecial syntaxEnvironment ConfigShow invokeShow XMLVarious environments determined by regex pattern matchingKey value configuration properties (returns coldfusionstruct)
  15. Parent Beans – remove need to duplicate dependency definitions (i.e. injecting a config bean to all gateways [use parent bean instead])don’t have to write setters, just create a parent bean for gateways, have all gateways reference the parent bean.Factory Bean - create your own custom Factories, special kinds of objects that create and return other objectsAOP – Aspect Orientated Programming Kurt could probably give an entire talk on thisRemote Proxies -  automatically generate Remote Proxy componentsyou can specify what components are open for remote access, as well as which methods are exposedMock Objects – testingFactory-post-processors:Tony Nelson - has done some cool things with post-processorsi.e. Annotation-base Dependency injectionlooks at all the beans defined in ColdSpring, checks their metadata for a "beans" attribute inside the cfcomponent tag, and automatically injects the requested beans into the component inside a variables.beansstruct.
  16. Dependency Injection/Inversion of Control (summarizedfrom reference guide)• components aren't asked to do things outside of their scope or duty (known as "separation of concerns") • components aren't completely tied to other implementations (again, less coupling) • components are easier to configure and you can do so without changing code Introduction • components become easier to test (we can dictate which collaborators they use, perhaps even creating dummy "stub" or "mock" objects to trick the component into thinking that it's running in a different environment). • you can get a birds eye view of the dependencies among your components (and generate some neat documentation) • components are not tied to ColdSpring at all. There should be very little plumbing required to use ColdSpring in any environment, and only "calling" code will be aware of its existence. In Model-View-Controller apps, this usually means that the Controller will have some knowledge of ColdSpring but nothing else will