Adobe Flex Interview Questions and Answers for freshers and experienced
• What Is The Use Of Disableautoupdate Method?This method prevents the events that represent changes to the underlying data from being broadcasted by the view. It also prevents collection from being updated. This method is useful where multiple items in collection are being edited at once. By disabling the auto update the changes are received as a batch instead of multiple events. Also in a DataGrid this method prevents update to the collection while a specific item is selected. When item is no longer selected the DataGrid controls calls enableAutoUpdate() method.
• What Events Are Used By The Collections?
Collections dispatch CollectionEvent, PropertyChangeEvent and FlexEvent objects.
o Collections dispatch a CollectionEvent when there is a change in collection. The property kind for a CollectionEvent object can be used to find which kind of change occurred. This property is compared against CollectionEventKind constants to find what the change was for example, UPDATE etc.
o The CollectionEvent object includes an items property that is an array of objects. For ADD and REMOVE kind events this contains added or removed items, but for UPDATE it contains an array of PropertyChangeEvent objects.
o PropertyChangeEvent class has kind property to indicate the way in which property changed. This can be determined by comparing kind property with PropertyChangeEventKind constants, for example UPDATE. This event object also has properties to indicate the values before and after the change.
o View cursor objects dispatch a FlexEvent with type property mx.events.FlexEvent.CURSOR_UPDATE when the cursor position changes.
• What Is A View Cursor?
A cursor is a position indicator; it points to a particular item in the collection. We use view cursor to traverse items in a collection’s data view and modify the data in collection.
A view cursor includes following methods:
1. The moveNext() and movePrevious() to move the cursor forward or backward. Use beforeFirst or afterLast properties to check whether we have reached the bounds.
2. The findAny(), findFirst() and findLast() methods move the cursor to an item that matches the parameter.
• What Is A Filter Function?
We use this function to limit the data view in the collection to a subset of source data object. The function must take a single Object parameter, which corresponds to a collection item, and must return a Boolean value specifying whether to include the item in the view.
• What Is A Metadata Tag?
These tags provide information to Flex compiler regarding the usage of our component. Examples are Bindable, Event, DefaultProperty, Inspectable etc.
• Does Exclude Or Exclude Class Really Excludes The Data Or Class?
Exclude(and ExcludeClass) tags simply influence the set of choices that are available in Flex Builder. They don’t exclude the classes from linking, which is a general misconception. There are MXML options to say “I want to treat this symbol as exteranally defined” . Depending on how we compile our application, generally the classes that are included are those that are referenced from the root application or classes, either directly or via some other class that is referenced directly or not from the root application or classes. The -link-report mxmlc option is very useful in that it tells us
0. what all is in our swf, and
1. who depended on each class to cause it to be included.
• What Is The Difference Between Viewstack Vs Viewstate?
Actually ViewStack and ViewState are not related. View states give one way to change the look and feel of a component in response to user action. We can also use navigation container e.g. Acordion, ViewStack, Tab navigator etc. Choice of selecting navigation container or states depends upon requirement of application.
0. View stack is a component used to display different views (normally different data), one at a time. View states are related views of a single set of data. For example normal view and advanced view for a image.
1. In ViewStack components can not be shared easily between the different views, they had to be created each time view is changed. For example if we want a search box in every view, then it has to be created in every view. States work with transitions. We can apply various changes to a same component in various states. They will appear according to states.
• What Are The Differences Between Flex 3 And Flex 4?
There can be lot of syntactic or other differences between the two, but major difference is: In Flex 4 the architecture of components (most of) have got changed. These components (called Spark the older ones in Flex 3 are called Halo) have separated the role of developer and designer. Spark components have one main core component class (written in actionscript) that contains the main logical part and one Skin class that handles all the visual aspects. We can say core component is skeleton and skin is its visual appearance. For example spark button has one core Button class and one skin class for it.
• What Are The Advantages And Disadvantages Of Using Flex? And Why Flex Wins Over Other Technologies?
Flex is very mature component-based development framework that reduces the development time and gives very good results. There are plenty of advantages: Easy to learn, Flash Player available widely, Works really well with other back-end technologies (specially with java), based on components so very easy to debug and fix, also has a very good IDE etc. The disadvantages are: applications used to be slightly heavy etc. But all of them can be handled to a good extent by following up best-practices and good application architecture.
• What Is Flex?
Flex is an application framework (yes it is a framework!!) that allows developers to build rich applications for desktop (using AIR), web, mobiles and tablets (iOS, android, blackberry etc). The web applications (SWF Files) run in Flash Player which is available in more than 90% computers across the world. For desktop-based applications AIR is needed. There are two main building blocks for development in Flex: ActionScript (used mainly for Logic part) and MXML (used mainly for declaration of tags and components etc).
• Explain Data Binding In Flex?
Data binding is the process by which changes in one action script object are reflected in another action script object. (OR) Data binding automatically copies the value of a property of a source object to a property of a destination object when the source property changes.
Data binding requires a source property, a destination property, and a triggering event that indicates when to copy the data from the source to the destination. An object dispatches the triggering event when the source property changes
Adobe Flex provides 3 ways to specify Data binding:
0. Curly braces ({ }) syntax in mxml and [Bindable] metadata tag
1. <mx: Binding> tag in MXML
2. BindingUtils.bindProperty/bindSetter methods in Action Script at runtime.
• Explain The Configuration Details Of Blaze Ds?
0. Add BlazeDS JAR files and dependent JAR files to the WEB-INF/lib directory from BlazeDS project.
1. Add BlazeDS configuration files in the WEB-INF/flex directory from BlazeDS project.
2. Define Message Broker Servlet and a session listener in WEB-INF/web.xml from BlazeDS project.
The Blaze DS uses four main configuration files namely:
Services-config.xml: The top level Blaze Ds configuration file, this file usually contains security constraints, channel definitions and logging settings that each of the services can use.
Remoting-config.xml: The remoting service configuration file, which defines remoting service destinations for working with remote objects.
Proxy-config.xml : The proxy service configuration file which defines proxy service destinations for working with webservices and HTTP Service (REST Services)
Messaging-config.xml: The messaging service configuration file, which defines messaging service destinations for performing publish subscribe messaging.
• Explain About Blaze Ds And Blaze Ds Services?
BlazeDS provides a set of services that lets you connect a client-side application to server-side data, and pass data among multiple clients connected to the server. BlazeDS implements real-time messaging between clients.
Blaze DS services:
0. HTTP Service
1. Webservice
2. Remote Object
HTTP Service: HTTP Service components to interact with JSP’s, Servlets and ASP Pages that are not available as Webservice or remoting services destinations.
<mx:HTTPService id=”myService” url=”http://localhost:8400/middlejava/LoginServlet” result=”resultHandler(event)” fault=faultHandler(event)” method=”Get”/>
Webservice: Webservice components let you access webservices, which are software modules with methods. Webservices methods are commonly referred to as operations. Webservice interfaces are defined by using XML. Flex application can interact with webservices that define their interfaces in a Webservices Description Language (WSDL) document, which is available as a URL. WSDL is a standard format for describing the messages that a webservice understands the format of these responses to those messages.
<mx: WebService id=”Webservice” wsdl=”http://search.yahoo.com/searchservice?wsdl” result=”resultHandler (event)” fault=faultHandler (event)” method=”Get”/>
Remote Object: Remote object components let us access the methods of server side java objects, without manually configuring the objects as webservices. We can use remote object components in MXML or ActionScript. We can use RemoteObject components with a standard alone BLAZE DS web application or macromedia ColdFusion MX from Adobe.
• Difference Between Cairngorm Event And Flex Event?
o Cairngorm Event is not a bubbled event and it can be understand by only flex commands.
o Flex events can be dispatched by every component in Flex.
• How To Add Two Commands To One Single Event Type?
Sequence Command is used to add multiple commands to one event type.
• Should Model Locator As A Singleton Class? Can't We Instantiate This Class As Like Normal Class?
You can call as a normal class because constructor is public.
• What Is Singleton Class? Explain The Steps To Create A Singleton Class?
The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. If we create the class as a singleton then no way to create more than one instance. But, we can get that single instance in any number of classes. So all the classes will share the same properties and behaviours of that singleton object.
Steps to create a Singleton class:
Consider the MySingleTon class as a singleton class.
package {
public class MySingleTon {
// Single Instance of Our MySingleTon
private static var instance:MySingleTon;
//DEFINE YOUR VARIABLES HERE
public function MySingleTon (enforcer:SingletonEnforcer)
{
if (enforcer == null)
{
throw new Error( "You Can Only Have One MySingleTon");
}
}
// Returns the Single Instance
public static function getInstance() : MySingleTon
{
if (instance == null)
{
instance = new MySingleTon ( new SingletonEnforcer );
}
return instance;
}
}
}
// Utility Class to Deny Access to Constructor
class SingletonEnforcer {}
0. We should create one static variable. It will be called "instance" and it will be of type MySingleTon. This will be the variable where we will store our one instance of our class.
1. Then we should create one constructor. The constructor takes one argument - "enforcer". You will notice that this "enforcer" has a type of "SingletonEnforcer" which is defined directly after our class. Here is the logic behind that:
When you put a class in an ActionScript file below the main class, it is only available to that class.
If the constructor requires this argument – then only our main class can create an instance of itself, because we do not have access to the “SingletonEnforcer” class. Only the main class has this access.
We will not access our class in the normal way by using the “new” statement because we can’t call the constructor. Once we get inside of the constructor, we have a few lines that make sure things work as planned. The “if” statement ensures that we had a valid “enforcer” passed in. If there wasn’t it throws an Error stating that “You Can Have Only One MySingleTon”.
• Explain About Cairngorm Architecture?
Cairngorm is an implementation of several design patterns that form a lightweight architectural framework. Cairngorm follows the principle of separating the view and business logic which is known as the Model-View-Controller pattern (MVC).
The Pieces of Cairngorm:
Model Locator
View
Front Controller
Command
Delegate
Service
o Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except that its stored client side in the Flex interface instead of server side within a middle tier application server.
o View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, and generating custom Cairngorm Events based on user interaction (clicks, rollovers, drag n drop.)
o Front Controller: Receives Cairngorm Events and maps them to Cairngorm Commands.
o Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the Model Locator
o Delegate: Created by a Command, they instantiate remote procedure calls (HTTP, Web Services, etc) and hand the results back to that Command.
o Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.
• Tell Me Arguments Of Addeventlistener() Method?
addEventListener (type: string, listener: function, useCapture: Boolean=false, priority:int=0, useWeakReference:Boolean=false):void
o type: Type of Event(MouseClick, MouseOver)
o listener: It’s a function
o useCapture(dfault:false): If True: Enable only Capturing Phase
o Flase: Enable Targetting and Bubbling Phase.
o Priority(int=0): The priority level of the listener. The higher the number the higher the priority.
o useWeakReference(default =false): whether the reference to the listener is strong or weak. A strong reference (default) preventing your listener from being garbage-collected, a weak reference does not.
• What Is Clone() Method?
Clone method creates duplicate copy of the event class. This method is executed automatically when the event is redispatched in the event listeners.
• What Is Preventdefault () Method?
To cancel the default behaviour of the event. The methods of the Event class can be used in event listener functions to affect the behaviour of the event object. Some events have an associated default behaviour. For example, the doubleClick event has an associated default behaviour that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behaviour by calling the preventDefault () method.
PreventDefault () method will work only if Cancellable property is true, otherwise it’s not working.
• What Is The Difference Between Target And Current Target?
Target: The object that dispatched the event (doesn’t change). Target will not change.
Current Target: The object who is currently being checked for specific event listeners (changes). Current target is keep on change.
• How To Create Custom Events? Explain The Steps To Create A New Custom Event?
To dispatch a new event from your custom component, you must do the following:
0. (Optional) Create a subclassfrom the flash.events.Eventclass to create an event class that describes the event object.
1. (Optional) Use the [Event]metadata tag to make the event public so that the MXML compiler recognizes it.
2. Dispatch the event using the dispatchEvent() method.
• What Is Stoppropagation() And Stopimmediatepropagation()? (or) Difference Between Stoppropagation And Stopimmediatepropagation()? (or) How To Stop The Event Flow/ Event Phases?
o stopPropagation: Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (current target).
o stopImmediatePropagation: Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately and it affects event listeners in the current node.
• What Is Adapter In Blaze Ds?
Java Adapter is used to communicate with Java and JMS adapter is used to communicate with JMS. Java adapter class allows us to invoke methods on a Java object.
• Explain About Different Types Of Channels Available In Blaze Ds?
HTTP Channel, AMF Channel, RTMP Channel:
o AMF Channel: A simple channel endpoint that transport data over HTTP in the binary AMF format in an asynchronous call and response model.
o HTTP Channel: Provides the sample behaviour the AMF Channel/endpoint, but transport data in AMFX format, which is the text based representation of AMF.
o RTMP Channel: The RTMP Channel creates a single duplex socket connection to the server and gives the server the best notification of the player being shut down.
• Explain About Remote Object? What Is End Point In Remote Object?
Remote Object: Remote Service automatically serializes and deserializes the data between Flex client and your server side language. As a result, you can directly call methods on your Java/.Net/ColdFusion/PHP etc… objects. This service connects to an AMF (Action Message Format) Gateway. AMF protocol transfers data in a binary format, so the data can be moved across the network more quickly.
endpoint: This property is used to identify the Java web project from your flex client project.
Ex: http://localhost:8080/JavaTest/messagebroker/amf
o http: this is a protocol used to communicate with webserver from client. http means “Hyper Text Transfer Protocol”
o localhost: Host name of the machine where you have deployed your Java web project.
o 8080: Port number of the web server where you have deployed your Java project.
o JavaTest: Context root of the web application to identify the web project uniquely.
o Messagebroker/amf: this is the URL pattern of the servlet which we have defined in web.xml file.
o <<protocol>>://<<hostname>>:<<port no>>/<<context root>>/<<URL Pattern>>
• Explain About Resultevent And Faultevent In Remote Object? (or) Explain About Result Handler And Fault Handler Methods?
o result: This is the event listener for the event ResultEvent. This event is automatically dispatched by the Flash Player when it receives the successful results from the backend Java service.
o fault: This is the event listener for the event FaultEvent. This event is automatically dispatched by the Flash Player when it receives any error in calling the Java method.
• Difference Between Http Service And Remote Object? (or) Which One You Will Prefer?
Data Service(Remote Object):
o Remote Objects specifies named or unnamed sources.
o This service connects to an AMF(Action Message Format) Gateway
o AMF protocol transfers data in a binary format, so the data can be moved across the network more quickly.
o Remote Service automatically serializes and deserializes the data between Flex client and your server side language. As a result, you can directly call methods on your Java/.Net/ColdFusion/PHP etc… objects
HTTP Service/Web Service:
o These services use named or raw URLs
o These services connect to an HTTP Proxy Gateway.
HTTP Service use HTTP protocol/requests
Web Services use SOAP (Simple Object Access Protocol).
o These services transfer data in XML format. This is slow.
o Here the data transfer is in XML only.
• Explain About Component Life Cycle?
A set of methods the framework calls to instantiate, control and destroy components. OR The component instantiation life cycle describes the sequence of steps that occur when you create a component object from a component class. As part of the life cycle, Flex automatically calls component methods, dispatches events, and makes the component visible.
3 Main Phases:
o BIRTH:Construction, configuration, attachment, initialization
o LIFE : Invalidation, validation, interaction
o DEATH : Detachment, garbage collection
override protected function createChildren():void{
myLab=new Label();
myLab.text="my label";
myLab.setStyle('color',"green");
this.addChild(myLab);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
myLab.move(0,0);
myLab.setActualSize(100,100);
}
• Explain About Measure() Method? When This Measure() Method Is Called?
The measure() method sets the default component size, in pixels, and optionally sets the component's default minimum size.
This method is used for following reasons:
0. To set the components measuredWidth, measuredHeight, measuredMinWidth and measuredMinHeight.
1. To set the default width and height values to this component.
2. To measure the child components widths and Heights. So that we can specify how much width and height is required for our component.
3. Measure method is called only when you are not specifying both width and height externally at the time of calling this component.
4. This method can be called multiple times by calling the invalidateSize() method.
• Difference Between Item Renderer And Item Editors?
Both are used for editing,but item renderer is used for displaying visual elements..
o item editor is used for editing purpose. Item editor can pass data back from the particular control to save it as a new value for item being edited. We can also use item renderer as editor by using boolean property renderIsEditor.
o itemrenderer is used to format and display the contents in a components whereas itemeditor allows us to edit the displayed content
• How To Display The Check Box In Data Grid Header?
<mx:DataGridColumn headerText="ADD" dataField="add" itemRenderer="mx.controls.Button"/>
<itemrendere>
</itemRenderer>
• Can We Use Text Input/editable Component As Itemrenderer?
Yes.
• What Are All The Events Dispatched In Item Editor?
Item Edit Beginning, Item Edit Begin, Item Edit End
• What Are The Collections Classes Available In Flex?
Array Collection, XML List Collection, Grouping Collection.
• Difference Between Array And Array Collection?
o Array Collection is a wrapper class based on Array.
o Array Collection contains sorting, filtering features but Array not.
o Array Collection dispatches the Event when new item is added, updated or deleted.
o Array Collection automatically refreshes/updates the view whenever the change happens in Array Collection.
• What Type Of Skinning Is Available In Flex?
Graphical skinning, Programmatic Skinning and Stateful skinning:
Graphical Skins: Images that define the appearance of the skin. These images can JPEG, GIF, or PNG files, or they can be symbols embedded in SWF files. Typically you use drawing software such as Adobe Photoshop or Adobe Illustrator to create graphical skins.
Programmatic Skins: Action Script or MXML classes that define a skin. To change the appearance of controls that use programmatic skins, you edit an Action Script or MXML file. You can use a single class to define multiple skins.
Sateful Skins: A type of programmatic skin that uses view states, where each view state corresponds to a state of the component. The definition of the view state controls the look of the skin. Since you can have multiple view states in a component, you can use a single component to define multiple skins.
• What Is The Difference Between Graphical Skinning And Stateful Skinning?
Sateful Skins: A type of programmatic skin that uses view states, where each view state corresponds to a state of the component. The definition of the view state controls the look of the skin. Since you can have multiple view states in a component, you can use a single component to define multiple skins.
• What Is Css (cascading Style Sheet)?
Cascading Style Sheets (CSS) are used in Flex to apply styles to visual components on the application display list. CSS is a standard for encapsulating the code that makes up the design of an Application. Given the power and maturity of CSS, most experienced Web designers/developers strive to implement as much of the design and layout properties of a Web site/application in CSS as possible. The result is much greater control and flexibility over the look and feel of the site.
Some features of CSS:
o Global: styles applied to all the components.
o Type selector: Applied to particular type of components in entire project.
o Style Name selector: Applied to only one component by specifying the Style Name property.
• Difference Between Swc And Swf File?
o SWC file is a library file and SWF file is a runnable file. We will copy to Flex Projects libs folder.
o SWC is what you use when you're looking for a library to compile into your app. You have access to the classes and can import individual parts. SWF is more likely what you're looking for when embedding graphics.
• Difference Between Label And Text?
o Label: If you explicitly size a label control so that it is not large enough to accommodate it's text the text is truncated and terminated by an ellipsis(...)
o Text: Here the text is displayed in new lines.
• What Is Shared Object? (or) How To Store The Data In Local?
Shared objects function like browser cookies. The SharedObject class to store data on the user's local hard disk and call that data during the same session or in a later session. Applications can access only their own SharedObject data and only if they are running on the same domain. The data is not sent to the server and is not accessible by other Adobe® Flex® applications running on other domains, but can be made accessible by applications from the same domain.
Public var so : SharedObject = SharedObject.getLocal("mySO");
so.data.fName = "Wisdomjobs";
• What Is Over Loading? Is Method Over Loading Possible In Flex?
No. Method overloading is not supported in Action Script3.0.
• What Is Method Overriding?
Override a method of a base class in your ActionScript component. To override the method, you add a method with the same signature to your class, and prefix it with the override keyword
• What Is Composition?
Making use of the already created class functionality or behaviour by instantiating the class and calling the required methods.
• Difference Between String And String Buffer?
String is immutable and String Buffer is mutable. String class creates new instance for any method but String Buffer updates/modifies same instance.
• What Is Serialization?
o Object can be represented as sequence of bytes that includes the object's data as well as information.
o Transfer of data from client to the server like sending the Java objects from Java to Flex.
• What Are The Differences Between 4.6/4.5/4.0 And Flex 3.0?
4.5 and 4.6 are used for developing mobile based applications. 4.6 has few new components.
4.0:
o Spark components have been introduced. Component logic and appearance has been separated. Appearance of the components is specified in skins.
o FXG
o FTE (Flash Text Engine)
o States changed
o Effects changed
• Difference Between Flash And Flex?
Flash is used by the designers. Flex is used by the developers. Flash uses only Flash Player API but Flex uses both Flash Player API and Flex SDK library also. like datavisualization.swc, automation.swc, rpc.swc.
o In flash no coding only designing.
o In flex you can create big projects.
• Difference Between Sealed Class And Dynamic Class?
Sealed Class:
o A sealed class possesses only fixed set of properties and methods that were defined at compile time. Additional properties and methods cannot be added at runtime.
o This enables strict compile time checking.
o It also improves memory usage. Because it doesn’t require an internal hash table for each object instance.
o All classes in Action Script 3.0 are sealed classes by default.
Dynamic Class:
o A dynamic class defines an object that can be altered at run time by adding or changing the properties and methods.
o It doesn’t enable strict compile time checking.
o It consumes more memory because it requires an internal hash table for each object instance.
o You can create dynamic classes by using the dynamic attribute when you declare a new class.
• Difference Between Data Grid And Advanced Data Grid?
0. Advance Data Grid allows sort by multiple column when you click in the column header. DataGrid allows only single column sort.
1. Styling rows and columns: Use the style function property to specify a function to apply styles to rows and columns of the controls.
2. Display Hierarchical and Grouped Data: Use an expandable navigation tree in a column to control the visible rows of the control.
3. Creating Column Groups: Collect multiple columns under a single column heading.
4. Using Item Renderers: Span multiple columns with an item renderer and use multiple item renderers in the same column.
• Advantages Of Adobe Flex?
0. Complete browser portability: any browser that supports flash player and that includes almost every browser.
1. Strong backend connectivity: from its inception, flex has featured excellent support for popular backend technologies such as the java and dot Net.
2. Streaming: flex offers excellent support for streaming binary data. Heavy allocations that needs to transfer large amount of data to the end user.
3. Asynchronous: Asynchronous request/response model. Flex offers complete support for asynchronous processing of user requests.
4. SVGs (Scalable Vector Graphics): flex stands out from most other RIA-based technologies because it supports vector-based drawing and direct embedding of SVG mark-up files. SVG based images look equally good at any resolution a given browser supports.
5. Security and Rich User Interfaces: Robust security flex leverages the highly tested flash player security.
6. RUI, flex benefits from halo skins, gradient fills, vector graphics and other flash player features
• What Is Calllater () Method?
The callLater () method queues an operation to be performed for the next screen refresh, rather than in the current update. Without the callLater () method, you might try to access a property of a component that is not yet available.
Syn: callLater(method:Function, args:Array):void
Ex: We have a button click event that loads data from a XML file or a webservice. That loading of data would probably have another resultHandler which will wait for the loading to finish. And meanwhile your button click handler might be doing some other things …so in these situations we can use callLater.
• What Is The Use Of Arraycollection Filter Function?
filterFunction: Function [read-write] : A function that the view will use to eliminate items that do not match the function criteria.
A filter function is expected to function (item: Object): Boolean When the return value is true if the specified item should remain in the view. If a filter is unsupported, flex throws as error when accessing this property. We must call refresh () method after setting the filter function property for the view to update.
Latest Adobe Flex Interview Questions and Answers pdf
No comments:
Post a Comment