ColdSpring the basics

21
ColdSpring The Basics

description

TCCFUG January 4th Preso on the basics of ColdSpring

Transcript of ColdSpring the basics

Page 1: ColdSpring the basics

ColdSpringThe Basics

Page 2: ColdSpring the basics

Ted Steinmann Lead Developer

Hospital Dev Team ImageTrend, Inc.

CF User 6 years http

://www.linkedin.com/in/tedsteinmann

Page 3: ColdSpring the basics

Questions Working on ColdSpring driven apps? Built/implemented ColdSpring? Not using ColdSpring? Using something else? Not Using components/cfcs?

Page 4: ColdSpring the basics

What Does ColdSpring Do? Object/Bean (Component) Factory

Singleton Manage Dependencies Much, much more…

Page 5: ColdSpring the basics

ColdFusion Component .cfc File containing data & functions Building blocks to CF in an OO manner

Encapsulation Inheritance Introspection

Page 6: ColdSpring the basics

What's a Singleton? Design pattern

Single instance Global access One object No State

Page 7: ColdSpring the basics

What is a Transient Object? Container

Short lived Not Persisted

Page 9: ColdSpring the basics

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

Page 10: ColdSpring the basics

Dependency MVC/SOA

Dependencies between layers Dependencies between objects

ViewModelController

Page 11: ColdSpring the basics

What does that give us? Prevents duplication of code/config Separation of Concerns Modularity Encapsulation

Page 12: ColdSpring the basics

Questions?

Page 13: ColdSpring the basics

Configuration

Page 14: ColdSpring the basics

BeanFactory Container or holder for components

Instantiate Configure Resolve Dependencies

Page 15: ColdSpring the basics

Resolve Dependencies Constructor Arguments Setter Injection

Page 16: ColdSpring the basics

Before moving on… Questions on:

Dependencies? How ColdSpring injects dependencies?

Page 17: ColdSpring the basics

Additional functionality Import XML directive Dynamic Properties

Page 18: ColdSpring the basics

Others Parent Beans Factory Beans AOP Remote proxies Mock Objects Factory-post-processor

Page 19: ColdSpring the basics

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

Page 20: ColdSpring the basics

Cost of DI/IOC Configuration required Longer startup times Other?

Page 21: ColdSpring the basics

References ColdSpring

Quickstart Reference Guide What’s new in 1.2 ColdSpring Lite Annotation-based

Dependency Injection using ColdSpring

Other Dependency Injec

tion (Martin Fowler)

ColdFusion Components

Derby DB Environment Conf

ig Object Oriented

Programming