PHP And Silverlight - DevDays session

7,719 views

Published on

So you have an existing PHP application and would like to spice it up with a rich and attractive front-end. Next to Adobe Flex, you can also choose Silverlight as a solution. This session shows you around in Silverlight and shows that PHP and Silverlight can go together easily.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,719
On SlideShare
0
From Embeds
0
Number of Embeds
968
Actions
Shares
0
Downloads
107
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Intro: ieder stelt zichzelf voor 
  • Talk: Kev
  • Talk: begin, MaartenTalk: vanaf tweede bolleke: KevinRichapp: UI, look, feel, think out of the box of whatnormalappscan do, branding, user friendly, ups productivity
  • Talk: KevMaarten: Q: What’sthis WPF thing?Kev A: It’s a graphicalsubsystem, part of the .NET 3.0 framework, whichuses XAML todeveloprich user interfaces. It’s the de factosuccessor of Windows Forms.Moonlight: 2.0 in betanow, includes 3.0 features
  • Talk: Kev(grapje PHP )Beste tijd gehad: stateless model, steeds state doorgeven (viewstate) of werken met session. AJAX al beter, maar: te traag indien veelvuldig gebruikt wegens javascript. Al bij al: like putting lipstick on a pig. SL: stateful, gelijkaardig aan windows-programming; UI: XAML, quasi onbeperkt in UI design, mogelijkheden, transformatiesCompatibility: plugin voor IE, Firefox, Safari, Opera, Chrome, op Windows, Mac, Linux (Moonlight)
  • Talk: Maarten(grapje Silverlight)  W2K8 server pricing 
  • Talk: KevTalk: Maarten (PHP punt)Strong separation of UI design & logic
  • Talk: Kev / Maarten
  • Talk: Maarten
  • Talk: Maarten
  • Demo: MaartenCreate SL in VS, switch naar Eclipse (omgekeerd niet ideaal, want dan wordt er geen solution file aangemaakt) Open SL solutionusing Eclipse4SLQuickly show peoplearound Openen in Visual Studio (rechtsklik op SL-project, open in VS, maar )Kev neemt over, toont basiclayouting, VS2008, BlendSwitch to VS2008 and Blendfor the real stuffMaarten: Q: Can I host thison a PHP page?  even code laten zin in HTML waar je een SL appembed
  • Talk: KevKev: usecreated demo solution, usehtml-pagefor host, tellthismight as wellbe a php-page
  • Talk: KevKev: in newsolution, add a few borders, add a few buttons, style ‘emusingblend, animate the borders in.
  • Talk:Kev
  • Talk: KevTalk: Maarten legt WCF uit
  • Talk: Maarten-SOAP must comply to the WS-I Basic Profile 1.1 standardfor SL-What is JSON?
  • Talk: KevMaarten: Q: Why these files? (security, cross-domainaccess, … de dingen die je bij ajaxdevelopment ook tegenkomt – (bij ajax, ook geen cross domain calls))Kev: A: These files willdefinewhocanaccessyour service, and thusallow cross domain calls (crossdomain komt van flash)Kev: stress thatthis is just ONE WAY of communicatingwith services from SL
  • DEMOMaarten:Creating a JSON service in PHP using Zend Framework /AddCrossDomain/ClientAccessPolicyKev:Consuming the service in SilverlightCall Service Method
  • FF mensen de kans geven om hun dorst te lessen  (nvdr: NIET de zaal verlaten, WEL bestellen via onze site ;-))
  • Begin:so, you’veseenitwork, now: what’sunder the cover? Diveinto the SL programming modelVolgende slides: tonen in code, belangrijke zaken overlopen, en dan terug naar de slidesTalk: Kev
  • Talk: Kev
  • Talk: Kev
  • Talk: KevMaarten: Q: Thisbasicallymeansthatwhenever data changes, myapplicationwillautomaticallyknow?Kev: A: yup, SL controlsautomaticallyhandle the NotifyPropertyChangedeventwhenfired to update their UI ifneeded
  • Talk: Kev
  • PHP And Silverlight - DevDays session

    1. 1. PHP and Silverlight LEVEL 200 Maarten Balliauw & Kevin Dockx RealDolmen
    2. 2. Who are we? Maarten Balliauw – RealDolmen Kevin Dockx – RealDolmen E-mail: E-mail: maarten.balliauw@realdolmen.com kevin.dockx@realdolmen.com Blog: Blog: http://blog.maartenballiauw.be http://kevindockx.blogspot.com Twitter: http://twitter.com/maartenballiauw June 1, 2009 PHP and Silverlight 2
    3. 3. Agenda • What is Silverlight? • Why Silverlight? • Why Silverlight and PHP? • Building an application using both • More on Silverlight • Q&A June 1, 2009 PHP and Silverlight 3
    4. 4. What is Silverlight? • Rich Applications are the future, today – Adobe Flex – Microsoft Silverlight • Silverlight – “A framework for providing rich applications to the browser” – “A cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of Rich Internet Applications for the web” June 1, 2009 PHP and Silverlight 4
    5. 5. What is Silverlight? • 4-5 MB plugin – Download once, distributed through Windows Update – Also available on Linux (Moonlight) and Mac • Runs in browser, on the client – Internet Explorer – Firefox, Safari, Opera, Chrome • Subset of the full .NET Framework – Originated from Windows Presentation Foundation • Rich UI: XAML / .NET code: C# - VB.NET June 1, 2009 PHP and Silverlight 5
    6. 6. Why Silverlight? • HTML / PHP / ASPX / AJAX – Best days are over… – Extending HTML (CSS 3, AJAX, …) – “like putting lipstick on a pig” • Silverlight – Stateful model – .NET Framework – UI Capabilities – Cross-platform June 1, 2009 PHP and Silverlight 6
    7. 7. Why Silverlight and PHP? • Best of both worlds? • PHP – Rapid application programming – Ideal as back-end using JSON or SOAP – Re-use your existing PHP logic • Silverlight – Rapid user interface development – Create rich interfaces using a rich framework June 1, 2009 PHP and Silverlight 7
    8. 8. Programming Silverlight • XAML – “an XML file that defines user interfaces” – Tool: Expression Blend (or Eclipse) • .NET – Rich framework offering endless possibilities – Tool: Microsoft Visual Studio (2008, .NET 3.5, SP1) (or Eclipse) • PHP – i.e. Zend Framework – Tool: Zend Studio (or Eclipse PDT)  Strong separation of UI design & logic June 1, 2009 PHP and Silverlight 8
    9. 9. Getting started • Visual Studio 2008 SP1 • Silverlight Tools for VS2008 SP1 – VS2008 Updates – Project Templates – Runtime – SDK • Expression Blend 2.0 SP1 • Possibility: Eclipse4SL - http://www.eclipse4sl.org/ June 1, 2009 PHP and Silverlight 9
    10. 10. • Under active development (ongoing) • Catching up Visual Studio 2008 Silverlight editing possibilities – But just like VS2008: still not the rich designer that Expression Blend is… • Currently Win & Mac • Next milestone: full SL debugging http://www.eclipse4sl.org June 1, 2009 PHP and Silverlight 10
    11. 11. Why Eclipse4SL? • Allows Eclipse developers to build Eclipse Developer RIA with Silverlight • Allows Collaboration between – Web Designers Common Project – .NET Developers System Web – Eclipse Developers .NET Developer Designer (Java, PHP, ..) June 1, 2009 PHP and Silverlight 11
    12. 12. Editing a Silverlight Solution DEMO June 1, 2009 PHP and Silverlight 12
    13. 13. What about my data? • Silverlight does not include data namespaces (client tech)! • For most apps, this forces you to use a Service Oriented Architecture June 1, 2009 PHP and Silverlight 15
    14. 14. Communicating (with data services) • Silverlight includes support for – WebClient, WebHttpRequest-classes – REST, JSON, SOAP, … – Windows Communication Foundation – … almost any kind of service can be accessed • Preferred way to communicate: through WCF – BasicHttpBinding June 1, 2009 PHP and Silverlight 16
    15. 15. Zend Framework SOAP • Not 100% compatible WS-I Basic Profile 1.1  – http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html • WCF supports the ZF implementation • Silverlight doesn’t: subset of WCF • SOAP service should be possible with NuSOAP • Solution we used: JSON June 1, 2009 PHP and Silverlight 17
    16. 16. Communicating with JSON-service • CrossDomain.xml / ClientAccessPolicy.xml – Tells SL it/who can access the service • Use WebClient • Add handler to completed event • Call service method (Async) June 1, 2009 PHP and Silverlight 18
    17. 17. {Liquify} your brain BarTender - Communicating with service DEMO June 1, 2009 PHP and Silverlight 19
    18. 18. BarTender - Communicating with service DEMO June 1, 2009 PHP and Silverlight 20
    19. 19. Keywords when working with data • DataContext • DataBinding • INotifyPropertyChanged/CollectionChanged • ValueConverters June 1, 2009 PHP and Silverlight 21
    20. 20. What else is there? • Localization • Isolated Storage June 1, 2009 PHP and Silverlight 30
    21. 21. Resources: Silverlight Toolkit • Contains controls, components, utilities to use in SL apps (MS, source available) – AutoCompleteBox, different Panel controls, UpDown control, Treeview, Expander, … – Charting component – ImplicitStyleManager – Various themes included • http://www.codeplex.com/Silverlight June 1, 2009 PHP and Silverlight 31
    22. 22. Resources: Blacklight • Contains components to use in SL apps, focussed on design (3rd party, source available) – Glass, DropShadow, InnerGlow, OuterGlow, Perspective Shadow, Radial Shadow Border – DragDrop Panel, Animated Layout Panel • http://www.codeplex.com/Blacklight June 1, 2009 PHP and Silverlight 32
    23. 23. Resources • http://silverlight.net/ • http://codeplex.com/Silverlight • http://codeplex.com/Blacklight • http://silverlightdragdrop.codeplex.com June 1, 2009 PHP and Silverlight 33
    24. 24. Questions and Answers June 1, 2009 PHP and Silverlight 34
    25. 25. Next steps… • Since we are last today… • Go grab a beer! • Pay us a beer!  • Enjoy your day and weekend! June 1, 2009 PHP and Silverlight 35
    26. 26. http://blog.maartenballiauw.be http://kevindockx.blogspot.com

    ×