Logo

Maarten Balliauw {blog}

ASP.NET, ASP.NET MVC, Azure, PHP, OpenXML, VSTS, ...

About the author

Maarten Balliauw is an MVP ASP.NET and is currently employed as .NET Software Engineer at RealDolmen. His interests are mainly web applications developed in ASP.NET (C#) or PHP.
More about me More about me
Send mail E-mail me


Microsoft Most Valuable Professional - MVP - ASP.NET

Subscribe to my RSS feed Follow me on Twitter! View Maarten Balliauw's profile on LinkedIn RealDolmen - Rock-solid passion for ICT
I'm a speaker at TechDays Belgium and TechDays Finland

Search

Latest Twitter

    Follow me on Twitter...

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

    © Copyright Maarten Balliauw 2010

    Running PHP in the Cloud slides and sample code

    Just got back from London where I did a fun talk on PHP and Windows Azure yesterday evening. It was the first time I did a presentation after three beers, but I think it went allright. As promised, here's the slide deck and sample code (ImageCloud.rar (5.00 mb)).

    Abstract: "This session covers the basics of Microsoft’s Windows Azure cloud platform. Learn how you can develop and deploy a PHP application in Windows Azure, using the tools and libraries Microsoft provides. Creating a photo upload application, the different aspects of the Windows Azure platform are leveraged for creating a performant and scalable PHP application."

    Thanks for joining the conference and my session! Also, Robert Castelo, your talk on Drupal and its community was interesting. Did not know the active developer base and security teams were that big.


    Jump in! camp - Call for participants

    Jump In! Camp I just got the following invitation from Microsoft, and would like to encourage  you to participate as well if you are interested in bot PHP and the Microsoft worlds.

    Jump In! and be a part of it!

    Open source programming and Microsoft: two incompatible worlds? Microsoft is partnering with renowned actors of the open-source community to organise the Jump In! Developers' Camp in an effort to combat this misperception. Twenty-five knowledge-hungry open source application developers from all over Europe will be invited to spend four unforgettable days of dialogue, networking and workshops at the beautiful Panorama Resort & Spa Feusisberg in Switzerland.

    The Jump In! Developers' Camp is designed primarily for open-source application developers who are interested in increasing their skills in a range of specific areas. Here they will be able to experiment with ways of combining open-source technologies with Microsoft products to optimize applications. But don’t worry: no one is out to ‘convert’ anybody! The aim instead is to promote interoperability, problem-solving and enhance programming skills. Software experts will be on hand to provide tips and advice, and a range of workshops will be held on topics including Azure, IIS, Silverlight and more in combination with open-source applications. Plenty of time for actual coding will be available.

    Potential participants are invited to file an application at www.jumpincamp.com, outlining their profile. The 25 developers who are creating the most “buzz” for themselves and their programming abilities will then be selected. Attendees of the JumpIn! Developers' Camp will then record their impressions and experiences in a live blog for their community of ‘followers’. The Camp will be held between 6 - 9 April 2010.

    Register now and apply for taking part on www.jumpincamp.com.


    Categories: Events | General | ICT | Internet | PHP

    Just Another Wordpress Weblog, But More Cloudy

    4322759659_6cab114506_b Slides of my talk at the PHPBenelux conference last weekend are online. Bit of a pity my live demo went wrong due to my www.azure.com trial account going into read-only mode while doing the demo.

    Abstract: "While working together with Microsoft on the Windows Azure SDK for PHP, we found that we needed an popular example application hosted on Microsoft’s Windows Azure. Wordpress was an obvious choice, but not an obvious task. Learn more about Windows Azure, the PHP SDK that we developed, SQL Azure and about the problems we faced porting an existing PHP application to Windows Azure."

    Thanks for joining the conference and my session! And thanks to the PHPBenelux crew for organizing their first conference ever, it rocked!


    PHPMEF 0.1.0 released!

    PHP MEF A while ago, I did a conceptual blog post on PHP Managed Extensibility Framework – PHPMEF. Today, I’m proud to announce the first public release of PHPMEF! After PHPExcel, PHPLinq, PHPPowerPoint and the Windows Azure SDK for PHP, PHPMEF is the 5th open-source project I started on interoperability (or conceptual interoperability) between the Microsoft world and the PHP world. Noble price for peace upcoming :-)

    What is this thing?

    PHPMEF is a PHP port of the .NET Managed Extensibility Framework, allowing easy composition and extensibility in an application using the Inversion of Control principle and 2 easy keywords: @export and @import.

    PHPMEF is based on a .NET library, MEF, targeting extensibility of projects. It allows you to declaratively extend your application instead of requiring you to do a lot of plumbing. All this is done with three concepts in mind: export, import and compose. “PHPMEF” uses the same concepts in order to provide this extensibility features.

    Show me an example!

    Ok, I will. But not here. Head over to http://phpmef.codeplex.com and have a look at the principles and features behind PHPMEF.

    Enjoy!


    Categories: C# | General | ICT | MEF | PHP | Projects

    Vote to help me speak at the MIX 2010 conference!

    Everybody knows the Microsoft MIX event, right? The one in Las Vegas? The one with all the fancy web-related stuff? Rings a bell? Ok, great. In the beginning of December 2009, Microsoft did an open call for speakers, which I answered with some session proposals. Who doesn’t want to go to Vegas, right?

    The open call proposals have been processed (150+ sessions submitted, wow!) and a voting has started. Yes, you hear me coming: please go ahead and vote for a session I submitted. Voting ends January 15th, 2010.

    Since I could not decide which color of the voting banner matched best with my blog’s theme, I decided to put them all three online:

    image

    Thanks in advance!

    Maarten

    PS: There's also Elijah Manor, Justin Etheredge, K. Scott Allen, and many others who submitted good looking sessions.

    kick it on DotNetKicks.com


    Microsoft Web Development Summit 2009

    PHP at Microsoft Being in the US for 2 times in a month (PDC09 and Web Development Summit) is fun, tiring and rewarding. The WDS09 was an invite-only event organized by Microsoft, focusing on interaction between Microsoft and the PHP community. I must say: the event has been helpful and interesting for both parties!

    • The Heathman Hotel in Kirkland is a nice hotel!
    • Traveling towards the US is far more productive than flying back: I did PHPMEF traveling westbound, I crashed (half sleep/half awake) on the eastbound flight…
    • If you just traveled over 26 hours: do NOT go shopping immediately when you arrive home! It’s really frustrating and tiring.
    • Did a session on Windows Azure SDK for PHP, PHPExcel and PHPLinq.
    • Did an interview for the Connected Show
    • Met a lot of people I knew from Twitter and e-mail, and met a lot of new people, both Microsoft and PHP community. Nice to meet you all!
    • Event focus was on feedback between Microsoft and PHP community, overall I think the dialogue was respectful and open and helpful to both parties.

    Standing at the Microsoft logo

    This was actually my first time at the WDS which has been around for 5 years already. The Interop team invited me there, and I want to thank them for doing that: it was a great trip, a great event and I got the chance to meet lots of new people.

    Attendees were mostly people from the PHP community, like Cal Evans, Rafael Doms, Chris Cornutt, Romain Bourdon (WAMP server anyone?), Alison “snipe” Gianotto, … Next to that, lots of Microsoft people came by during various sessions. Some of them even reserved the whole week and were attending all sessions to make sure they were in the feedback loop all the time.

    We’ve seen Microsoft sessions on IIS, Web Platform Installer, Silverlight, SQL Server, Bing, Powershell (sorry, Scott Hanselman, for disturbing your presentation with a tweet :-)). Interesting sessions with some info I did not know. PHP community sessions were also available: Wordpress, Joomla, Drupal, the PHP community perspective, feedback sessions, PHPLinq, PHPExcel, interoperability bridges, … A good mix of content with knowledgeable speakers and good communication between speakers, product groups and audience. Well done!


    PHP Managed Extensibility Framework – PHPMEF

    image While flying sitting in the airplane to the Microsoft Web Developer Summit in Seattle, I was watching some PDC09 sessions on my laptop. During the MEF session, an idea popped up: there is no MEF for PHP! 3500 kilometers after that moment, PHP got its own MEF…

    What is MEF about?

    MEF is a .NET library, targeting extensibility of projects. It allows you to declaratively extend your application instead of requiring you to do a lot of plumbing. All this is done with three concepts in mind: export, import and compose. (Glenn, I stole the previous sentence from your blog). “PHPMEF” uses the same concepts in order to provide this extensibility features.

    Let’s start with a story… Imagine you are building a Calculator. Yes, shoot me, this is not a sexy sample. Remember I wrote this one a plane with snoring people next to me…The Calculator is built of zero or more ICalculationFunction instances. Think command pattern. Here’s how such an interface can look like:

    interface ICalculationFunction
    {
        public function execute($a, $b);
    }

    Nothing special yet. Now let’s implement an instance which does sums:

    class Sum implements ICalculationFunction
    {
        public function execute($a, $b)
        {
            return $a + $b;
        }
    }

    Now how would you go about using this in the following Calculator class:

    class Calculator
    {
        public $CalculationFunctions;
    }

    Yes, you would do plumbing. Either instantiating the Sum object and adding it into the Calculator constructor, or something similar. Imagine you also have a Division object. And other calculation functions. How would you go about building this in a maintainable and extensible way? Easy: use exports…

    Export

    Exports are one of the three fundaments of PHPMEF. Basically, you can specify that you want class X to be “ exported”  for extensibility. Let’s export Sum:

    /**
      * @export ICalculationFunction
      */

    class Sum implements ICalculationFunction
    {
        public function execute($a, $b)
        {
            return $a + $b;
        }
    }

    Sum is exported as Sum by default, but in this case I want PHPMEF to know that it is also exported as ICalculationFunction. Let’s see why this is in the import part…

    Import

    Import is a concept required for PHPMEF to know where to instantiate specific objects. Here’s an example:

    class Calculator
    {
        /**
          * @import ICalculationFunction
          */

        public $SomeFunction;
    }

    In this case, PHPMEF will simply instantiate the first ICalculationFunction instance it can find and assign it to the Calculator::SomeFunction variable. Now think of our first example: we want different calculation functions in our calculator! Here’s how:

    class Calculator
    {
        /**
          *  @import-many ICalculationFunction
          */

        public $CalculationFunctions;
    }

    Easy, no? PHPMEF will ensure that all possible ICalculationFunction instances are added to the Calculator::CalculationFunctions array. Now how is all this being plumbed together? It’s not plumbed! It’s composed!

    Compose

    Composing matches all exports and imports in a specific application path. How? Easy! Use the PartInitializer!

    // Create new Calculator instance
    $calculator = new Calculator();

    // Satisfy dynamic imports
    $partInitializer = new Microsoft_MEF_PartInitializer();
    $partInitializer->satisfyImports($calculator);

    Easy, no? Ask the PartInitializer to satisfy all imports and you are done!

    Advanced usage scenarios

    The above sample was used to demonstrate what PHPMEF is all about. I’m sure you can imagine more complex scenarios. Here are some other possibilities…

    Single instance exports

    By default, PHPMEF instantiates a new object every time an import has to be satisfied. However, imagine you want our Sum class to be re-used. You want PHPMEF to assign the same instance over and over again, no matter where and how much it is being imported. Again, no plumbing. Just add a declarative comment:

    /**
      * @export ICalculationFunction
      * @export-metadata singleinstance
      */

    class Sum implements ICalculationFunction
    {
        public function execute($a, $b)
        {
            return $a + $b;
        }
    }

    Export/import metadata

    Imagine you want to work with interfaces like mentioned above, but want to use a specific implementation that has certain metadata defined. Again: easy and no plumbing!

    My calculator might look like the following:

    class Calculator
    {
        /**
          *  @import-many ICalculationFunction
          */

        public $CalculationFunctions;

        /**
          *  @import ICalculationFunction
          *  @import-metadata CanDoSums
          */

        public $SomethingThatCanDoSums;
    }

    Calculator::SomeThingThatCanDoSums is now constrained: I only want to import something that has the metadata “CanDoSums” attached. Here’s how to create such an export:

    /**
      * @export ICalculationFunction
      * @export-metadata CanDoSums
      */

    class Sum implements ICalculationFunction
    {
        public function execute($a, $b)
        {
            return $a + $b;
        }
    }

    Here’s an answer to a question you may have: yes, multiple metadata definitions are possible and will be used to determine if an export matches an import.

    One small note left: you can also ask the PartInitializer for the metadata defined on a class.

    // Create new Calculator instance
    $calculator = new Calculator();

    // Satisfy dynamic imports
    $partInitializer = new Microsoft_MEF_PartInitializer();
    $partInitializer->satisfyImports($calculator);

    // Get metadata
    $metadata = $partInitializer->getMetadataForClass('Sum');

    Can I get the source?

    No, not yet. For a number of reasons. I first want to make this thing a bit more stable, as well as deciding if all MEF features should be ported. Also, I’m looking for an appropriate name/library to put this in. You may have noticed the Microsoft_* naming, a small hint to the Interop team in incorporating this as another Microsoft library in the PHP world. Yes Vijay, talking to you :-)


    Categories: General | ICT | Internet | MEF | PHP | Projects | Software

    Book review: Zend Framework 1.8 Web Application Development

    Zend Framework 1.8 Web Application Development My book shelf is starting to look a lot like the warehouse of Packt Publishing: I’ve received yet another book from them. Different from all previous reviews I did: this one is a PHP book, titled “Zend Framework 1.8 Web Application Development” by Keith Pope.

    A chapter overview:

    • Chapter 1: Creating a Basic MVC Application
    • Chapter 2: The Zend Framework MVC Architecture
    • Chapter 3: Storefront Basic Setup
    • Chapter 4: Storefront Models (great chapter!)
    • Chapter 5: Implementing the Catalog
    • Chapter 6: Implementing User Accounts
    • Chapter 7: The Shopping Cart
    • Chapter 8: Authentication and Authorization
    • Chapter 9: The Administration Area
    • Chapter 10: Storefront Roundup
    • Chapter 11: Storefront Optimization
    • Chapter 12: Testing the Storefront

    Let’s also state the obvious: Zend Framework evolves much faster than publishers. The framework is now at 1.9.6, while the book covers 1.8.0. Do not let this stop you from reading this book! Let me explain why…

    1. The book covers all concepts and components in the Zend Framework in a full-blown application that is built up from scratch.
    2. Next to that, Keith Pope focuses a lot on the application design, using interfaces, unit testing, mocking, dependency injection, … Want to learn a lot about good application design? Then this is the number one reason to read this book!

    These 2 points actually summarize the whole book. Great read, great content and a must-read for everyone who is not completely sure about his application design skills. Congratulations, Keith!


    Windows Azure Tools for Eclipse for PHP developers

    Pfew! Finally I can spread the word on this! While working on the Windows Azure SDK for PHP, I had the opportunity to test-drive the development builds of the WIndows Azure Tools for Eclipse. Today, the project has been released officially at www.windowsazure4e.org. Windows Azure Tools for Eclipse provides a series of wizards and utilities that allow developers to write, debug, and configure for and deploy PHP applications to Windows Azure.

    image

    The plug-in also bundles the existing Windows Azure SDK for PHP, which was introduced a few months ago. This SDK provides a simple API for PHP developers who use the Windows Azure storage component, making it very easy to use the blob, queue and table data storage features. Just visit the project site at http://phpazure.codeplex.com/.

    Some labs are available to help you get started with PHP on the WIndows Azure platform: http://www.windowsazure4e.org/learn/


    Categories: Azure | C# | General | ICT | Internet | PHP | Software

    Upcoming sessions on Azure, PHP and ASP.NET

    It’s going to be a filled end of 2009… There’s Microsoft PDC which I will be attending and will probably cause me some sleepless nights (both due to jetlag and due to all the new stuff that will be released). Next to that, I’ll also be doing some sessions in the next few weeks. Here’s a list…

    Date

    Event

    28 october 2009

    PHPBenelux Meeting: PHP and Microsoft technologies

    I’ll be doing two sessions here:

    · PHP and Silverlight, together with Kevin Dockx
    “This session covers the basics of Microsoft Silverlight and demonstrates how PHP developers can benefit from developing rich client-side components that run in the web browser using Silverlight and PHP.”

    · Make Web not War, together with Katrien De Graeve
    “Microsoft will present the array of initiatives in the company to better support and integrate with PHP and give you an introduction on Windows Azure and its support for PHP in the cloud.”

    More info? www.phpbenelux.eu

    4 november 2009

    First Azure User Group Belgium (AZUG.be) meeting

    I’ll be doing an introductory session to Microsoft’s Azure platform. Yves Goeleven and Kurt Claeys will be showing off .NET services and provide more info on the AZUG.be. All of this followed by an open discussion.

    Register now on www.azug.be!

    24 november 2009

    MSDN Live Meeting (Dutch)

    Een ASP.NET-applicatie overbrengen naar Windows Azure
    “Zet alles over naar the cloud! Met Windows Azure kunt u voordeel halen uit de cloud computing-infrastructuur voor hosting, computing en storage van uw applicaties. De sessie bevat talrijke demo’s, we brengen een bestaande ASP.Net-applicatie over naar hosting in Windows Azure en maken gebruik van Windows Azure storage”

    More info on the MSDN pages!

    Looking forward to see you at one of these events!