CakeFest Manchester UK 2012 – Conference Notes

I will be writing as the event occurs and this post will be updated till the end of the conference. Notes, info, cool stuff, trolling, whatever I can add it here about the conference and the topics discussed, I will. The roll starts now!

For conference info and details go to: CakeFest.org

The second part of this post is at: https://mcloide.wordpress.com/2012/09/02/cakefest-2012-conferences-day-summary-round-2/

Keynote Speech with Mark Story

  • Started with some thank-you’s and sponsor thanking
  • 3.0 roadmap is now on talks
  • there is live streaming on this so give a check on cakefest.org for more details
  • next starts a Microsoft presentation with Mark Brown

Hell has frozen over with Mark Brown

  • Windows Azure cloud platform
  • Cloud computing patterns -> on and off -> growing fast -> unpredictable bursting and predictable bursting.
  • 3 Flavors of cloud: SaaS (software as service) -> PaaS (platform as service) -> IaaS (infrastructure as service)
  • Some quick looks on the Windows Azure
    • Virtual Machine (Windows and Linux – including Ubuntu and Suse)
    • All environments they provide a persistent storage called Blob Storage which is the same as the S3 from Amazon
    • Geo and data replication
    • Windows Azure Web Sites is a service for smaller sites that doesn’t need to make full use of cloud computing – a good think that it has integration with Git. Having Git to deploy is a plus for sure. The way they control the server from shared to reserved takes out the need of OPS knowledge to small business
    • The cloud service users PaaS platform and automatically adds a load balancer once the application is deployed. Right now it also has support for several languages. It has most of the necessary services for cloud apps that you would have in different places (they are giving 3 months for free on www.windowsazure.com)

Making the Most of 2.2 with Mark Story and Jose Lorenzo

  • In less than a year of the release of CakePHP 2.0 it has already 20 releases up to CakePHP 2.3
  • releases focused on developers real issues on everyday programming and the focus on the upgrades issues that had with the previous versions of cake
  • view blocks comes to solve the issue of the multiple use of the elements. Inspired on Jinja/Twig and allows you to create blocks in layouts or parent templates and replaces the annoying $scrips_for_layouts and $content_for_layouts. The best you can add conditions using the blocks to render a given block or a given piece of block (there is a nice example on his presentation, if released, I will add it here)
  • if you fetch a block that does not exists it will return an empty string
  • json and xml view files are now not necessary; there is a class that you can easily serialize the json or xml content. It also works with the RequestHandler Component.
  • Hash Class – xpath cant be translated to arrays. It implements about 90% of the Set’s API with a consistent signature and it gave about 1.6x times faster response from the extract(); The api for the hash extract now is more consistent so the methods calls will have the same way to construct
  • caketime and cakenumber were improved – now you can use them on the controllers / models by importing the class and caketime have now a new parameter to pass the timezone. Boolean checks on caketime and the format numbering from cakenumber is a great thing to check (example: the isToday function)
  • Logging api now support scopes (similar to Phyton) – a fun thing is that if all the configs are wrong, in worst case it will drop the messages for dev/null
  • Event manager (fun) – behaviors, helpers, components merged into a generic system. The idea is that a object calls an event that will have listeners to work with it (for example the well known beforeRender). The good thing is that you can now, create your own events like a Paypal.afterProcess event. With that you can create a number of listeners that can process the rest of the actions leaving a plugin free  of any external concerns.
  • Dispatchers were build to fit in that middle layer that is not fit for a component / plugin, etc. It uses the events, and the idea comes from the Racks from Ruby. A great use for this is to use the beforeDispatch to automatically render a cache check or to cache data.
  • HTTP Caching is now simpler to control and use common headers to browser / cdn and reverse proxy cache (a bunch of more detail on the cake response api)
  • Cache now has a key that points to a config. The element can use that cache and you can clear the whole group on the controller. The cache will be clear on all engines (memcache, file, redis, etc).
  • Model validations became simpler

