SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
SESSION CODE: WPH301

  AlphaJax - Building a cloud-
  connected game for WP7 using
  Silverlight & Caliburn Micro
  MVVM Light
  Keith Patton - @kpatton
  Development Manager
  www.markerstudio.com
AlphaJax – WP7, Silverlight and Caliburn Micro
The next 60 minutes….
1.   App Overview and Demo (15 mins)
2.   Architectural Overview (5 mins)
3.   Deep Dive - Creating a New Game (30 mins)
4.   Testing with Silverlight Unit Testing Framework (10 mins)




3
www.alphajax.com
      @alphajax




4
AlphaJax –Architectural Overview
                                           Microsoft
                                       Push Notifications
      Views (UI)

    Caliburn Micro
     (Fairy Dust)                     WCF Rest/Json
                                      (Web Services)
     View Models
    (Data Context)   Service Agents       Entity
                                       Framework
     Local Model


5
AlphaJax –Architectural Overview - Solution




6
AlphaJax – Deep Dive
Creating a new Game
You can create games in 4 ways….
    Choose an email contact on the phone
    Enter the AlphaJax username of a friend
    Choose a random opponent
    Choose a top opponent played before


7
AlphaJax - Creating a New Game – The View




 8
AlphaJax -
    Creating a
    New Game -
    The View CB




9
AlphaJax - Creating a New Game -View Model 1




10
AlphaJax - Creating a New Game -View Model 2




11
AlphaJax – Introducing Caliburn Micro
     A WP7 framework which….
       Wires VModels to Views via Convention (no code required)
       Wires View Events to VModels via Convention (e.g. Button Clicks)
       Simple IoC Container to allow VM Dependency Injection
       Provides VM lifecycle management capabilities
       55KB!




12
AlphaJax – Caliburn Micro – Setting Up

