Download - Mate Presentation given to NY Flex User's Group

Transcript
Page 1: Mate Presentation given to NY Flex User's Group

Getting Friendly with MateAlex Petrescu

Sr. Presentation Layer Developer

Razorfish

Page 2: Mate Presentation given to NY Flex User's Group

Flex Frameworks

Cairngorm

PureMVC

Mate

Swiz

Cairngorm PureMVC Mate Swiz

Page 3: Mate Presentation given to NY Flex User's Group

Cairngorm

Very defined MVC Structure

Very mature

Complex

A lot of classes

Tight coupling between MVC

Page 4: Mate Presentation given to NY Flex User's Group

PureMVC

Very defined MVC Structure

Mature

Plays nice with Java

Doesn’t take advantage of Flex

Page 5: Mate Presentation given to NY Flex User's Group

Mate

Rapid Development

Lose coupling

Uses Native Flex Events

Inversion of Control (IoC) pattern

Easy to retrofit existing code

Page 6: Mate Presentation given to NY Flex User's Group

Swiz

Rapid Development

Lose coupling

Uses Native Flex Events

Inversion of Control (IoC) pattern

No imposed structure

Page 7: Mate Presentation given to NY Flex User's Group

Mate BasicsGet started quickly.

Page 8: Mate Presentation given to NY Flex User's Group

The View

Normal MXML view.

Public properties for data injection.

Public methods for callbacks / listener injection.

No references to manager / Mate necessary.

Re-use of existing views possible.

Use data binding / setters to make

Page 9: Mate Presentation given to NY Flex User's Group

View & Model

Page 10: Mate Presentation given to NY Flex User's Group

The Event / Bubbles

Normal Flex / AS3 event.

Bubbles = True

Event bubbles up to stage.

Can use GlobalDispatcher class to dispatch events from non-views.

Re-use of existing events possible.

Page 11: Mate Presentation given to NY Flex User's Group

The EventMap

The Core / Controller of the application.

<EventMap> tag

Event Handlers

Injectors

Page 12: Mate Presentation given to NY Flex User's Group

Controller / Event Map

Page 13: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - EventMap

<EventHandlers type=”{YourEvent.TYPE}”>

<Injectors type=”{TargetView}”>

Page 14: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - EventHandlers

<MethodInvoker

generator=”{YourObject}”

method=”functionName”

arguments=”[arg1,arg2]”>

<EventAnnouncer

generator=”{YourEvent}”

type=”{YourEvent.TYPE}”>

Page 15: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - EventHandlers

<RemoteObjectInvoker

destination=”YourDestination”

source=”path.to.this.service”

method=”functionName”

arguments=”[arg1,arg2]”>

Page 16: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - EventHandlers

<HttpServiceInvoker

url=”http://path.to/yourservice”>

<Request prop1=”{event.prop1}” prop2=”{event.prop2}”/>

</HttpServiceInvoker>

Page 17: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - EventHandlers

<Callback

method=”functionName”

targetId=”myID” (optional)

arguments=”[arg1,arg2]”>

Page 18: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - Injectors

<PropertyInjector

targetKey=”myProperty”

source=”{MyManager}”

sourceKey=”myPropertyOnManager”>

Page 19: Mate Presentation given to NY Flex User's Group

Mate Specific Tags - Injectors

<ListenerInjector

eventType=”{MyEvent.TYPE}”

method=”myMethod”>

Page 20: Mate Presentation given to NY Flex User's Group

Hello Mate!Quick demo.

Page 21: Mate Presentation given to NY Flex User's Group

Thank Youhttp://www.kilometer0.com/mate/ for presentation / code.