Having one component with different states or a viewstack with all of the options may be attractive for a few variants, but I'd probably go for instantiating a specific UI interface once it's known which is required. You could either base the UI variants off a common ancestor, or use a common interface.
In flex it makes little difference if a component is created from MXML or actionscript. Given the clear uncertainty that you have I would suggest an initial implementation with a couple of UI variants and see how well it works for you rather than try and get the whole thing right first time. Paul ----- Original Message ----- From: "Michael Wills" <mich...@mawills.com> To: <flexcoders@yahoogroups.com> Sent: Monday, March 09, 2009 11:06 PM Subject: Re: [flexcoders] Architecture / Design question... > Wow yeah that would depend on a lot of things. Some thoughts that help > me narrow down prospects like that: > > Am I doing all of the subcomponents in MXML? If so I could manage it > with States perhaps using addChild. Pass the state in on > instantiation/show/creationComplete, etc. > Am I doing all of the subcomponents in AS3? Then I can dynamically > instantiate things on the fly depending on those requirements. > Whether or not I actually use the states tags, are their actual "states" > with shared components? If so I might make a set of flags. If flag x is > present, add component x, or if y is present, add y. > > But it depends on how detailed it needs to be, and how convoluted the > solution might be. It might be better not to put it ALL in one > component, but have one component that loads subsections as well. It all > depends on what you need. And, just a caveat, I am not a Flex guru. They > might pine in with much better solutions. > > Michael > > tchredeemed wrote: >> >> I have a situation in which I am currently using a very ugly set up to >> get the job done, but I want to change this (will explain) and I am >> looking for some insight. >> >> The process is this. >> >> A user gets to a piece of our app and they are presented with some >> options. The options are very different depending on which route they >> take to get there. >> >> For instance, they might see a checkbox about saving a piece of their >> file as a note. >> >> They might see a set of radio buttons to order different quantities >> (in this case the price can change depending on which radio button is >> selected [the price is on the same screen]). >> >> They might see a mailing address or an email address, depending on the >> medium of the item they are purchasing. >> >> Basically, the options vary greatly, so I currently have a different >> custom component depending on which they are using. >> >> I want to be able to use one component and have different options on >> that component, but I am not sure of an efficient way to do it. >> >> I know this is random and probably not easily answered without a >> specific understanding of the system, but I thought I would ask :) >> >> > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > >