Flex :: Performance - Why Does Use A Single Threaded Model
Jul 10, 2009
Over the past few weeks I have been building a prototype application using a Flex front end connected to a J2EE backend using blazeDS. The prototype is an experiment to learn flex and see what its suitability is for a complex trading application requiring a large number of dynamic updates (i.e > 20 a second) via a pub sub type model. During some lightweight performance tests it's become apparent that I need to use multiple threads to ensure the UI remains stable when receiving a large number of updates from the server. All was going well until I discovered that flex has a single threaded programming model!
From a quick Google it looks as though there are numerous hacks to implement thread like behavior. I am sure many people must have been faced with a similar problem. Can people let me know: Are there any good threading libs that are well maintained etc Do other RIA technologies such as silverlight have the same problems. Why did abobe implement a single thread model? Are there any other tricks I can use to ensure my UI is stable.
View 7 Replies
Similar Posts:
May 17, 2010
I have data model (dataProvider as ArrayCollection) i want to display in few views , each view should show filtered data. As you probably know, filterFunction is property of ArrayCollection,so I can't use this solution (unless creating new instance of ArrayCollection for each view on top original and impementing filterFunction).
View 2 Replies
Nov 4, 2011
Will I take a big hit in performance using nested ViewStacks? Should I strive to handle all navigation in one ViewStack and push children manually or will the affected performance be negligible?
eg.
<viewstack>
<tabnavigator />
<tabnavigator />
<tabnavigator />
</viewstack>
View 2 Replies
Mar 19, 2012
We have a medium size Flex 3.6 application that contains around 20 different page views (managed via a single lazy ViewStack) each having multiple components. Most use custom renderers.All model data is loaded at startup and changes to model instances are communicated via binding and/or collection change events.Once the user has viewed each page at least once, all page views are instantiated and happily listen to update events.Which in effect means that each time a model instance changes, all interested views receive that event and compute derived data or trigger item-renderers.I have tested and confirmed this behaviour in a proof-of-concept application. Even when setting a list to being invisible, it still listens to collection change events and invalidates any renderer affected.What would you do?
View 1 Replies
Apr 10, 2011
As it is said here: [URL] "If you do a Google search today for "MVVM and Flex", the first post is by somebody who claims that MVVM is not a good fit for Flex. I couldn't disagree more. Out of the box, the Flex framework makes it much easier to implement a Presentation Model than similar MVVM implementations in Silverlight. That is not to say that there aren't good third-party libraries that make it easier in Silverlight, but without any help, it is easier to do in Flex." So MVVM as LOGICAL CONCEPT can be implemented in both but the way it is implemented in Silverlight requires more Plumbing than Flex.
What prevents Silverlight MVVM to be implemented like Flex ? Doesn't Silverlight have same capability in event system to do the same? If yes why does Silverlight do things more complicated what's the advantages then ? Is it about using Class Interfaces which are more strongly typed? What are the disadvantages also ? For example as for implementing MULTIPLE VIEWS for 1 View-Model does Flex implementation make it also more obvious?
View 2 Replies
Mar 30, 2010
I want to create a high performance server in C# which could take about ~10k clients. Now i started writing a TcpServer with C# and for each client-connection i open a new thread. I also use one thread to accept the connections. So far so good, works fine.
The server has to deserialize AMF incoming objects do some logic ( like saving the position of a player ) and send some object back ( serializing objects ). I am not worried about the serializing/deserializing part atm.My main concern is that I will have a lot of threads with 10k clients and i've read somewhere that an OS can only hold like a few hunderd threads.
View 4 Replies
May 23, 2008
I'm trying to build a program that can connect to all chat rooms that are create
Code:
_global.chat = new Array(new NetConnection());
_global.roomsOn = new Array(1,2,3,4,5);
[code].....
View 2 Replies
Jul 23, 2010
I am trying to figure out how to define a callback to my model object, via the Mate Frameworks LocalEventMap.
<EventHandlers type="{WebServiceEvent.RT_GET}" debug="true">
<HTTPServiceInvoker url="/services/rtGet.asp">
<resultHandlers>
[Code]....
I get essentially the same error if I try to make method="model.rtGetHandleResult"
So, in keeping with the presentation model... how do I have the event map get this to the model to execute?
View 2 Replies
Apr 25, 2011
I am working on an StoryBoarding application,it is a slide based application in which the authors can put several components like image , sound , captions etc in each of the slide.A collection of slides will make a storyboard.This application will be deployed on a web server (sharepoint + IIS , and php+apache), and several users can collaborate with each other for authoring or reviewing the storyboard.In my application I also want to support auto save ,which will keep on storing the state of the storyboard.User can also save at any point of time by clicking the save button.I am confused about how to store the state of the storyboard.
1)Presently I am doing this by passing all the storyboard data to a dot net web-service and then that service is storing images,caption etc in their respective tables into a database .2)Another approach possible is to store the model of the application as a serialized object into the db , which will be more convenient since separating the components of the model (like images,captions etc..) will not be required and also restoring the state of the objects in the application will be easy . I have two doubts about using approach 2 :-i) I want the the saved storyboard to load quickly, for which I would like to support the partial so that lighter objects like caption can be loaded quickly but other heavier objects like image,video etc can be loaded on demand. Using approach 2 , do I have to send the whole data in one go or is there way to support partial loading ?
View 1 Replies
May 5, 2011
In Flex world, is DTO / VO same as Presentation Model?
View 2 Replies
Mar 24, 2012
When the XMLListCollection is updated in the DataGrid, I want it to add the XML (bind it) into the Model. How would I do this? Or if not possible, how would I manually add XML into the Model?
This is a rough example of what I'm trying to do. Adding data to the DataGrid works fine; it just doesn't go into the Model when sending to the HTTPService.
<mx:Model id="model">
<root><colors>{collection}</colors></root>
</mx:Model>
<mx:XMLListCollection id="collection" />
[Code]....
View 1 Replies
Sep 12, 2011
this is what i'm trying to accomplish; With a click on a movieclip (cannon_mc)a shot is being fired (ball_mc)
The longer mouse is down, the speed of wich the ball is fired with should increase.My question to you is;
What is the most efficient way to accomplish this? With a timer or something like this;
[Code]...
View 2 Replies
Jan 11, 2011
I'm devloping some library classes for flocking/steering behaviours on large numbers of objects (2000+). I'm finding that at < 500 instances, performance is reasonable. As the numbers increase, framerate bogs down.
I've seen remarkable performance with libraries such as Flint or Box2D with ridiculous #'s of particles / objects, so it should be possible to optimize / refactor my code to be a bit better.
I'm aware of the basic optimizations, such as bitwise operations and optimized for loops. Are there any more fundamental approaches I should be considering? For example, currently each instance is a vector-based MovieClip. Would working with BitmapData be more efficient?
View 1 Replies
Feb 10, 2010
i have a question about Zend Framework and mainly the model part. I know there is no abstract model class and understand why. I red a lot of blog posts about it, but couldn't find any example that would clearly explain it to me. I'm building a very basic application. Lets imagine we have just three tables.company(ID, name, street, streetNo, Town), meta(ID, name, description), company2meta(ID, companyID, metaID, value, note). All types of realtionship are there (1n n1, nm). The a need also services (amf) with Value Objects. So, here is what I think:
[Code]...
View 1 Replies
Mar 9, 2010
I'm using MATE on an Adobe Flex project for MVC. On one of our pages, we have a dialog window that is presented to the user that displays them information that comes from RPC. The pages where this dialog pops up is unrelated to the data being displayed so this is a separate model. How do I create a MATE mapping file that will create the dialog window, make it visible to the user, and then inject in data from a model?
View 1 Replies
Mar 29, 2011
I have some values stores in my model. I need to create a copy of those values, make some changes, and then output those changes without affecting the model values.
var my_source:Array = model.something.source
var output:Array = new Array();
for each (var vo:my_vo in my_source) {
[code].....
View 2 Replies
Jul 3, 2011
I have designed "the core" of the application i am working on ( it communication with the server, data processing, etc. ), and now i am a bit stuck on the User Interface, because i wish it to be specific, and probably different on the different platforms it goin to run on ( PC, tablet, gsm ).
My question basically is How to separate the "core" of the application, which must remain the same for all of the platforms, from the UI's which shall be very different applications ?
View 1 Replies
Jul 5, 2011
In Cairngorm (Flex Framework), there is Model Locator Pattern, which is similar to Global variables, is it a right pattern, Adobe is saying for flex its best pattern
[Code]...
View 1 Replies
Jul 13, 2011
I have a TitleWindow that I open up... and I have 6 states defined.I am using the Presentation model pattern for all of my views. When I tell my window to go to XXX state, the controls have to initialize since the states in flex use lazy loading. so... my PM code that says myTextArea.text bombs out and say "cannot access..." so as a work around, I made some creationComplete events on my controls to register the control with the PM. So when the state changes, the textarea finally initializes and on creationComplete calls PM.registerTextArea() which sets a reference to it. then in that function I run my code... myTextArea.text.. etc.
This seems like such a ugly hack that I hate it. Is there any way to wait until the entire state in created then call code on the PM? I have tried enterstate... but this event seems to fire before the state controls are ready.I tried to add a comment, but I guess editing is the only way I can do this...I am doing something slightly off straight PM. Every view has a viewController (as I call them). Its kinda my own hybrid of a delegate / dataprovider. But this is moot. It's the flex component lifecycle when dealing with states that is the pain.if you change state.. there is no event to say "all my components in this state are ready".only event to say "we changed state". so my code that fires on state change is trying to talk to components that aren't ready yet.So from what I see, there seems to be no design pattern or perfect way to ensure that all components are created in a state unless using creationComplete on every component in the state to register it is ready... if you don't, you get a race condition. Regardless of frameworks or design patterns, this seems to be a root issue.
I am trying to attach video to a display once I get to that state. This is done via addchild. regardless of where I do it.. I need to know that the videoDisplay is done loading before I call addchild. I even tried currentStateChange event since docs say that fires last... but alas.. the components in the state are still initializing. So it seems that creationComplete is my only option. Maybe the only sane way to keep to clean code is to create the entire thing(videodisplay and video) using as once the state is entered. I just hoped the flex framework had events to ehlp me here rather than buiilding everything on the fly in as.
View 1 Replies
Dec 2, 2011
How to send to the skin some value which have changed?
View 1 Replies
Jan 25, 2010
In my Flex Project using Cairngorm, I have a model that stores a bindable ArrayCollection displayed by a DataGrid. My problem occurs when the model is updated by the responder (from a Java service, after an "update" event), because the focus located in a cell of the DataGrid is lost (the scroll position il also lost). So, I retrieve the position before the update, with DataGridEvent.ITEM_FOCUS_IN event :
myModel.focusedCell.rowIndex = e.rowIndex;
myModel.focusedCell.columnIndex = e.columnIndex;
But, from where restore these parameters ? How to trigger this update only when the model is updated ?
View 1 Replies
Dec 2, 2010
I have a DAE model that is parsed into several parts. I am able to deal with them separately, such as changing their material or colour but I am having problems adding click or hover listeners over the children. For example, lets say I have a model of a kitty where each facial feature is a child. I want to be able to hover or click the features and have a window pop up explaining the feature. I've tried parsing the model and adding listeners but it doesn't seem to work.
View 1 Replies
Apr 11, 2011
I'm refactoring some Flex code written by another developer and I'm implementing a PresentationModel approach, as I like to separate out the ActionScript from the MXML. One of the problems I've found is that the original ActionScript code adds/removes elements from the MXML.What happens is the handler function checks the model and if the values are correct will either create or remove a element from the view. What is the best way to get the presentation model to ad elements to the view and still keep this loose coupling that I'm aiming for.I was thinking of using simple events which the presentation model dispatches and a view can list for passing the details of the element to add.
View 2 Replies
Jul 25, 2011
Is model injection on the fly possible? In other words,if I ask for a model of the type IPhotoModel, I should get one of its implementations based on the current state of the view. If I am looking at a UserPage,I should get a user-specific implementation of that model.I am looking at a LocationPage,I should get a location-specific implementation.Currently, the only way that I see is introducing a command that specifies the model mapping, with a concrete one based on the current view state ...
injector.mapValue(IPhotoViewModel, injector.getInstance(UserPhotoViewModel)) or
injector.mapValue(IPhotoViewModel, injector.getInstance(LocationPhotoViewModel))
is this the best way possible? I do not really want to introduce much coupling logic outside of the context, but ...
View 1 Replies
Jan 24, 2012
I have some data in collection from which i have to create hierarchy diagram in Flex.
View 1 Replies
Oct 25, 2010
I am working on an Adobe AIR (2.0) application that contains a feature to allow users to print documents (such as salary slips). Those documents are originally in PDF format. Due to circumstances we cannot directly display those PDFs in the AIR application (for example using flash.html.HTMLLoader). Therefore we convert the PDFs to SWFs (using the pdf2swf tool, see The SWFs are loaded into the application using a mx.controls.SWFLoader, like so:
<mx:SWFLoader
id="salarySlipImage"
loaderContext="{someLoaderContext}"
[code].....
View 2 Replies
Nov 4, 2010
using model driven development in developing enterprise applications. Adobe's LiveCycle Data Services looks very promising, I have found numerous tutorials/videos that shows how fast an application can be build by having methods/functions auto-generated.What are the best-practices, is it good/bad to use those auto-generated methods, they can really save a lot of time.
View 1 Replies
Jun 18, 2010
What are your advises on using model driven development in developing enterprise applications. Adobe's LiveCycle Data Services looks very promising, I have found numerous tutorials/videos that shows how fast an application can be build by having methods/functions auto-generated.What are the best-practices, is it good/bad to use those auto-generated methods, they can really save a lot of time.
View 1 Replies
Jul 1, 2011
I would like to implement the MVC pattern to an existing Flex project.I want to separate out the controllers and models from the views. They currently all live together in large mxml files.My question is, should httpservice requests be in the model or the controller? What sort of advantages/disadvantages would there be to either?
View 3 Replies
Aug 30, 2010
I am preparing a document for a project. The project's backend is developed in Java, frontend is adobe flex.
I am not sure about the correct way of describe the project in Model-View-Controller way.
For Model layer: Using Hibernate Java beans to implement all the business logic and persistence? For View Layer: Using Adobe flex send post or get request to Controller layer, and get respond in XML format. For Controller Layer: Using Java servlet to handle requests from Flex client?
View 2 Replies