Sunday, April 12, 2009

Flex Certification Exam Questions

Hi,I put some questions for Flex Certification Exam ,refer and learn more .....

1.Which statement best describes the Model-View-Controller design pattern?
A. It does NOT promote code reuse
B. Alternative user interfaces are difficult to add
C. It combines the code responding to user input with the code rendering the interface
D. It promotes maintainability by providing separation of concerns within code

2.Which development task would most likely be part of building loosely coupled MXML
components?
A. invoking the dispatchEvent() method
B. assigning a reference to the owner property
C. extending the flash.events.Dispatcher class
D. implementing the IFlexDisplayObject interface

3.Which software design pattern reduces method call volume by encapsulating multiple data
attributes in a single object?
A. Factory
B. Singleton
C. Assembler
D. Transfer Object
E. Data Access Object

4.Which statement about the dispatchEvent() method is true?
9A0-310
2 http://www.certmagic.com
A. It automatically dispatches an event object.
B. It can only be used with the Application class.
C. It can be used for both custom and other events.
D. It returns the type property value of the event object.
QUESTION: 5
Click the Exhibit button. Which ActionScript class definition represents the UML class diagram?
A. class Employee {
private var empName:String;
public function CalcSalary():int {
...
}
B. class Employee {
public var empName:String;
private function CalcSalary():int {
...
}
C. class Employee {
private var empName:String;
protected function CalcSalary():int {
...
}
D. class Employee {
public var empName:String;
protected function CalcSalary():int {
...
}
6.Which statement best defines event bubbling?
A. Event bubbling is NOT supported in ActionScript 3.0
B. The event flows from the top of the display list hierarchy to the node just before the target
node
C. The event flows from the node subsequent to the target node back up the display list heirarchy
D. The event flows from the top of the display list heirarchy to the target node
QUESTION: 7
Given the following code snippet: Which value would be traced to the console?
A. FRED
B. Fred
C. Fred Friendly
D. An error or strict-mode warning would occur

8.Which design pattern is followed by an ActionScript class that uses the [RemoteClass] metatag?
A. Singleton
B. Assembler
C. Data Access Object
D. Data Transfer Object

9.Which Flex 2 language feature provides the best support for loose coupling between MXML
components?
A. class inheritance
B. singleton classes
C. event dispatching
D. remote object services

10.A Flex application contains a custom event object eventObj:
var eventObj:Event = new Event(myCustomEvent);
Which line of code correctly triggers this event?
A. eventObj.dispatch();
B. dispatchEvent(eventObj);
C. eventObj.dispatchEvent();
D. dispatchEvent(eventObj);
QUESTION: 11
Click the Exhibit button. What is the relationship between the two classes in the UML diagram?
A. Shape extends Circle
B. Circle extends Shape
C. Shape implements Circle
D. Circle implements Shape

12.You want to send custom data with an event object that has been generated by the framework.
What should you do?
A. Add custom properties to the target property.
B. Subclass the Event class and add properties to it.
C. Subclass the DisplayObject class and add properties to it.
D. Add custom properties to the Flash.events.Event class.

13.Which is contained in a .jar file?
A. XML data files in an archived format
B. the Java Virtual Machine used in a J2EE server
C. a set of pre-compiled Java classes in an archived format
D. all configuration and application files in a J2EE web application in an archived format

14.Which attribute prevents a class method from being visible within a sub-class?
A. public
B. internal
C. private
D. protected

15.You have used a WebService object to call a public method of a SOAP-based web service. The
remote web service is written in Java. The signature of the Java method being called is:
public List getData()
You have declared an ActionScript method named resultHandler() with this signature:
private function resultHandler(event:ResultEvent):void
When the resultHandler() method is called from the HTTPService object result event, you want to
save the returned data to a previously declared ArrayCollection named myCollection. Which is the
correct syntax?
A. myCollection = event.result;
B. myCollection = event.result as ArrayCollection;
C. myCollection = new ArrayCollection(event.result as Array);
D. myCollection = event.getData.lastResult as ArrayCollection;

16.Which Data Management Service method will reset an item to its previous state?
A. undo()
B. rollBack()
C. noCommit()
D. revertChanges()

17. You have used an HTTPService object to retrieve this HTML file:

JoePresident

MaryCEO

The resultFormat property of the HTTPService object is set to object, and the id property is set to
myService. You want to use a DataGrid control to display the list of employees. Which is the
correct syntax for a binding expression to pass the employee objects to the dataProvider property
of the DataGrid?
A. dataProvider={myService.lastResult}
B. dataProvider={myService.lastResult.employees}
C. dataProvider={myService.result.employees.employee}
D. dataProvider={myService.lastResult.employees.employee}

18.Which object is the returned XML data placed into after a Web service operation executes?
A. result
B. collection
C. firstResult
D. lastResult

19.Which property of the HTTPService class references the data returned from a request?
A. result
B. lastResult
C. destination
D. resultFormat

20.Which protocol supports the use of server-pushed messaging with the Flex Message Service and
the Data Management Service?
A. AMF
B. HTTP
C. SOAP
D. RTMP

21. A Flex application contains a custom event object eventObj:
var eventObj:Event = new Event(myCustomEvent);
Which line of code correctly triggers this event?
A. eventObj.dispatch();
B. dispatchEvent(eventObj);
C. eventObj.dispatchEvent();
D. dispatchEvent(eventObj());

22.Which component renders data from an array or array collection?
A. TextInput
B. DataGrid
C. ProgressBar
D. NumericStepper

23.You have written the following code snippet: You want to switch to the new state when the user rolls over the Panel. Which code should you add to the Panel tag?
A. currentState=roll
B. rollOver=expanded
C. Over; expanded
D. rollOver=currentState=expanded

24 You want to layout two Panel containers as shown in the exhibit. Which two MXML code blocks could surround the two Panel containers to create the following display? (Choose two)
A.
B.
C.
D.
E.

25.You are working with a constraint-based layout. You want to ensure that a Panel container is always positioned in your application as it appears in the exhibit. Which two properties should you set? (Choose two.)
A. left
B. top
C. right
D. bottom
E. verticalCenter
F. horizontalCenter

26.You want to move the panel1 and panel2 elements in a transition. Which statement should you use?
A.
B.
C.
D.

27 You are using the labelFunction property of the DataGridColumn class to call a function that returns a date-formatted string. You want to be able to call the function from more than one DataGridColumn instance. The signature of the function is: private function formatDate(data:Object, column:DataGridColumn):String { } You have declared an instance of the DateFormatter class named myFormatter. You want to return a date-formatted string from a dynamically selected property of the data object. Which syntax should you use?

A. return myFormatter.format(data.column);
B. return myFormatter.format(data.dataField);
C. return myFormatter.format(data.column.dataField);
D. return myFormatter.format(data[column.dataField]);

28.What is the default value for the creationPolicy property of the ViewStack container?
A. all
B. auto
C. none
D. queued

29.Which statement about application backgrounds is true?

A. A JPG referenced in the backgroundImage style of the Application tag will not scale to fit the entire application area.
B. Setting the backgroundAlpha style of the Application tag to zero will ensure that a background color is never set.
C. An animated Flash movie CANNOT be used as a background image for an application.
D. If you set the backgroundColor style of the Application tag equal to red, you will get a red gradient background.

30. Which class are all Flex UI controls a subclass?
A. Shape
B. MovieClip
C. UIComponent
D. ProgrammaticSkin

31 Which statement describes the behavior of the Text control that makes it different in behavior and capability from the Label control.
A. The Text control supports the htmlText property.
B. The Text control wraps long text to multiple lines.
C. The Text control supports the selectable property.
D. The Text control does NOT support the backgroundColor style.

32 Which two file formats are supported by the Image control? (Choose two.)
A. TIF
B. JPG
C. BMP
D. PSD
E. PNG

33 Which is the immediate child element of a Navigator container?
A. A container
B. A DataGrid
C. A view state
D. An embedded asset

34 Which method of changing the appearance of a Flex application requires the use of 3rd-party tools like Adobe Photoshop or Adobe Flash 8?
A. styles API
B. graphical skinning
C. programmatic skinning
D. cascading style sheets

35 Which two navigator containers can only let users control the active child of a ViewStack Container (choose two)?
A. HBox
B. NavBar
C. TabBar
D. LinkBar
E. Accordion

36 What is the most efficient way to validate that alpha-numeric data is in the correct format?
A. Use the StringValidator class.
B. Use the NumberValidator class.
C. Use the RegExpValidator class.
D. Create a custom validator to loop over and validate each character.

37 Which statement declares the Person class as a member of the com.adobe.people package?
A. package com.adobe.people; public class Person() { }
B. package com.adobe.people [ public class Person() { } ]
C. package com.adobe.people { public class Person() { } }
D. public class com.adobe.people.Person() { }

38 Which two statements about interfaces are true? (Choose two.)
A. Interfaces can be instantiated.
B. Interfaces can NOT extend other interfaces.
C. Interfaces can have variables and constants.
D. Interfaces must define all method implementations.
E. A class is the only ActionScript 3.0 language element that can implement an interface

39 Which statement about creating ActionScript class methods is FALSE?
A. Methods are created in the body of the class.
B. To create a method that is only used internally by the class, use the keyword private.
C. To make method arguments optional, assign default values to each one.
D. If a method has an empty arguments list, declare the argument list void in parenthesis.

40 Which statement about event handlers is true?
A. Event handlers only respond to user events.
B. Event handlers only respond to system events.
C. Custom event handlers are NOT allowed in Flex.
D. Event handlers respond to system events and user events.

41 You want to create a new custom validator class. Which protected method of the superclass is overridden?
A. validate()
B. doValidation()
C. createChildren()
D. updateDisplayList()

42 You want to call the findFirst(), findLast(), or findAny() methods of the Cursor class. Which statement must be true?
A. the ArrayCollection must be sorted
B. the ArrayCollection must be marked as [Managed]
C. the ArrayCollection must be marked as [Bindable]
D. the ArrayCollection must contain strongly typed objects

43 What are two reasons for using the event based programming model in Adobe Flex? (Choose two.)
A. To identify the system resources of a user.
B. To identify the IP address of an application user.
C. To stream data synchronously into Flash Player
D. To identify when a user has interacted with the interface.
E. To identify when a component has been created, destroyed or resized.

44 You want to use data binding with a custom property of a custom component. What must you do?
A. Use an ArrayCollection.
B. Specify the [Bindable] metatag before the property.
C. Set the source and destination using the tag
D. You should NEVER bind to custom properties of a component because this results in tight coupling.

45 Which statement declares a valid constructor for the Person class?
A. public function Person() { }
B. public static Person():void { }
C. public function Person():Void { }
D. public const function Person() { }


46 You are using ActionScript 3.0. You want a property to be visible only in the class that defines it. You do NOT want this property to be inherited by any subclasses. Which access modifer should you use?
A. public
B. private
C. internal
D. protected

47 You want to track information about an object that is manipulated by the Data Management Service. Which class should you use?
A. LoadEvent
B. DataStore
C. AsyncToken
D. AsyncMessage

48 Which term describes an endpoint for a message (data) where the message will be acted upon?
A. proxy
B. adapter
C. channel
D. destination

49 Which is NOT a client-side RPC component?
A. AMF
B. WebService
C. HTTPService
D. RemoteObject

50 Which two statements about the result event in the HTTPService class are true? (Choose two.)
A. The event object generated contains a result property
B. The event object generated contains a lastResult property
C. The event is fired whether data is returned successfully or not.
D. The target property of the event object refers to the data returned.
E. The data type of the event object created is mx.rpc.events.ResultEvent

51 Which term describes the path on which messages travel?
A. proxy
B. adapter
C. channel
D. destination
52. Which two UI containers support absolute layout positioning? (Choose two.)A.TileB.GridC.VBoxD.CanvasE.Application53. Which kind of data should be passed to the targets property of an effect?A.ArrayB.ObjectC.ControlD.Container
54 On which object or component can the addEventListener() method can be used?A. Only on custom components.B. Any object that displays in the Flash player.C.Only on an event object if the bubbles property is set to true.D.Only if the custom component has been created in ActionScript55. Which statement describes the visibility of a protected property?A.it is visible to references everywhereB.it is visible to references in the parent classC.it is visible to references inside the same packageD.it is visible to references in the same class and its derived classes56. Which line of code represents a valid constructor for the class Vehicle?A.public function init(){ }B.public function Vehicle(){ }C.private function Vehicle(){ }D.public function VehicleConstructor(){ }57. Which two statements about using custom components are true? (Choose two.)A.Custom components do NOT need to be in a separate file.B.Custom components can be written in either MXML or ActionScript.C.Custom components do NOT need to define the mx namespace if it has been defined in the main application.D.There must be a file with an tag that loads the individual components.E.Custom components do NOT require that namespaces be redefined if they are already defined in the main application.
58. Which RPC service has a load event that is dispatched once the service object is loaded?A.WebServiceB.HTTPServiceC.RemoteObjectD.ObjectAccess59. Identify how to change the look and feel of a design by using API styles and
style sheets.
Your application includes the following declaration:
.myFontStyle { fontSize: 15 }
You want to assign a visual control to be a member of the myFontStyle class.
Which syntax should you use?
A. class=”myFontStyle”
B. class=”.myFontStyle”
C. styleName=”myFontStyle”
D. styleName=”.myFontStyle”

60. Identify how to change the look and feel of a design by using API styles and
style sheets.
Which statement about Cascading Style Sheet properties in Flex is true?
A. Spaces are allowed in property names
B. All CSS properties are available in Flex
C. Components CANNOT by styled using CSS
D. Class selectors can be applied to a component using the styleName
Property

61. Recognize how to customize changes, control-related presentation layouts
and navigation in an application by using view states, and using transitions
and eff ects.
Which kind of data should be passed to the targets property of an effect?
A. Array
B. Object
C. Control
D. Container

62. Identify how to build loosely-coupled components.
Which statement about loosely-coupled components is true?
A. They decrease reusability
B. An event model CANNOT be used
C. Data can be sent by binding variables to component attributes
D. They have direct knowledge of the properties and methods of other
Components

63. Recognize how Inheritance, Encapsulation, and Polymorphism works
You have a custom ActionScript class named MyClass that implements an
interface named MyInterface. You want to create an instance of the class, and be
able to pass it to a method that accepts any class that implements the interface.
Which syntax should you use?
A. var obj:MyClass = new MyInterface();
B. var obj:MyInterface = new MyClass();
C. var obj:MyClass = new MyClass() as MyInterface;
D. var obj:MyInterface = new MyInterface(new MyClass());

64. Recognize how to create and use ActionScript classes.
You have created a custom ActionScript class called MyClass. You want to be
able to pass in an optional argument that is typed as an Object.
Which is the correct signature of the constructor method?
A. public function MyClass(item:Object)
B. public function MyClass(item:Object = null)
C. public function MyClass(item:Object):MyClass
D. public function MyClass(item:Object) as MyClass

65. Recognize how to display data using diff erent chart types, formats, and
legends.
Which type of variable should be passed to the series property of a charting
component?
A. Data Transfer Object
B. A single Series object
C. Array of Series objects
D. ArrayCollection of Data Transfer Objects

66. Recognize how to use Remote Procedure Call (RPC) services.
You are accessing multiple remote methods from a WebService object. You need
to defi ne different result events for each method call.
Which tag nested inside the WebService tag block should you use?
A.
B.
C.
D.

67. Recognize how to manage data using Flex Data Services (FDS)
Your application uses the Data Management Service to manage distributed data.
You have returned an instance of the AsyncToken class upon calling the
DataService commit() method, using this syntax:
token = myService.commit();token.action=”saved”;
You have defi ned a result handler method that is called upon the result event of
the DataService. The method signature is:
resultHandler(event:ResultEvent):void
Which expression within the handler method will return the value of the token
object action property?
A. event.action
B. event.token.action
C. event.token.result.action
D. event.result.token.action

Friday, April 3, 2009

Welcome

Flex Application Design for Cairngorm

This will walk a developer through the process of designing a simple
Cairngorm based Flex application that addresses a real world business need. The
intended audience is a developer who is at least somewhat familiar with Flex, has
built a few Flex applications, is at least somewhat familiar with the Cairngorm micro
architecture, and wishes to learn more about how to plan a Cairngorm application
properly, right from the start of their development effort.

What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your
application code by logical functions; by data, by user views, and by the code that
controls everything. This is routinely referred to as MVC, or Model, View, and
Control.

The Pieces of Cairngorm
· 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.
· 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, dragndrop.)
· Front Controller: Receives Cairngorm Events and maps them to Cairngorm
Commands.
· Command: Handles business logic, calls Cairngorm Delegates and/or other
Commands, and updates the Value Objects and variables stored in the Model
Locator
· Delegate: Created by a Command, they instantiate remote procedure calls
(HTTP, Web Services, etc) and hand the results back to that Command.
· Service: Defines the remote procedure calls (HTTP, Web Services, etc) to
connect to remote data stores.