Leveraging ColdSpring to build a robust Flex applications Chris Scott, Cynergy Systems.

Slides:



Advertisements
Similar presentations
Introduction to the Spring Framework
Advertisements

Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Aspect Oriented Programming - AspectJ Radhika Rajput.
Spring, Hibernate and Web Services 13 th September 2014.
Copyright © 2008 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. Andrew Stone Common Security.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
UNIT-V The MVC architecture and Struts Framework.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
INTRODUCING SCA Byungwook Cho Nov.2007.
Introduction to AOP.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
6st ACS Workshop UTFSM ACS Course Component, Container, Lifecycle Management 6st ACS Workshop UTFSM, Valparaiso, Chile H. Sommer, G. Chiozzi.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, System and Software Engineering.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Core Indigo Patterns Ted Neward
Programming in Java CSCI-2220 Object Oriented Programming.
Introducing Allors Applications, Tools & Platform.
CS0007: Introduction to Computer Programming Classes: Documentation, Method Overloading, Scope, Packages, and “Finding the Classes”
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Aspect Oriented Programming Adlux Consultancy Services Pvt Ltd
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Introduction to Yan Cui Aspect Oriented Programming by
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
EJB Enterprise Java Beans JAVA Enterprise Edition
L’origine dei mali: le dipendenze tra componenti Stefano Leli 14° Workshop DotNetMarche Venerdì 16 aprile
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
Thomas Burleson. Using MVC with Flex & Coldfusion Projects June 27, 2007 See how Coldfusion MVC is similar to Flex MVC…
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Introduction to Object-oriented Programming
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
J2EE Lecture 6: Spring – IoC and Dependency Injection
Structure of a web application
Chengyu Sun California State University, Los Angeles
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Towards Effective Adaptive User Interfaces Design
Introduction to J2EE Architecture
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
The Object-Oriented Thought Process Chapter 08
Inversion of Control and ColdFusion: Using ColdSpring
By Ru Shen Department of Computer Science UAlbany, 2008
Intro to Spring CJUG - January 2013.
Multiuser Protection and the Mediator Pattern
Aspect-Oriented Programming
Chengyu Sun California State University, Los Angeles
JavaServer Faces: The Fundamentals
JAsCo an Aspect-Oriented approach tailored for
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Developing and testing enterprise Java applications
CS520 Web Programming Spring – Aspect Oriented Programming
a middleware implementation
AspectAda Aspect-Oriented Programming for Ada95
Leveraging ColdSpring To Make Better Applications
Object-Oriented PHP (1)
Aspect Oriented Programming
Software Development Process Using UML Recap
Tom Link CTO, Universal Mind
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Leveraging ColdSpring to build a robust Flex applications Chris Scott, Cynergy Systems

June 27 th - 30 th 2007www.cfunited.com About me… Enterprise Applications Consultant for Cynergy Systems Developing with ColdFusion since 1996 Coauthor of ColdSpring Framework Creator of ColdSpring's AOP Framework Author of Model-Glue for Java Currently working in CF, Java, Flex

June 27 th - 30 th 2007www.cfunited.com GoalsGoals Introduce AOP concepts Discuss benefits of SOA Introduce ColdSpring Remoting Show examples

June 27 th - 30 th 2007www.cfunited.com What is AOP? Aspect Oriented Programming Relatively new programming methodology that complements OOP Goal to assist in handling ‘far reaching’ or ‘cross- cutting’ concerns in your application AOP aims to significantly reduce code duplication Helps your primary business objects become more ‘cohesive’ and ‘loosely coupled’ Insert confusing terminology…

June 27 th - 30 th 2007www.cfunited.com What did that mean? AOP is new, new technologies come with new terminology and new ways of thinking. Some of the terminology is just damn confusing. Don’t get bogged down! It’s far less confusing that it sounds! Let’s focus on Why we should use AOP and How it works

June 27 th - 30 th 2007www.cfunited.com Why AOP? OOP is all about describing your application in terms of real world objects and their behavior Some objects are the people, places and things that your application deals with, our Domain Objects Others are services that these domain objects need to get their jobs done These are the concrete objects in our applications, they represent primary business needs The more focused on primary business objectives these objects are the better. We often strive for what is called more ‘cohesive’ domain objects

June 27 th - 30 th 2007www.cfunited.com Why AOP? However, objects often need to take part in more abstract systems in your application Transactions Security policies Caching systems Of course, the poster child for AOP, logging These are abstract behaviors you would like many of your model objects to have.

June 27 th - 30 th 2007www.cfunited.com Why AOP? Abstract systems that are broadly needed in many parts of your application are called ‘Cross Cutting Concerns’ AOP gives you a way to apply these systems broadly to existing objects. With ColdSpring AOP gives you apply behavior ‘declaratively’ in your configuration file, instead of programmatically

