Flextrine 0.7 released – now with ZendAMF!

After much soul searching I eventually decided to put in the time to convert Flextrine from using AMFPHP to ZendAMF.  There were a few reasons I decided to make this move, but eventually it boiled down to the fact that quite a few people had asked me to do so.  In retrospect it was certainly the right thing to do – ZendAMF has the green light from Adobe, its licence is LGPL instead of GPL and the cleaner code base means that the changes Flextrine requires can be implemented as overridden classes instead of having to modify the ZendAMF core.  This particularly is great news because it means that you can use Flextrine directly with the standard Zend framework installation, whereas previously you could only use the version of AMFPHP bundled with Flextrine.

Functionally speaking things remain exactly the same, and we continue to approach our stable release alongside Doctrine 2.

The new version of Flextrine can be downloaded from www.flextrine.com.  Note that if you are upgrading from a previous version of Flextrine you will need to regenerate your AS3 entities.

Flextrine Tutorial – CRUD in a simple Flex 4 address book: Setting up the server

Introduction
Setting up the server
Creating the entities
Creating the database schema
Loading the entities
Creating new entities
Deleting entities
Updating entities
Conclusion

Before using Flextrine you need to do some groundwork to get your project ready.

  1. Download the latest version of Flextrine from http://code.google.com/p/flextrine2/downloads/list
  2. Install the Flextrine manager.  This is as simple as copying the manager directory from the Flextrine download into a web-accessible directory.  For the purposes of the tutorial I will assume that you have set the URL pointing at this document root as http://localhost/flextrinemanager.  Note that you will require mod_rewrite to be enabled on your webserver for the manager to function correctly.
  3. Install the Flextrine server side libraries.  These are contained in the flextrine/web/lib directory of the the Flextrine download.  All you need to do to install these is to copy flextrine/web/lib to a directory in your PHP include_path, or ammend the include_path to include the flextrine/web/lib directory.  Note that if you don’t want to change your include_path you can set it explicitly after the next step by uncommenting the $flextrineIncludePAth line in config.php of your project (see http://code.google.com/p/flextrine2/wiki/GettingStarted for more details).
  4. Install the latest version of Doctrine 2 from http://www.doctrine-project.org/projects/orm/download.  Doctrine 2 is the technology that Flextrine is based upon and required for its operation.  The easiest way to install Doctrine is to merely extract the package into flextrine/web/lib as this is already in your PHP include_path.  Alternatively you can add a new entry to your include_path pointing to Doctrine.
  5. Create an empty server-side Flextrine project.  The Flextrine download contains a blank project in flextrine/web/flextrineproject which will be your starting point.  Copy this to a new directory on your machine and make this directory web accessible.  For the purposes of this tutorial I will assume that you have set the URL pointing to this directory as http://localhost/contacts and will refer to the directory as the Flextrine server side component.
  6. Create a new MySQL database called contacts.
  7. In your Flextrine server side component open up config.php and set the database connection options in the $connectionOptions variable.

Note that next time you start a new Flextrine projects you only need to do steps 5 – 6 as steps 1 – 4 only need to be done once.

Now we are ready to use Flextrine!  The next step is to create some entities.

Flextrine Tutorial – CRUD in a simple Flex 4 address book: Introduction

Introduction
Setting up the server
Creating the entities
Creating the database schema
Loading the entities
Creating new entities
Deleting entities
Updating entities
Conclusion

UPDATED FOR FLEXTRINE 0.6.5!

After numerous requests I have finally sat myself down to write a basic tutorial for using Flextrine in a practical and simple Flex application.

What is Flextrine?

In a sentence, Flextrine is an open-source solution for reading and writing AS3 objects to and from a remote database.  Flextrine doesn’t really do anything that you couldn’t do by hand using PHP and AS3 code, but it removes most of the grunt work and standardises client-server database interactions.  All being well, database aware Flex applications coded using Flextrine are shorter, more readable and more maintainable.

Documentation for Flextrine is available in its Google Code wiki and its definitely worth having a skim through before beginning the tutorial.

What shall we build?

In this tutorial we are going to demonstrate some of Flextrine’s functionality by building a simple online contacts manager.  The application will allow us to create, edit and delete contacts, each of which simply have names and telephone numbers.  In order to demonstrate some of Flextrine’s associations we will also allow the user to put contacts into groups.

Note that the purpose of this tutorial is to demonstrate Flextrine rather than Flex, so we won’t be using any frameworks (apart from Flex itself) and where there is a choice between an elegant programming solution and just keeping it simple we’ll be going for the simpler option 🙂

Requirements

To run through this tutorial you will need the following:

  • Flex SDK 4 (free from Adobe)
  • A nice Flex IDE – I personally use the wonderful FlashDevelop, but Flash Builder 4 will do just as well
  • A web server running PHP 5.3+ and MySQL (WAMP for Windows and MAMP for OSX are good choices)
  • Download the complete source code for the tutorial and save yourself tedious typing!  This does not include the Flextrine AS3 code so you will need to add the source code or SWC to your classpath manually before compiling.

Lets begin by installing Flextrine and its dependencies.

Flextrine chosen for elevator pitch at Flash on the Beach 2010!

My open source ORM project Flextrine has been chosen as one of 20 projects to present at this years Flash on the Beach, in Brighton this September.  I get three hectic minutes to showcase Flextrine and try and demonstrate what it can do 🙂

If you find yourself at Flash on the Beach this year come down and listen!

http://www.flashonthebeach.com/sessions/index.php?pageid=2999
http://code.google.com/p/flextrine2/

Flextrine 0.5 released!

I have released the first public version of Flextrine.  Its actually pretty feature rich, and I will be focusing mainly on bug fixes and stability as reports start to come back from the community leading up to the main release on 1st September.

Major features that have made it into 0.5:

  • Entities and the entity manager
  • Single and collection associations
  • The Flextrine Manager
  • AS3 code generation
  • Lazy loading, requireOne and requireMany
  • Full Flex databinding
  • DQL queries

Flextrine can be downloaded from Google Code at http://code.google.com/p/flextrine2/  Please try it out and log any issue you might find in Google Code.

Announcement of Flextrine 2

Flextrine Bar

I am most proud to announce the development and upcoming release of Flextrine – an open source project I am developing that simplifies and encapsulates ORM with Flex and PHP.  Very simply, Flextrine maps AS3 objects to database tables giving you the ability to save and load objects to a remote database without having to worry about any server coding.  It supports all usual associations, local caching, indexing, Flex databinding and many other things, as well as having a nifty web interface for generating schemas and stubs.

Flextrine is planned for release on 1st September to match the release of its parent project Doctrine 2.

Check out http://code.google.com/p/flextrine2/ for more details.

Nike Team Kit Builder

As this was such a large project I couldn’t fit all the bits in my portfolio page, so here is a list of technologies and collaborations along with a selection of pretty screenshots.

The majority of work was performed off-site, and if you would like to see it in action you can go and create your very own team kit on the first floor of Niketown, Oxford Street, London.

UPDATE: This project has at last been modified into a web-friendly version and put online, so you can now see many of the original features and create your custom kit on Nike’s site at http://www.nike.com/nikeos/p/nikefootball/en_US/kitbuilder

Technologies

  • AS3, Flash CS3 and a lot of complex OOP
  • A custom MVC framework developed specifically for the project
  • XML and E4X
  • Papervision 3D (GreatWhite)
  • Blender
  • AMFPHP
  • MySQL, AdoDB & ActiveRecord
  • Smarty
  • Dynamic mail generation
  • Database administration and setup on OSX

Collaboration

  • Working closely with one other developer throughout the project lifecycle
  • Remote working using SVN and remote administration through VNC
  • Working with a large team of artists and designers, including 3D designers

Screenshots

Matchday/training selection screen
Matchday/training selection screen
Team formation selector
Team formation selector
Matchday player top editor
Matchday player top editor
Papervision 3D real time mapping
Papervision 3D real time mapping
Style selector
Style selector
Socks style and colour editor
Socks style and colour editor
Live preview screen
Live preview screen
Matchday/training + preview
Matchday/training + preview
Checkout and confirmation screen
Checkout and confirmation screen
Shipping details screen
Shipping details screen