OK COFFEE BREAK

  • 2 cups of joe and now I’m good to go

Flexible site Structure with CakePHP with Andy Gale

An interesting idea of how structuring the site to use the tree behavior from cakephp to place the content. It is a nice process to be used on sites that have to store and render large amounts of static html blocks (like a magazine, tv or a large cms site).

  • the whole site is structured as lists in a tree format
  • backend updates lists constantly
  • content on the db means that caching control is vital

PHP 5.4 Features you will actually use with Lorna Mitchel

  • As a fair point there is also another very good presentation that is going on now – Building Restfull apis, but since I can’t be on 2 places at same time … slides reading later
  • New features
    • traits (awesome)
    • built-in webserver
    • new array syntax and dereferencing
    • removed the nonsense (lol)
  • The new array syntax is much more fun, looks like json declaration for an array. The array dereferencing you can access an element from the array directly from the function call
  • php 5.4 is faster – benchmark just by upgrading the php 5.3 to 5.4 on your webservers. Object instantiating and garbage collection are quite faster now and this should improve considerably your app just by the upgrade.
  • On her blog has the results of the benchmark she did, the difference from 5.2 to 5.3 is considerable, so if you aren’t on 5.3 move to 5.4 now that compared to 5.2 is insane faster
  • php 5.4 is full of traits – oh wait traits is the feature and I love it 🙂
  • Trait: allows you to put a shared method into a trait and that same method can be used in several classes. It is great because PHP has a single parent so if the piece of code needed to be used in 2 distinct classes that weren’t related, it would need to be duplicated (more work). Using traits solves this issue and set to 1 the point of maintaining a common code. Some features from traits:
    • abstract methods
    • aliases
    • properties
    • rules to resolving naming clases
  • php 5.4 webserver should be used to development only – this message was also enforced by Rasmus on his presentation of php 5.4. Still pretty fun and simple of how to call the php webserver on your local
  • typehint on classes, interfaces, arrays and callable
    ( $ping = function() { return 'hello'; }; echo $ping(); )
  • Need to be smart while using the callable typehint, as any other, not passing a callable type on a function will throw warnings. It will, for instance, accept an object as a callable as long as it uses the __invoke() method on it
  • JsonSerializable interface can be used on a object and you can set or unset what is supposed to be be serialized on the object
  • Notes on removed features (or nonsense):
    • register globals
    • register long arrays
    • safe mode
    • magic quotes
    • allow call time pass reference
    • y2k compliance (lol I love the story behind this…)
    • ereg* functions (in another words, check for the code for ereg_matches, etc, and update them – they were already deprecated but you can still have some third party code that makes use of)
  • advise on using the E_DEPRECATED in PHP 5.3 to point out what will be removed from 5.4

@LUNCH

Random Tips with Mariano Iglesias

  • @jrbasso is on 0mq with cakephp from Jose Lorenzo conference so I will bother him for info on that
  • use git – if you are using svn, you are nuts (I agree totally)
  • master branch should be 100% pushable
  • feature branches like there is no tomorrow
  • code reviews (not my favorite on both reviewing and be reviewed) but extremely necessary
  • use Monit to monitoring low level stuff on your servers, track PHP logs in a less expensive way than new relic and most importantly be pre-emptive with your actions (what to do when the server goes down)
    • you can use monit to keep the server alive – for example, a simple tool to check a port and restart the server given the process
    • the idea is very simple, monit check every cycle and you define the rules of what to do in a case of an event
  • use Ducksboard – they offer a lot of integration with several services so you can have all your tools in one single place.
  • for real time statistics use Statsd. Build on node.js and very simple to integrate with php
  • Google Analytics – this one talks by itself but keep an eye for:
    • tracking (force urls)
    • conversions (get paths)
    • real time
    • A/B testing of everything (front end)
  • Varnish
    • improves speed (for amazon 1 milisecond gain is 1000000 gain in sales)
    • home page ans sign-up should be super fast
    • caching rules on urls
    • ideal for non registered content
    • cache invalidation from php through socket
  • Parse incoming email – avoid making the user to go to your website to reply to your request.
    • message id on the header: notification+12345@mcloide.com
    • Sendgrid hits your server on each reply and you can configure sendgrid to use cakephp action to parse the message. The work will be on parsing the message / files.
    • avoid sending emails to bounces
  • Real time notifications
    • it is not weird science – facebook does it
    • PHP (gearman) to Redis pub/sub
    • Redis to Node.js
    • Client interation with Node.js through Socket.io
    • socket.iso channels (per user hash)
    • 99% of it is javascript
    • try to get the notifications outside of the webserver – make it part of the client
  • Sphinx (or any other search engine) – searching with MySQL is not advisable – faster searches and real time indexing (the real time indexing is still in beta so there are catches)

