Thursday, September 22, 2005

ColdFusion® Flash® Remoting Role-Based Security by Darron Schall

This example provides role-based security for Flash® Remoting using ColdFusion®. The example manages roles on the server-side and prevents unauthorized remote method execution. The example ships with full client and server code. Amazing work Darron!



This example is a great template for implementing Flash® Remoting within company projects or consulting work. The example allows you to get remoting working quickly and provides a security implementation that is easy to work with. As with all IFBIN examples, there is ample comments and documentation to allow you to understand what is happening at every stage of code execution. In Darron's consulting work he starts all remoting projects with this example.

Additionally this is a great V2 component example using a class. The external class "ExampleForm" provides all the UI logic, events, and remoting logic that make this application work.

Another interesting thing in this example is Darron's use of constants for event naming. In the "ExampleForm" class you will find this line of code:

private static var CLICK:String = "click";


When I asked Darron about it he noted that using constants you let the compiler find your errors for you. In a way it is choosing the "lesser of 2 errors". You can either hunt through your application to find a mispelled 'click' string, or you can let the compiler find them for you.

Here the misspelling would compile fine, but would result in a runtime error:

login.addEventListener( 'clack' , Delegate.create( this , onLoginClick ) );


Here is how Darron does it:

login.addEventListener( CLICK , Delegate.create( this , onLoginClick ) );


If you mispell CLICK, the compiler will let you know about it!

Considering this example took Darron about 14 hours to create and several projects to refine, you will save lots of time reusing this example. By reusing the examples within Flash® By Example, you will complete projects faster and save development time.

In addition to this example, we have several other remoting examples based on this codebase. Look for these examples shipping soon:

Flash® By Example:
AMFPHP Flash® Remoting Role-Based Security
ASP.NET Flash® Remoting Role-Based Security
JAVA Flash® Remoting Role-Based Security

Flex® By Example:
ColdFusion® Flash® Remoting Role-Based Security
AMFPHP Flash® Remoting Role-Based Security
ASP.NET Flash® Remoting Role-Based Security
JAVA Flash® Remoting Role-Based Security

I must publically thank Darron for providing such an important example of Flash® application development using remoting. I am sure that many great projects will benefit from your effort. Great work Darron!

This example is available with full source and documentation within Flash® by Example.

More to come.

Ted :)

0 Comments:

Post a Comment

<< Home