Search code examples
coldfusionframeworkscoldspring

ColdSpring in Five minutes


I'm rereading ColdSpring in 5 minutes. It says "The UserService needs the UserGateway, and the UserGateway needs the ConfigBean". No it does not! The UserService does not need anything. It doesn't call UserGateway.

All it does is set a variable that it happens to call userGateway by coincidence, but it doesn't call the User Gateway component.

Help me understand this apparently simple scenario!


Solution

  • You have to remember that this starter application intentionally doesn't explain everything so as to prevent confusion. When completely configured, the sample application will initialize all three components. The UserService CFC has the responsiblity of setting and getting the User Gateway Component, the User Gateway component has the responsiblity of setting and getting the Config Bean component, and the Config Bean component is designed to set and get application settings (in this case, just datasource information).

    I wouldn't fret too much over this for now if you don't understand how it all works; ColdSpring's reference guide will bring it all into focus for you.