Posts Tagged ‘architecture’

Flex Framework for SalesForce Apps- Part 1 Warm Up

September 7, 2010

We have been working on a few sales force – flex apps for our customers since last September. Initially all the entities involved can really overwhelm you. It is extremely critical to get the application architecture right because the data model is mostly dynamic and also the toolkit has its own overhead.  We are trying to share the approach that we use to build SFDC – Flex apps.

Let warm up. Starting from salesforce terminology:

1. ToolKit: Salesforce.com provides a toolkit (actionscript library) using which you can communicate with the salesforce.com platform. Using this toolkit gives a head start to your SFDC- Flex Apps

2. Apex Webservices: SFDC has a language called Apex using which you can create webservices to access you application. It is predominantly based on Java, however, there are a few restrictions

3. Visual Force: VisualForce or VF is a UI technology for salesforce, primarily driven on Ajax it allows integration of Flash components (read SWF) into it. You can write JavaScript into it and hence has a big advantage. There are other UI things like S-Controls which we need not look into now.

4. Static Resource: In simple terms a static resource is any media,document,file which needs to be uploaded to SFDC for your project. So the SWF will be uploaded as a static resource. (Rather the entire output folder from flex)

5. <Apex:Flash>: This tag is used inside the VF page to help you embed swf. You can pass FLASHVARS set height, width.

6. Briefcase (AIR apps): Briefcase is a SalesForce concept using which you can create off-line applications. Add objects to the briefcase (though some objects like case can not be added to it) and then you can sync data from your off-line application.

7. Org: Your part of salesforce.com which you can customize and use as your requirement. Every customer has his own org and his own installation (package) of the application

8. sObject: sObject refers to any object that can be stored in the Force.com platform database. An sObject variable represents a row of data and can only be declared in Apex using the Web services APIname (the name with which the object is identified) of the object. This is of high importance as most webservice communication will involve sObjects

You can build you project either based on web-services or write the business directly onto the flex calsses, we do not use the later as we want flex to be unaware of the core business and keep it as generic as possible. However the framework is equally applicable to any type of project. ideally on the salesforce front if you are making webservices there should be good care taken to ensure only one webservice class is exposed to flex and the rest of the things can be in remaining wrappers.This keeps the architecture much more robust and generic.

Some warm up on the flex side (assuming you know flex):

1. Depending on the type of project you want to build (Flex or AIR) include the SWC of the toolkit which can be downloaded from here

2. It is good to have the code linked for the SWC since you will need to go to and fro

3. Setting up the architecture:

Apart from flex UI, the architecture contains 2 key elements: 1. The Controller and the Async Tokens

In the next part we exclusively look at the concept of the architecture, various entities and the working.


%d bloggers like this: