I use FB to create my services and valueObjects.  

I then created a service base AS class which contains a datalist and an
index with getters and setters and defines the projects access to the
service.

For each Datagrid I want, I create a list class which extends this service
class.  In this class, I provide getters and setters for that lists DTO and
the get, set, and remove listeners and responders to interact with the
service and store the list data in the superclasses datalist.  The set and
remove function is based upon the index so when a response is received, the
responses data can be posted in the correct place in case the user has moved
on to something else or another record.  I also have a lookup function to
lookup the name of any list for combo boxes.

I also have a Type AS class which extends the service class and has the
lookuplistname functions which each type list extends.

I then have my DG classes which are mxml classes.  In here, I have the
datagrid which displays the datalist data with inline combo boxes and such. 
This file also holds any lookup lists but are instantiated in parent classes
and passed into this class.  I also have any add, change, or archive events
needed in case there is a sub datagrid based upon this datagrid.  I am using
the controlbar for add, update, archive buttons and any datagrid level
optins such as workdate or when loading data to include or exclude types of
data.  If this is a detail datagrid, then I have getters and setters for the
masters ID number which is passed in from the parent class.

I then have the parent class which organizes all the Datagrids for the
context of this screen.  For Master Detail datagrids, the change action is
done here and the ID is passed to the detail datagrid.  If there are any
datalist actions needed, it is done here.

And then there is the app mxml class itself which instantiates all lookup
lists.  accesses any settings class and passes the lookup lists and setting
onto the appropriate parent class.   I am using a TabNavigator to access
each of the parent classes.   I also have  a table tab so you can add or
change any of your lookup lists.  I have all lookup lists instantiated here
so if you make a change to one, the change is available to all tab screens.

The benefit of this structure is that it creates reusability and I can
create module apps and can include the modules into one master app if I
wish.

In the database backend, I have my lookup tables in one database which can
be accessed from any module.  And each module has its own database and so I
am accessing multiple databases in my EJB backend.  

So, in a nutshell, that is how I am structuring all my apps.   I was
wondering if anyone would like to comment on the pros and cons of how I am
structuring my apps and maybe even offer some suggestions on how to improve
on this structure.  



--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/How-I-am-using-Flex-and-AS-tp13023.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to