1. Reference Caliburn.Micro.dll
   (http://caliburnmicro.codeplex.com/)
2. Add IoC container classes (code provided)
3. Add a Bootstrapper class and add VModels
4. Reference Bootstrapper in App.xaml



13
AlphaJax – Caliburn Micro - Bootstrapper




14
AlphaJax – Caliburn Micro – App.xaml.cs




15
AlphaJax – Caliburn Micro – [SurviveTombstone]




16
AlphaJax – Isolated Storage

     There are apis for persisting state
     For example, game state, application settings, anything
     you want to persist across app restarts
     There are no limits as such, but be sensible




17
AlphaJax – Isolated Storage Worker – Get/Save




18
AlphaJax – Isolated Storage Worker – Deletion




19
AlphaJax – Deep Dive - Creating a New Game
The Web Service – GameService.svc.cs
     Use REST, not SOAP.
     Use JSON, not XML.
     Isn’t WCF Config a Nightmare?




20
AlphaJax – Deep Dive - Web Service
Web.Config – Step 1 of 3




21
AlphaJax – Deep Dive - Web Service
GameService.svc – Step 2 of 3




22
AlphaJax – Deep Dive - Web Service
GameService.svc.cs – Step 3 of 3




23
AlphaJax – Deep Dive - Creating a New Game
The Web Service – REST Attributes




24
AlphaJax – Deep Dive - Creating a New Game
The Web Service – WCF REST Help Page




25
AlphaJax – Deep Dive - WCF Client Helper
The Web Service – WCF Rest Client




26
AlphaJax – Deep Dive - Creating a New Game
Business Layer – Entity Framework
     Entity Framework and SQL 2008 Server as back end
     EF Profiler for performance analysis.
     (www.efprof.com)
     Do NOT serialize your entities directly!




27
AlphaJax – Deep Dive - DTO Example

                        Keep your data contracts
                        as simple and small as
                        possible.
                        Do not expose your
                        entities across the wire
                        Use scalar values
                        wherever possible

28
AlphaJax – Deep Dive - EF Profiler




29
AlphaJax
Testing it all with SL Unit Testing Framework
     4 public methods on CreateViewModel
        CreateByUsername – via button click
        CreateByEmail – via email chooser task
        CreateByRandom – via button click
        CreateBySelectedTopOpponent – via listbox
     Caliburn gives us maximum testability
     Demo of the SL Unit Testing App

30
AlphaJax – Unit Testing – Async Test Example




31
AlphaJax – Unit Testing – Async Timeout

                              You should use this
                              approach to ensure
                              that your tests don’t
                              time out if the
                              callback never fires!




32
AlphaJax
Hosting
     Currently using www.gogrid.com cloud hosting
     GoGrid supports easy creation of a ‘Gold VM’ which you
     can instantiate out in < 20 minutes.
     F5 Load Balancer for free
     Pay for what you use or pay monthly for ‘RAM hours’
     SQL Server discounts for Bizspark partners
     Pondering Azure….

33
AlphaJax
SL Unit Testing Framework Links
     Get the SL Unit Testing Framework for WP7:
     http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/
     Unit Testing Walkthrough Blog Post:
     http://www.markerstudio.com/technical/2010/07/mvvm-
     light-and-unit-testing-example/



34
AlphaJax
Caliburn Micro Resources

     Caliburn Micro WP7 blog post:
     http://devlicio.us/blogs/rob_eisenberg/archive/2010/08/07/caliburn-micro-soup-to-nuts-pt-4-working-with-
     windows-phone-7.aspx

     Simple Container IoC used by Caliburn Micro
     http://simplecontainer.codeplex.com/

     More on WCF Rest
     http://msdn.microsoft.com/en-us/netframework/cc950529.aspx



35
AlphaJax
Other Info And Links
     Follow me @kpatton
     Follow @alphajax
     My company www.markerstudio.com
     Sign up at AlphaJax www.alphajax.com
     Sell your apps!
     http://developer.windowsphone.com


36
Related Content
     WPH303 Triskaidekaphobia? 5.25pm in the Elliot Room, i.e. NOW!


     WPH401 From Phone Zero to Phone Hero in 60 minutes
     Chris Auld and Chris Klug in Theatre
     Wed 1st September 2.55pm



 Thank You!




37
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should
 not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
                                                                           IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Más contenido relacionado

Último

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 

Último (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

AlphaJax = Building a cloud-connected game for Windows Phone 7 using Silverlight and Caliburn Micro Framework

  • 1.
  • 2. SESSION CODE: WPH301 AlphaJax - Building a cloud- connected game for WP7 using Silverlight & Caliburn Micro MVVM Light Keith Patton - @kpatton Development Manager www.markerstudio.com
  • 3. AlphaJax – WP7, Silverlight and Caliburn Micro The next 60 minutes…. 1. App Overview and Demo (15 mins) 2. Architectural Overview (5 mins) 3. Deep Dive - Creating a New Game (30 mins) 4. Testing with Silverlight Unit Testing Framework (10 mins) 3
  • 4. www.alphajax.com @alphajax 4
  • 5. AlphaJax –Architectural Overview Microsoft Push Notifications Views (UI) Caliburn Micro (Fairy Dust) WCF Rest/Json (Web Services) View Models (Data Context) Service Agents Entity Framework Local Model 5
  • 7. AlphaJax – Deep Dive Creating a new Game You can create games in 4 ways…. Choose an email contact on the phone Enter the AlphaJax username of a friend Choose a random opponent Choose a top opponent played before 7
  • 8. AlphaJax - Creating a New Game – The View 8
  • 9. AlphaJax - Creating a New Game - The View CB 9
  • 10. AlphaJax - Creating a New Game -View Model 1 10
  • 11. AlphaJax - Creating a New Game -View Model 2 11
  • 12. AlphaJax – Introducing Caliburn Micro A WP7 framework which…. Wires VModels to Views via Convention (no code required) Wires View Events to VModels via Convention (e.g. Button Clicks) Simple IoC Container to allow VM Dependency Injection Provides VM lifecycle management capabilities 55KB! 12
  • 13. AlphaJax – Caliburn Micro – Setting Up 1. Reference Caliburn.Micro.dll (http://caliburnmicro.codeplex.com/) 2. Add IoC container classes (code provided) 3. Add a Bootstrapper class and add VModels 4. Reference Bootstrapper in App.xaml 13
  • 14. AlphaJax – Caliburn Micro - Bootstrapper 14
  • 15. AlphaJax – Caliburn Micro – App.xaml.cs 15
  • 16. AlphaJax – Caliburn Micro – [SurviveTombstone] 16
  • 17. AlphaJax – Isolated Storage There are apis for persisting state For example, game state, application settings, anything you want to persist across app restarts There are no limits as such, but be sensible 17
  • 18. AlphaJax – Isolated Storage Worker – Get/Save 18
  • 19. AlphaJax – Isolated Storage Worker – Deletion 19
  • 20. AlphaJax – Deep Dive - Creating a New Game The Web Service – GameService.svc.cs Use REST, not SOAP. Use JSON, not XML. Isn’t WCF Config a Nightmare? 20
  • 21. AlphaJax – Deep Dive - Web Service Web.Config – Step 1 of 3 21
  • 22. AlphaJax – Deep Dive - Web Service GameService.svc – Step 2 of 3 22
  • 23. AlphaJax – Deep Dive - Web Service GameService.svc.cs – Step 3 of 3 23
  • 24. AlphaJax – Deep Dive - Creating a New Game The Web Service – REST Attributes 24
  • 25. AlphaJax – Deep Dive - Creating a New Game The Web Service – WCF REST Help Page 25
  • 26. AlphaJax – Deep Dive - WCF Client Helper The Web Service – WCF Rest Client 26
  • 27. AlphaJax – Deep Dive - Creating a New Game Business Layer – Entity Framework Entity Framework and SQL 2008 Server as back end EF Profiler for performance analysis. (www.efprof.com) Do NOT serialize your entities directly! 27
  • 28. AlphaJax – Deep Dive - DTO Example Keep your data contracts as simple and small as possible. Do not expose your entities across the wire Use scalar values wherever possible 28
  • 29. AlphaJax – Deep Dive - EF Profiler 29
  • 30. AlphaJax Testing it all with SL Unit Testing Framework 4 public methods on CreateViewModel CreateByUsername – via button click CreateByEmail – via email chooser task CreateByRandom – via button click CreateBySelectedTopOpponent – via listbox Caliburn gives us maximum testability Demo of the SL Unit Testing App 30
  • 31. AlphaJax – Unit Testing – Async Test Example 31
  • 32. AlphaJax – Unit Testing – Async Timeout You should use this approach to ensure that your tests don’t time out if the callback never fires! 32
  • 33. AlphaJax Hosting Currently using www.gogrid.com cloud hosting GoGrid supports easy creation of a ‘Gold VM’ which you can instantiate out in < 20 minutes. F5 Load Balancer for free Pay for what you use or pay monthly for ‘RAM hours’ SQL Server discounts for Bizspark partners Pondering Azure…. 33
  • 34. AlphaJax SL Unit Testing Framework Links Get the SL Unit Testing Framework for WP7: http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/ Unit Testing Walkthrough Blog Post: http://www.markerstudio.com/technical/2010/07/mvvm- light-and-unit-testing-example/ 34
  • 35. AlphaJax Caliburn Micro Resources Caliburn Micro WP7 blog post: http://devlicio.us/blogs/rob_eisenberg/archive/2010/08/07/caliburn-micro-soup-to-nuts-pt-4-working-with- windows-phone-7.aspx Simple Container IoC used by Caliburn Micro http://simplecontainer.codeplex.com/ More on WCF Rest http://msdn.microsoft.com/en-us/netframework/cc950529.aspx 35
  • 36. AlphaJax Other Info And Links Follow me @kpatton Follow @alphajax My company www.markerstudio.com Sign up at AlphaJax www.alphajax.com Sell your apps! http://developer.windowsphone.com 36
  • 37. Related Content WPH303 Triskaidekaphobia? 5.25pm in the Elliot Room, i.e. NOW! WPH401 From Phone Zero to Phone Hero in 60 minutes Chris Auld and Chris Klug in Theatre Wed 1st September 2.55pm Thank You! 37
  • 38. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.