App-ify your websites with Cordova (PhoneGap)

  • Apache Cordova
  • Webview (the link within the app) – Cordova uses the webview to create the app
  • goal is to keep the web app, aslo mobile app-ish and not a simple web-site in phone
  • Approaches
    • consume json feeds using ajax
    • use iFrame and inject content (please no!)
    • consume rendered pages
  • on the case study the app was fully built with javascript and almost no framework aside Backbone.js – a good point on this case study is since the app was fully css + javascript, aside the challenges on self-updating the javascript and css, the app could be fully tested in the browser
  • PhoneGap has an api with most of the basics already pre-set (like compass, camera, events, notifications, storage, etc). The event types are pretty readable and simple so you can easily use them to build your app
  • Appcelerator Titanium – has its pros and cons, but the big con is where part of code is going so you can maintain.
  • aside note I like the documentation a lot from PhoneGap

Migrating from CakePHP 1.x to 2.x (CandyCane)

  • just got on the end of this presentation, but I loved the quote bellow:
  • migration from 2.x from 1.x is painful but it comes with a great feature – profit over 1.x

Q.A. with CakePHP core devs

This is not actually a presentation so if something interesting comes out, I will add it here.

  • “people ask questions and we try to make answers” -> lol
  •  html5 offline – careful with browsers and application cache
  • good question why the heck debug kit is apart from core? -> response: try to keep the core as cleaner as possible and by keeping it separate the release cycles can be separate.
  • will have a micro framework from cake? possible yes. It will just not be named cupcake (name already taken) and will not be released soon
  • plans for cake 3.0:
    • move to php 5.4
    • reinvent of the model system
    • routing logic and config improvements
    • a lot of effort to ensure a smooth migration process, but keep in mind that the model layer that is the center of the application and it will probably be affected during the migration
    • more db drivers
    • new query finder process
    •  a model class to represent the table and a model to represent the rows – giving more flexibility
    • will try to make more use of the PHP 5.4 features (like traits)
    • more can be found on the group cakephp/core
  • Support natively on CakePHP for document databases like Mongo -> not predicted at the moment but if anyone want’s to contribute on the core and maintain it, yes, why not

Lightening Talks

Wont be able to note it all since I will also be speaking (about code reviews), but will add what I can after or before the talk

So far:

  • how to use vim in 5 minutes (lol) – good idea, copy someone’s vim style so you don’t go on the trouble of having to configure it all yourself
  • how to work on your underwear and make money – about freelancing (things that can wrong or right and some tips)
  • framework wars
  • cakephp interpreter (pretty fun the trolling with @jose_zap) – but the plugin is on github: cake-interactive-shell
  • deploying on orchestra
  • code review, man I need a beer right now and I spoke amazingly fast, but in resume it goes as: if you don’t do code review or don’t use any tool to code review, you should do it.
  • sometimes it is not implemented
  • 10 commandments for building a webservice
  • tips for high traffic sites

After this huge post from Day 1, the day is done, the whole conference was fun. For tomorrow new post.

Advertisements

About mcloide

Making things simpler, just check: http://www.mcloide.com View all posts by mcloide

5 responses to “CakeFest Manchester UK 2012 – Conference Notes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: