eBay integration in Flex

Work has been quite demanding lately but hopefully I will be able to post more regularly now.

I had planned to integrate eBay into SiteFinity via custom user controls but I decided to instead write the integration in Flex and integrate that into SiteFinity. It will make it easier for my client to add new versions since I only need to give them the SWF file and they can upload it themselves. I already know that we will need to support both search functionality for eBay auctions and ability to list items for auction and possibly other types of functionality. I decided to create a POC first and integrate that into SiteFinity before adding more interesting functionality. I focused on getting the infrastructure set up before making it look spiffy. In this post I'll show how to create the Flex binary. The SWF and source code has been posted here.

I decided to use one of the Flex MVC frameworks because I already know I will need to support several screens and it will make it easier to support. I picked the Mate framework, because it fits so nicely into Flex and it's non-intrusive. Mate strongly encourages you to separate the logic into views, event maps, events and business objects shown below.

The communication between the view and event handlers is handled via the Event Bus. An event is dispatched from the view and the event bus figures out which event map that listens for the event that was dispatched. The event map calls services and/or business objects. Commonly the event map also have injectors that binds properties in the view to business objects.

The event map in my POC is relatively simple displayed below.

This event map listens for the event SearchRequestEvent.GET and calls a business class SearchInvoker. This class makes a call to eBay using their Flash based API and dispatches either a success event or a fault event that gets handled inside the event map.

The event map also has Injectors that sets up the binding between properties in the view to the SearchManager. These injectors are initialized first before any custom events gets dispatched from the view.

The next step will be to add the SWF to SiteFinity.

  1. gravatar

    # by Tom Hardy - June 12, 2013 at 10:43 AM

    So how well does your tech-flex cooperate with this program? I realize no program is perfect but how close are you to that goal?