SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Último

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 

Último (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 

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

Notas do Editor

  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