SlideShare a Scribd company logo
1 of 41
Scaling the Cairngorms One Way Up the Mountain Test-Driven Flex and ArcGIS Server Development Utilizing Cairngorm 3
Your Sherpa Glenn Goodrich Enspiria Solutions ggoodrich@enspiria.com @ruprictGeek
Pragmatica Destination: Summit of Pragmatica Build good practices like TDD, IoC, DI and make a MOCKery of unmaintainable development.
What’s on our backs? Flex API Cairngorm 3 FlexUnit 4 Parsley ASMock Hamcrest
Who are you? Previous Climbing Experience   Flex Developer   Understand TDD, IoC/DI   Understand Mocking Bonus   Cairngorm experience   Other MVC experience
Base Camp: Cairngorm Micro-Architecture   Command Pattern IoC to Inject Models & Services Guidelines Tools Libraries We are here NOTHING like Cairngorm 2. (Really, like, they are TOTALLY different)
Base Camp: Cairngorm Guidelines Application Layers  Presentation   Application  Domain  Infrastructure Presume IoC, but don’t specify Loose Coupling NOTHING like Cairngorm 2. (Really, like, they are TOTALLY different)
Base Camp: Cairngorm Guidelines Presentation  View and View Models   MXML has minimal script   MXML binds to Model   MXML throws inline events   View Model throws business events Application   Events & Commands   Integrate to the world  Changes Model Domain  Business Objects  Business Logic (Client-side) Infrastructure   Services, Remote & Local (cache)
Base Camp: Cairngorm Guidelines Cairngorm Messaging event event Infrastructure View => PM Command invokes returns updates binds to Model
Base Camp: Cairngorm Tools Leverage Existing Libraries  FlexUnit4 ASMock FlexPMD  IDE Plugins Pretty sparse, right now. IDE Integration could be the only place Cairngorm 3 is like Caringorm 2
Base Camp: Cairngorm Libraries Integration Observer Validation Navigation Module Task  PopUp Think Patterns & Practices    Provide framework    Handle common needs
Base Camp: Cairngorm Libraries public class SelectStadiumsCommand {   [Inject]   public varservice:IStadiumService;   [Inject]   public varselectedStadiums:Stadiums;   [Command(selector="selectStadiums")]   public function execute(event:SelectStadiumsEvent):AsyncToken{ return service.getStadiumsForGeometry(event.geometry);   }   [CommandResult(selector="selectStadiums")]   public function handleStadiums(result:*,event:SelectStadiumsEvent):void{     //Transform result     Integration  Command Pattern  Global Error Handling  Progress Information
Base Camp: Cairngorm Libraries Observer Data binding    Don’t use this   (unless you have to) <observer:Observe source="{model.selectedExtent.xmin}“ handler="updateExtent"/>
Base Camp: Cairngorm Libraries Validation Data Input   Domain Validation <validators:ValidatorGroup id="validatorGroup">     <validators:validators>         <mx:StringValidator id="firstnameValidator"             source="{ firstnameInput }"             required="true" minLength="3"             property="text" triggerEvent="change"/>         <mx:StringValidator id="lastnameValidator"             source="{ lastnameInput }"             required="true" minLength="2"             property="text" triggerEvent="change"/>     </validators:validators> </validators:ValidatorGroup>
Base Camp: Cairngorm Libraries Navigation Waypoints and Landmarks   Navigation Interceptors   Navigation State <mx:ViewStackxmlns:mx="http://www.adobe.com/2006/mxml" >	    <mx:Metadata>         [Waypoint]    </mx:Metadata>     <dashboard:BoardViewautomationName="{ ContentDestination.DASHBOARD }“/>     <news:NewsView automationName="{ ContentDestination.NEWS }"/>     <messages:MessagesViewautomationName="{ ContentDestination.MESSAGES }"/> </mx:ViewStack> ……………………………………………………………………………………….. [Landmark(name=“news")] public class ContentPM implements ISelectedIndex {     [Bindable]     public varselectedIndex:int; ……………………………………………………………………………………….. private function navigateTo(destination:String):void {          	dispatcher(NavigationEvent.newNavigateToEvent(destination));  }
Base Camp: Cairngorm Libraries PopUp PopUp Management    Abstract PopUpManager <popup:PopUpWrapper id="popup1" open="{model.popUpHandler.showStadium}"  >        <mx:TitleWindow  width="450" height="400" 	title="{model.selectedStadium.team}" layout="absolute" >   	<esri:Map  id="stadiumMap"  verticalCenter="0" horizontalCenter="0" mapClick="trace(model.selectedExtent);trace(stadiumMap.extent)" 	width="400“ height="300"> 	</esri:Map>  	<mx:Button  bottom="10" left="10"             		label="Close"             		click=“dispatchEvent( new Event( Event.CLOSE ) )"/>       </mx:TitleWindow>        <popup:behaviors>         <mx:Array>             <popup:AddPopUpToParsleyContext context="{ context }"/>         </mx:Array>     </popup:behaviors>     </popup:PopUpWrapper>
Base Camp: Cairngorm Libraries Module  Modular Applications* Task   Sequence Commands  Parallel Commands *Duh
Base Camp: Parsley & SpiceLib Parsley  Dependency Injection  Messaging  Task Framework SpiceLib Submodule of Parsely  Reflection  Task Framework
Pragmatica Need The Cairngorms are the last place on earth where the NFL hasn’t played a football game.  The leaders of Pragmatica want to lure the NFL to Scotland and need a way  to select the different stadiums and learn about these “football” teams.* User Story  As a Pragmatica Leader, I want to select specific NFL Stadiums so I can see what makes a good stadium. * *worst contrived presentation demo story ever
The Foot of the Summit Data  Base Map  NFL Stadiums (via GeoCommons) Special Instructions  Compiler setting for ASMock/FlexUnit4 runner  Create “test” folder for our unit tests
The Foot of the Summit Source Structure   Broken into Functional Areas   Separate test folder
First Belay: Write a Test FlexUnit4 Setup  Test Suite (Scaling Tests)	 TestRunner Application User Story  As a Pragmatica Leader, I want to select specific NFL Stadiums so I can see what makes a good stadium.  Map Test  User draws a polygon   Map fires event (SelectStadiumsEvent)
First Belay: Under Test Cairngorm Messaging event View => PM
First Belay: Under Test
Second Belay: Write a Test Command Test  Should call a service   Should update model with results Application Layer   Shields view from Infrastructure   Changes Model Drives the Model  Stadium   Stadiums
Second Belay: Under Test Cairngorm Messaging Infrastructure Command invokes returns updates Model
Second Belay: Under Test
Third Belay: Hook Up the View Guidelines    Only knows about PM     Use Flex data binding
Third Belay: Hook Up the View
Fourth Belay: Configure IoC Views addedToStage PMs ManagedEvents Parsley IoC    Create a Context    Add Presentation Models    Add Business Objects    Add Commands    Add Services
Fourth Belay: Configure IoC
Fourth Belay: Configure IoC
Race to the Summit Pragmatica Rinse, Lather, Repeat    Write Tests    Write Code to Satisfy Tests    Hook up Views    Configure IoC Some Other Examples   Stadium Map   Show PopUp
Back at Base Camp Presentation on SlideShare http://slideshare.net/ruprict/scaling-caringorms Source Code on GitHub http://github.com/ruprict/scaling-cairngorm-ags Links to all libraries Contact Me ggoodrich@enspiria.com @ruprictGeek
Questions Thanks for coming! Post Climb Refreshments

More Related Content

Similar to Scaling Cairngorms

Windows Azure - Cloud Service Development Best Practices
Windows Azure - Cloud Service Development Best PracticesWindows Azure - Cloud Service Development Best Practices
Windows Azure - Cloud Service Development Best PracticesSriram Krishnan
 
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngineGoogle Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngineRoman Kirillov
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
 
Naive application development
Naive application developmentNaive application development
Naive application developmentShaka Huang
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Servicesmattjive
 
First Failure Data Capture for your enterprise application with WebSphere App...
First Failure Data Capture for your enterprise application with WebSphere App...First Failure Data Capture for your enterprise application with WebSphere App...
First Failure Data Capture for your enterprise application with WebSphere App...Rohit Kelapure
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Rapid JCR Applications Development with Sling
Rapid JCR Applications Development with SlingRapid JCR Applications Development with Sling
Rapid JCR Applications Development with SlingFelix Meschberger
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleGeoffrey De Smet
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersKris Verlaenen
 
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at Runtime
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at RuntimeOSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at Runtime
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at RuntimeNETWAYS
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...zznate
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Chester Chen
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesLeonardo Fernandes
 

Similar to Scaling Cairngorms (20)

FLAR Workflow
FLAR WorkflowFLAR Workflow
FLAR Workflow
 
Windows Azure - Cloud Service Development Best Practices
Windows Azure - Cloud Service Development Best PracticesWindows Azure - Cloud Service Development Best Practices
Windows Azure - Cloud Service Development Best Practices
 
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngineGoogle Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
 
02 create first-map
02 create first-map02 create first-map
02 create first-map
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Struts2
Struts2Struts2
Struts2
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Naive application development
Naive application developmentNaive application development
Naive application development
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
First Failure Data Capture for your enterprise application with WebSphere App...
First Failure Data Capture for your enterprise application with WebSphere App...First Failure Data Capture for your enterprise application with WebSphere App...
First Failure Data Capture for your enterprise application with WebSphere App...
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Rapid JCR Applications Development with Sling
Rapid JCR Applications Development with SlingRapid JCR Applications Development with Sling
Rapid JCR Applications Development with Sling
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developers
 
my accadanic project ppt
my accadanic project pptmy accadanic project ppt
my accadanic project ppt
 
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at Runtime
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at RuntimeOSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at Runtime
OSMC 2021 | inspectIT Ocelot: Dynamic OpenTelemetry Instrumentation at Runtime
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico Ces
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Scaling Cairngorms

  • 1. Scaling the Cairngorms One Way Up the Mountain Test-Driven Flex and ArcGIS Server Development Utilizing Cairngorm 3
  • 2. Your Sherpa Glenn Goodrich Enspiria Solutions ggoodrich@enspiria.com @ruprictGeek
  • 3. Pragmatica Destination: Summit of Pragmatica Build good practices like TDD, IoC, DI and make a MOCKery of unmaintainable development.
  • 4. What’s on our backs? Flex API Cairngorm 3 FlexUnit 4 Parsley ASMock Hamcrest
  • 5. Who are you? Previous Climbing Experience Flex Developer Understand TDD, IoC/DI Understand Mocking Bonus Cairngorm experience Other MVC experience
  • 6. Base Camp: Cairngorm Micro-Architecture Command Pattern IoC to Inject Models & Services Guidelines Tools Libraries We are here NOTHING like Cairngorm 2. (Really, like, they are TOTALLY different)
  • 7. Base Camp: Cairngorm Guidelines Application Layers Presentation Application Domain Infrastructure Presume IoC, but don’t specify Loose Coupling NOTHING like Cairngorm 2. (Really, like, they are TOTALLY different)
  • 8. Base Camp: Cairngorm Guidelines Presentation View and View Models MXML has minimal script MXML binds to Model MXML throws inline events View Model throws business events Application Events & Commands Integrate to the world Changes Model Domain Business Objects Business Logic (Client-side) Infrastructure Services, Remote & Local (cache)
  • 9. Base Camp: Cairngorm Guidelines Cairngorm Messaging event event Infrastructure View => PM Command invokes returns updates binds to Model
  • 10. Base Camp: Cairngorm Tools Leverage Existing Libraries FlexUnit4 ASMock FlexPMD IDE Plugins Pretty sparse, right now. IDE Integration could be the only place Cairngorm 3 is like Caringorm 2
  • 11. Base Camp: Cairngorm Libraries Integration Observer Validation Navigation Module Task PopUp Think Patterns & Practices Provide framework Handle common needs
  • 12. Base Camp: Cairngorm Libraries public class SelectStadiumsCommand { [Inject] public varservice:IStadiumService; [Inject] public varselectedStadiums:Stadiums; [Command(selector="selectStadiums")] public function execute(event:SelectStadiumsEvent):AsyncToken{ return service.getStadiumsForGeometry(event.geometry); } [CommandResult(selector="selectStadiums")] public function handleStadiums(result:*,event:SelectStadiumsEvent):void{ //Transform result Integration Command Pattern Global Error Handling Progress Information
  • 13. Base Camp: Cairngorm Libraries Observer Data binding Don’t use this (unless you have to) <observer:Observe source="{model.selectedExtent.xmin}“ handler="updateExtent"/>
  • 14. Base Camp: Cairngorm Libraries Validation Data Input Domain Validation <validators:ValidatorGroup id="validatorGroup"> <validators:validators> <mx:StringValidator id="firstnameValidator" source="{ firstnameInput }" required="true" minLength="3" property="text" triggerEvent="change"/> <mx:StringValidator id="lastnameValidator" source="{ lastnameInput }" required="true" minLength="2" property="text" triggerEvent="change"/> </validators:validators> </validators:ValidatorGroup>
  • 15. Base Camp: Cairngorm Libraries Navigation Waypoints and Landmarks Navigation Interceptors Navigation State <mx:ViewStackxmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Metadata> [Waypoint] </mx:Metadata> <dashboard:BoardViewautomationName="{ ContentDestination.DASHBOARD }“/> <news:NewsView automationName="{ ContentDestination.NEWS }"/> <messages:MessagesViewautomationName="{ ContentDestination.MESSAGES }"/> </mx:ViewStack> ……………………………………………………………………………………….. [Landmark(name=“news")] public class ContentPM implements ISelectedIndex { [Bindable] public varselectedIndex:int; ……………………………………………………………………………………….. private function navigateTo(destination:String):void { dispatcher(NavigationEvent.newNavigateToEvent(destination)); }
  • 16. Base Camp: Cairngorm Libraries PopUp PopUp Management Abstract PopUpManager <popup:PopUpWrapper id="popup1" open="{model.popUpHandler.showStadium}" > <mx:TitleWindow width="450" height="400" title="{model.selectedStadium.team}" layout="absolute" > <esri:Map id="stadiumMap" verticalCenter="0" horizontalCenter="0" mapClick="trace(model.selectedExtent);trace(stadiumMap.extent)" width="400“ height="300"> </esri:Map> <mx:Button bottom="10" left="10" label="Close" click=“dispatchEvent( new Event( Event.CLOSE ) )"/> </mx:TitleWindow> <popup:behaviors> <mx:Array> <popup:AddPopUpToParsleyContext context="{ context }"/> </mx:Array> </popup:behaviors> </popup:PopUpWrapper>
  • 17. Base Camp: Cairngorm Libraries Module Modular Applications* Task Sequence Commands Parallel Commands *Duh
  • 18. Base Camp: Parsley & SpiceLib Parsley Dependency Injection Messaging Task Framework SpiceLib Submodule of Parsely Reflection Task Framework
  • 19. Pragmatica Need The Cairngorms are the last place on earth where the NFL hasn’t played a football game. The leaders of Pragmatica want to lure the NFL to Scotland and need a way to select the different stadiums and learn about these “football” teams.* User Story As a Pragmatica Leader, I want to select specific NFL Stadiums so I can see what makes a good stadium. * *worst contrived presentation demo story ever
  • 20. The Foot of the Summit Data Base Map NFL Stadiums (via GeoCommons) Special Instructions Compiler setting for ASMock/FlexUnit4 runner Create “test” folder for our unit tests
  • 21. The Foot of the Summit Source Structure Broken into Functional Areas Separate test folder
  • 22. First Belay: Write a Test FlexUnit4 Setup Test Suite (Scaling Tests) TestRunner Application User Story As a Pragmatica Leader, I want to select specific NFL Stadiums so I can see what makes a good stadium. Map Test User draws a polygon Map fires event (SelectStadiumsEvent)
  • 23. First Belay: Under Test Cairngorm Messaging event View => PM
  • 25.
  • 26. Second Belay: Write a Test Command Test Should call a service Should update model with results Application Layer Shields view from Infrastructure Changes Model Drives the Model Stadium Stadiums
  • 27. Second Belay: Under Test Cairngorm Messaging Infrastructure Command invokes returns updates Model
  • 29.
  • 30.
  • 31. Third Belay: Hook Up the View Guidelines Only knows about PM Use Flex data binding
  • 32. Third Belay: Hook Up the View
  • 33. Fourth Belay: Configure IoC Views addedToStage PMs ManagedEvents Parsley IoC Create a Context Add Presentation Models Add Business Objects Add Commands Add Services
  • 36. Race to the Summit Pragmatica Rinse, Lather, Repeat Write Tests Write Code to Satisfy Tests Hook up Views Configure IoC Some Other Examples Stadium Map Show PopUp
  • 37.
  • 38.
  • 39.
  • 40. Back at Base Camp Presentation on SlideShare http://slideshare.net/ruprict/scaling-caringorms Source Code on GitHub http://github.com/ruprict/scaling-cairngorm-ags Links to all libraries Contact Me ggoodrich@enspiria.com @ruprictGeek
  • 41. Questions Thanks for coming! Post Climb Refreshments

Editor's Notes

  1. Flex work for &gt;2 yearUsed Cairngorm 2 on a couple of projectsThis presentation focuses on Cairngorm 3, which is in beta
  2. Goal: To get to Base Camp Pragmatica where maintainable, clean Flex apps are the norm.
  3. Cairngorm 3 – the frameworkFlexUnit4 – TDDSpicefactory/Parsley – IoC, messagingAGS Flex API - MapsHamcrest – MatchersASMock – Mock framework
  4. Cairngorm 3 – the frameworkFlexUnit4 – TDDSpicefactory/Parsley – IoC, messagingAGS Flex API - MapsHamcrest – MatchersASMock – Mock framework
  5. Cairngorm 3 is still in betaI recommend using it b/c it&apos;s cleaner, easier to test &amp; maintain&quot;Microarchitecture&quot; to develop RIAsWhile some of the Cairngorm 2 patterns are still around, much of what was wrong with Cairngorm 2 is gone.Command pattern is still hereIOC is goneHas a set of Guidelines, Tools, and Libraries to help describe and support this microarchitecture
  6. Split the application into functional areas.In larger applications, you would split the functional areas into modules, and each FA would have layersPresume IoC, but don&apos;t specify a provider.  This is the heart of Cairngorm 3&apos;s adaptability.  The example implementation is written using Parsley and SpiceLibVERY different from Cairngorm 2
  7. Layout application (or modules) into the these four functional areas
  8. Layout application (or modules) into the these four functional areas