
Froody::Implementation - define what should be run for a Froody::Method

# run the code from the froody method my $implementation_obj = $froody_method->implementation(); my $response = $implementation_obj->invoke($froody_method, \%params); $response->render;

You probably don't care about this class unless you want to change the way that your Perl code is called for a given method (e.g. you want to dynamically create methods or do something clever with sessions.)
Froody::Implementation and its subclasses are responsible for implementing the Perl code that is run when a Froody::Method is called. Essentially a Froody::Method only really knows what it's called and that the instance of another class - its implementation - knows how to run the code.
In reality, all a Froody::Implementation really has to do is implement an invoke method, that when passed a Froody::Method and a hashref containing named parameters can 'execute' that method and return a Froody::Response:
my $response = $implementation_obj->invoke($froody_method, $hash_params);
This module provides a default implementation that calculates a Perl method name by transforming the Froody::Method name. Before it runs that method it pokes around with the arguments passed in based on the Froody::Method's arguments. When that Perl method returns, it transforms the hashref that code returned into a proper Froody::Response based on the response defined for the Froody::Method that is being processed. Essentially, it wraps the Perl code that you have to write in such a way you don't even have to think about what's going on from Froody's point of view.

A get/set accessor that gets/sets what class the Perl code that actually implements the code here is created.
Given a Froody::Method object, require and return the module that the method will be dispatched to.
Returns the context of the current invocation. By default this return the class, so it's not instantiating. Override this to provide session management in store_context.
Serialize the current context into $response. By default this does nothing, you can override this and add a cookie to the response object.
Run Params::Validate with the the given spec. By default this is called in pre_process, and will filter out params that is not in the spec.
Called by invoke before the actual method call. verify_params is called by default. $params is a hashref and can be modified to be passed in for invoke. Currently the split of comma-separated values (type=multiple) arguments is also handled here.
Builds a Froody::Response::Terse object according to the method's response specification and the data returned from the method.

Froody::Repository, Froody::API and for other implementations Froody::Implmentation::OneClass and Froody::Implementation::Remote

Copyright Fotango 2005. All rights reserved.
Please see the main Froody documentation for details of who has worked on this project.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.