June 27 th - 30 th 2007www.cfunited.com How AOP Works Two central concepts to understanding AOP Interception Introduction Most of ColdSpring’s AOP framework is there to provide you the mechanisms to perform these two central tasks

June 27 th - 30 th 2007www.cfunited.com Interception Basically all AOP frameworks allow you to intercept specific method calls on objects. ColdSpring and Spring ONLY let you work with Method Interception. AspectJ lets you intercept changes in variables as well as basic programming constructs like loops. Don’t think you are limited by Method Interception. ColdSpring adheres to the AOP Alliance’s interfaces for Method Interception

June 27 th - 30 th 2007www.cfunited.com Interception Identifying the methods is a primary functions of an AOP framework. Here comes terminology… We call these ‘Join Points’, points in your model components where you want to add functionality. As far as ColdSpring AOP is concerned, Join Points == Methods

June 27 th - 30 th 2007www.cfunited.com Introduction ColdSpring allows you to introduce new functionality at specific times during a method’s execution You can introduce code before, after, during an exception, or around the method (before and after, with a little more complexity…) More ugly terminology… We call this ‘Advising’ the method. ColdSpring provides special classes for you to extend that allow you to define Advice, meaning functionality you want to introduce at specific times. These classes are called Advice Types

June 27 th - 30 th 2007www.cfunited.com ColdSpring’s Advice types BeforeAdvice AfterReturningAdvice AfterThrowingAdvice MethodInterceptor (say what? That’s like AroundAdvice) Blame MethodInterceptor on that AOP Alliance I told you about. MethodInterceptor sounds powerful and complicated, that’s probably a good thing…

June 27 th - 30 th 2007www.cfunited.com AOP Proxies Objects that hold a reference to another object and delegate method calls to that object. AOP Proxies are generated at runtime, through a Factory called ProxyFactoryBean ProxyFactoryBean knows how to add in the functionality in your Advice classes. This process is called Weaving It uses class called an Advisor, which we configure to tell ColdSpring how to introduce in our new functionality.

June 27 th - 30 th 2007www.cfunited.com AOP Proxy Creation

June 27 th - 30 th 2007www.cfunited.com AOP Proxy Creation

June 27 th - 30 th 2007www.cfunited.com AOP Proxy Creation

June 27 th - 30 th 2007www.cfunited.com AOP Proxy Creation

June 27 th - 30 th 2007www.cfunited.com AOP Proxy Creation

June 27 th - 30 th 2007www.cfunited.com Three Tiered architecture

June 27 th - 30 th 2007www.cfunited.com Three Tiered architecture Traditional object oriented approach Clear separation of Presentation, Business, and Data Tiers Client code interacts directly with domain model Increases coupling between presentation and business objects Increases dependencies between business objects

June 27 th - 30 th 2007www.cfunited.com Service Oriented Architecture

June 27 th - 30 th 2007www.cfunited.com Service Oriented Architecture Services abstract the complexities of business layer Provide public api for logical units of work Clients always interact through services Decouples the presentation layer from business layer

June 27 th - 30 th 2007www.cfunited.com Service Oriented Architecture Through interfaces or abstract classes we can decouple implementation Remote Services are extended from the service layer Represents a shift from Domain Modeling to Feature Driven development

June 27 th - 30 th 2007www.cfunited.com ColdSpring Remoting Automatically exposes Services as Remote Services Leverages ColdSpring AOP, allowing powerful integration through method interception Can provide type conversion from CF to AS for Flex 1.5 apps

June 27 th - 30 th 2007www.cfunited.com ColdSpring Remoting Configure RemoteProxyFactoryBean Provide a ServiceName Target will be an existing service Add any existing Interceptors we would like

June 27 th - 30 th 2007www.cfunited.com Directory Example – UI

June 27 th - 30 th 2007www.cfunited.com Code Review…

June 27 th - 30 th 2007www.cfunited.com Common Pitfalls Ensuring ColdSpring Bean Factory is created before Flex app access it can be confusing Leverage application.cfc to load ColdSpring AS/CF Conversion relies on medatata in CF and AS classes  ‘alias’ attribute in tag  [RemoteClass] metadata tag in AS Objects Accessing session inside body of remote methods can be problematic

June 27 th - 30 th 2007www.cfunited.com Common Pitfalls If we want a remote service method to accept a Struct we need to wrap it in an object in Flex  Arguments is already a struct Flex Dates are Calendar objects, with timezone information. Careful about using dates as Strings in CF Be careful about setting default properties in CF Domain Objects  May want to take advantage of ‘static initializer’, code outside cffunction tags

June 27 th - 30 th 2007www.cfunited.com Questions… Questions…