Leveraging Cold Spring To Make Better Applications Kurt

Leveraging Cold. Spring To Make Better Applications Kurt Wiersma kwiersma@jidev. com 1

Goals § Show Cold. Spring can be to build better enterprise grade applications. § Introducing a quick start application: Appbooster 2

Introduction § Cold. Spring - a container for your model objects § Cold. Spring holds your objects like a box of Legos § Cold. Spring is transparent 3

Typical App Architecture § Domain/business objects for each entity § Data Access objects (DAO) which read and save objects § Gateway objects which return queries § Service objects - your API § Controllers which talk to the service layer 4

Life Before Cold. Spring § Used create. Object() a lot in my code § Had lots of user services objects floating around in memory § Wrote remote services manually § Unit testing was difficult 5

Life After Cold. Spring § No more hard coded create. Object() calls § Took advantage of Aspect Oriented Programming (AOP) for caching § Automatically generated remote services for Flex 2 § Easier testing § More time with my wife 6

Cold. Spring Part 1 § Cold. Spring's core focus is to make the configuration and dependencies of your CFCs easier to manage. § Cold. Spring consists of a container which can create and hold any object • • Dependency Injection aka inversion of control (IOC) The “Hollywood Principle” - don’t call me I will call you Auto-wiring of dependencies By default all objects are singletons and are cached in the application scope. 7

Cold. Spring Part 2 § The first Aspect-Oriented-Programming (AOP) framework for CFCs. § Support for generating remotely accessible objects § Plug-ins for Fusebox 4+, Mach-II, and Model. Glue § Support for integrating with your factories through the factory-method attribute. 8

Cold. Spring Configuration 9

Aspect Oriented Programming § Allows you to intercept method calls and act before and/or after them § Transparent to the method being called and to the code calling the method § Useful for security, caching, logging, and generating remote services 10

Remote Facades § Cold. Spring’s remote. Proxy. Factory uses AOP to generate remote CFCs which can be called via web services or via Flex 2 § Easy to setup § Use a service layer! 11

Introducing App. Booster § A sample Mach II and Cold. Spring application developed with best practices. § App. Booster gives your application a jump start § Provides a simple model for users, addresses, and roles § User authentication is implemented § There is both a public and admin interface for managing users 12

App. Booster Model 13

Recommendations § Do a proof of concept § You don’t have to do it all at once § Consider developing or using a code generator or framework to speed development § Favor setter injection over constructor injection when setting up your services § Join the Cold. Spring mailing list § Read through the Cold. Spring documentation 14

Resources § Cold. Spring • http: //coldspringframework. org § Chris Scott’s Blog • http: //cdscott. blogspot. com/ § Dave Ross’ Blog • http: //www. d-ross. org/ § Kurt’s Blog • http: //jroller. com/page/kwiersma § Aspect Oriented Programming • http: //en. wikipedia. org/wiki/Aspect-oriented_programming 15

Questions? ? § Fire away… Go Bears! 16
- Slides: 16