Monday, November 14, 2011

Flex Interview Questions

1)    How will you remove the first element from the Array?
The elements from the Array can be removed by using splice method. splice method accepts mainly two arguments. First one tells the starting index and second one the number of elements to be retrieved. This will return an array of the spliced elements. See the code below.
Var arr:Array= new Array(“a”,”b”,”c”,”d”);
Alert.Show(arr.toString());
Arr.splice(1,arr.length-1);
Alert.Show(arr.toString());
2)    Can you share with us your experience regarding performance of the Flash 9 in a real time mode? What are your thoughts on advantages of using Flash 9 say in a real-time trading applications comparing to a tried-and-true Java Swing front end?
A.
 Flex is very capable of providing near real-time data rendering to the GUI and very high refresh rates on large data sets. Flash Player 9 is the high-performance modern virtual machine with precompiled optimized code and just-in-time (JIT) machine code compiler. And it is very possible to build the client portion of a real-time portfolio display integrated with news feeds and graphs with about 100 lines of Flex 2 code. A similar Java Swing program (even if it’s created by commercial IDEs) would be on average ten times larger.
The real selling point becomes obvious on a second or third day of the proof of concept phase. A decent Flex developer should be able to prototype (short of server processing) most of the UI for specific trading system by the end of the first week. If you are lucky and the system integration went fine, you can add the collaboration features and multimedia – with total client code base for the whole project within 1000-1500 lines.
3)    if you move from one page to another in a pure Flash Web site, can you bookmark, say page #4?

The bookmarking of the sites is still available on the browser. But in Flash-based applications you do not move from one page to another as there is no roundtrip to the server – essentially you are on the same URL all the time. What looks like a page to the user is just another screen in the either monolithic or dynamic application. The approach I would take is to make application bookmark the data the user is looking for – that provides you much richer insight into the user’s preferences and type of information he is customary searching for. That data would be associated with user and combined with regular URL bookmark upon the user re-logon/cookie retrieval.
4)    What are three ways to skin a component in flex?

Skinning is the process of changing the appearance of a component by modifying or replacing its
visual elements. These elements can be made up of images swf files or class files that contain
drawing API methods.
There are several ways that you can define skins: inline, by using the setStyle() method, and by using
Cascading Style Sheets (CSS).
5)    How do I get access to the J2EE session from my RemoteObjects?
The AMF Gateway provides access to the current HttpServletRequest instance in a thread local variable. The session can be obtained from the request, as follows:
flashgateway.Gateway.getHttpRequest().getSession();
6)    Why are my ValueObject member variables undefined in the results from my RemoteObject requests?
Flash Player deserializes objects in a special order that can confuse developers used to object serialization from other RPC systems. When a strongly typed object is returned to the player, it first creates an instance from the prototype of the registered class without calling the constructor. It then populates the object with the properties sent in the result. Finally, it calls the constructor without arguments.

If your ValueObject constructor expects arguments to initialize an instance, be sure to check whether arguments were actually sent to the constructor before overriding member variable values.
7)    What is MVC and how do you relate it to flex apps
The goal of the Model-View-Controller (MVC) architecture is that by
creating components with a well-defined and limited scope inyour application, you increase the
reusability of the components and improve the maintainability of the overall system. Using the MVC
architecture, you can partition your system into three categories of components:
* Model components Encapsulates data and behaviors related to the data.
* View components Defines your application's user interface.
* Controller components Handles the data interconnectivity in your application.
8)Explain Metadata
You insert metadata tags into your MXML and ActionScript files to provide information to the Adobe Flex compiler. Metadata tags do not get compiled into executable code, but provide information to control how portions of your code get compiled.

9)What are the channels and their types
The Channel class is the base message channel class that all channels in the messaging system must extend.
Channels are specific protocol-based conduits for messages sent between MessageAgents and remote destinations. Preconfigured channels are obtained within the framework using the ServerConfig.getChannel() method. You can create a Channel directly using the new operator and add it to a ChannelSet directly
In Flex AMFChannel is used mostly. Action Message Format
Methods
applySettings (),connect(),connectFailed(),connectSuccess(), connectTimeoutHandler()

disconnect(),disconnectFailed(),disconnectSuccess(),flexClientWaitHandler(), getMessageResponder(),internalConnect(),internalDisconnect(),internalSend(),logout()
send(),setCredentials()
Properties
reconnecting,recordMessageSizes,recordMessageTimes,reQuestionuestTimeout,uri

10)  When I set visible="false", the component still takes up space and appears in the tab order. Why is that?


You can often achieve the "display=none" effect by setting the height/width to zero when you set it invisible, and then set it back to a fixed value or to undefined when you make it visible again

1 comment:

  1. Also read More DataGrid Questions and Answers
    http://allinterviewquestionsandanswerspdf.blogspot.in/2016/06/top-28-datagrid-grid-view-interview.html

    ReplyDelete