Top Banner
PHP and Silverlight Maarten Balliauw & Kevin Dockx RealDolmen LEVE L 200
26

PHP And Silverlight - DevDays session

May 13, 2015

Download

Technology

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PHP And Silverlight - DevDays session

PHP and SilverlightMaarten Balliauw & Kevin Dockx

RealDolmen

LEVEL 200

Page 2: PHP And Silverlight - DevDays session

Who are we?

April 12, 2023 PHP and Silverlight 2

Maarten Balliauw – RealDolmen

E-mail: [email protected]

Blog: http://blog.maartenballiauw.be

Twitter: http://twitter.com/maartenballiauw

Kevin Dockx – RealDolmenE-mail:

[email protected] Blog:

http://kevindockx.blogspot.com

Page 3: PHP And Silverlight - DevDays session

Agenda

• What is Silverlight?• Why Silverlight?• Why Silverlight and PHP?• Building an application using both• More on Silverlight• Q&A

April 12, 2023 PHP and Silverlight 3

Page 4: PHP And Silverlight - DevDays session

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”

April 12, 2023 PHP and Silverlight 4

Page 5: PHP And Silverlight - DevDays session

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.NETApril 12, 2023 PHP and Silverlight 5

Page 6: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 6

Page 7: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 7

Page 8: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 8

Page 9: PHP And Silverlight - DevDays session

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/

April 12, 2023 PHP and Silverlight 9

Page 10: PHP And Silverlight - DevDays session

• 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

April 12, 2023 PHP and Silverlight 10

Page 11: PHP And Silverlight - DevDays session

Why Eclipse4SL?

• Allows Eclipsedevelopers to buildRIA with Silverlight

• Allows Collaborationbetween– Web Designers– .NET Developers– Eclipse Developers

(Java, PHP, ..)

April 12, 2023 PHP and Silverlight 11

Common Project System

.NET Developer

Web Designer

Eclipse Developer

Page 12: PHP And Silverlight - DevDays session

DEMOEditing a Silverlight Solution

April 12, 2023 PHP and Silverlight 12

Page 13: PHP And Silverlight - DevDays session

What about my data?

• Silverlight does not include data namespaces (client tech)!

• For most apps, this forces you to use a Service Oriented Architecture

April 12, 2023 PHP and Silverlight 15

Page 14: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 16

Page 15: PHP And Silverlight - DevDays session

Zend Framework SOAP

• Not 100% compatible WS-I Basic Profile 1.1 – http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-2

4.html

• WCF supports the ZF implementation• Silverlight doesn’t: subset of WCF• SOAP service should be possible with

NuSOAP

• Solution we used: JSONApril 12, 2023 PHP and Silverlight 17

Page 16: PHP And Silverlight - DevDays session

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)

April 12, 2023 PHP and Silverlight 18

Page 17: PHP And Silverlight - DevDays session

DEMOBarTender - Communicating with

service

April 12, 2023 PHP and Silverlight 19

{Liquify} your brain

Page 18: PHP And Silverlight - DevDays session

DEMOBarTender - Communicating with

service

April 12, 2023 PHP and Silverlight 20

Participate in our demo!

http://ow.ly/6OQ1

Page 19: PHP And Silverlight - DevDays session

Keywords when working with data

• DataContext• DataBinding• INotifyPropertyChanged/CollectionChanged• ValueConverters

April 12, 2023 PHP and Silverlight 21

Page 20: PHP And Silverlight - DevDays session

What else is there?

• Localization

• Isolated Storage

April 12, 2023 PHP and Silverlight 30

Page 21: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 31

Page 22: PHP And Silverlight - DevDays session

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

April 12, 2023 PHP and Silverlight 32

Page 23: PHP And Silverlight - DevDays session

Resources

• http://silverlight.net/• http://codeplex.com/Silverlight• http://codeplex.com/Blacklight• http://silverlightdragdrop.codeplex.com

April 12, 2023 PHP and Silverlight 33

Page 24: PHP And Silverlight - DevDays session

Questions and Answers

?April 12, 2023 PHP and Silverlight 34

Page 25: PHP And Silverlight - DevDays session

Next steps…

• Since we are last today…• Go grab a beer!• Pay us a beer!

• Enjoy your day and weekend!

April 12, 2023 PHP and Silverlight 35

Page 26: PHP And Silverlight - DevDays session

http://blog.maartenballiauw.be http://kevindockx.blogspot.com