Hmm, I would probably go this route
 
- create a destination "level"
- the identity of this destination is levelID
- create an Assembler for this destination (e.g. LevelAssembler)
 
- create a destination "person"
- the identity of this destination is personID
- it has another property "level" which is a one-to-one relationship to 
destination "level"
- create an Assembler for this destination (e.g PersonAssembler)
 
So in the end, a Person instance holds a Level instance in the level property. 
 
To get a list of all Levels, you call fill() on the LevelAssembler. You can 
alos easily add/edit/delete Levels by using the LevelAssembler. When calling 
fill() on the PersonAssembler, the PersonDAO code is in charge of building the 
correct Person object and to build the right Level object on the Person 
instance.
 
Dirk.

________________________________

Von: [email protected] im Auftrag von tddclare
Gesendet: Di 29.08.2006 21:16
An: [email protected]
Betreff: [flexcoders] approach question: how to handle lookup table data?



I'm working to architect an app using Flex Data Services.

As a simple example, let's consider the office management application.

I have a Person class, who has all the normal properties, one of which
is "Level" indicating the code for their level of seniority ("A" "1"
"2" ... "5" "P" -- for partner).

These designators have changed in the past, and may change / be added
to in the future.  And we'll definitely want to use them to drill down
for reports, metrics, etc.

>From my database background, I would have my People table have a field
called levelID, which points to the Levels table having the ID and
Name fields.  My reports would be something like "Select * from people
where levelID = 3", etc.

What about Flex and Data Services? 

I'll want to show that Person X has a level of "P" but also let them
edit that person and pick off from a list of levels (comboBox), so I
need a way to get that list (and add to it, in case somebody gets
promoted to "Y" (yoda))

Should I have my Person class contain an instance of the Level class
which has id and title properties?  THat sounds easy, but with the
number of parameters I'm dealing with, it sounds like a lot of effort.
 I'd also have to parse ALL the People to create my pick list of
Levels... 

Or should I have the server FILL a collection of People (with their
levelIDs) and another collection of Levels and use cursors, finds,
etc. to match up the data?

Or go totally uncoupled and just pass the level NAME to the client and
have the server back end deal with the ID matching?

I think my brain hurts.  Any thoughts?  Thanks!





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<<winmail.dat>>

Reply via email to