<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/blogs/shared/nolsol.xsl"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>

<title>
BBC Internet Blog
 - 
Mat Hampson
</title>
<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/</link>
<description>Staff from the BBC&apos;s online and technology teams talk about BBC Online, BBC iPlayer, and the BBC&apos;s digital and mobile services. The blog is reactively moderated. Posts are normally closed for comment after three months. Your host is Eliza Kessler. </description>
<language>en</language>
<copyright>Copyright 2012</copyright>
<lastBuildDate>Wed, 30 Jun 2010 15:00:00 +0000</lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=4.33-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
	<title>The ins and outs of Barlesque</title>
	<description><![CDATA[<p>In the last few weeks you may have noticed an update to the design of the bbc.co.uk masthead, and I thought it might be interesting to tell everyone a bit more about how we're able to go about making a change like that across the entire site.</p>

<p>The reason this is complex (and therefore interesting) is because <a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2007/11/ten_years_of_bbccouk.html">bbc.co.uk has been going a long time</a>, and is produced by many different teams. As a result it's now hosted on several different server architectures, with <a href="http://news.bbc.co.uk">Journalism</a>, our messageboard system (aka <a href="https://bbcbreakingnews.pages.dev/dna/hub/A785298">DNA</a>), externally commissioned and hosted sites and our <a href="http://search.bbc.co.uk/search?q=search">search system</a> to name just a few, all using different <a href="http://en.wikipedia.org/wiki/Solution_stack">server stacks</a>.</p>

<p>To update content, like the masthead, on all these different stacks used to require making the change several times, on several systems. no longer however, because our page templating application, Barlesque, is now used by them all.</p>

<p><a href="/blogs/webdeveloper/2009/10/css-resets.shtml">Last time I posted on the blogs about Barlesque</a> I discussed a little of the early client side development work we did when designing it. Now I'd like to turn to the server side, specifically how we initially made it available to all the server stacks mentioned above, and also the challenges we've faced in the last 8 months migrating it to our new and shiny technical platform.</p>
]]><![CDATA[<h3>The core SSI system</h3>

<p>When we got the go ahead to redevelop the previous page templating system, Barley, the first place we needed to make the new system available was our core environment at www.bbc.co.uk. In 2007-8, this meant Apache, mod-include (aka <a href="http://httpd.apache.org/docs/1.3/howto/ssi.html">SSI</a>) and not much else. This gave us includes, variables, conditionals (including regular expressions) but no loops, arrays, functions, databases and so on. On the plus side it's as fast as a greased eel, so can be used on every page of the site without making our sys admin folk cry.</p>

<p>As a result the way developers use this interface to Barlesque is pretty trivial. First set some configuration variables, for example:</p>

<pre><code>&lt;!--#set var="blq-footer-colour" value="black" --&gt;</code></pre>

<p>Then include the head, masthead and footer includes in amongst the normal html, for example:</p>

<pre><code>&lt;!--#include virtual="/includes/blq/head.sssi" --&gt;</code></pre>

<p>And the <a href="https://bbcbreakingnews.pages.dev/includes/blq/include/help/getting_started/blank.shtml">new page is ready and waiting for content</a>.</p>

<p>But what if the site in question isn't on the www.bbc.co.uk architecture - like news stories, search results or one of the many externally-hosted sites the BBC commissions every year?</p>

<h3>The SSI webservice</h3>

<p>Actually, it was quite simple to bridge this gap - we just made three .shtml pages that used SSI to include the three parts of Barlesque (head, mast and foot) and let all the external sites call them in over http.</p>

<p>Then, thanks to an open source BBC Apache module called <a href="https://bbcbreakingnews.pages.dev/opensource/projects/apache/ssi_setsplitvars/docu.shtml">mod_setsplitvars</a> the webservice can be configured via the query string:</p>

<pre><code>www.bbc.co.uk/includes/blq/webservices/head.shtml?blq-foot-colour=black</code></pre><code></code>

<p>This query string interface also means the webservice response is cachable (with some the headers set using <a href="http://httpd.apache.org/docs/2.0/mod/mod_expires.html">mod_expires</a> to prove it), vital to ensure we didn't introduce cross dependency with the journalism stack in particular.</p>

<p>All good. Then the fun started.</p>

<h3>The new BBC Tech Platform</h3>

<p>Over 2008 our new server architecture was rolled out. Known internally as 'Forge', it's a fully dynamic architecture, with PHP, the <a href="http://framework.zend.com/docs/quickstart">Zend framework</a> and its <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> structure. This meant going and getting the webservice wasn't a problem for the early Forge-based sites like <a href="https://bbcbreakingnews.pages.dev/labuk/">Lab UK</a>, but it also meant it was a very appealing platform to be developing key products like Barlesque on. So 8 months ago we decided to move house.</p>

<p><a href="http://www.flickr.com/photos/mathampson/3866777267/" title="The ins and outs of Barlesque by MatHampson, on Flickr"><img src="http://farm4.static.flickr.com/3496/3866777267_469453d2c1_m.jpg" width="180" height="240" alt="The ins and outs of Barlesque" /></a></p>

<h3>The core Forge system</h3>

<p>The first step was to rewrite Barlesque on Forge (the bottom circle on that crazy spaghetti chart), which straight away has meant the code getting clearer and less hacky, and abstracting all those separate pan-site projects like the survey and the advertising system that got tangled up with Barlesque simply because SSI knew no better. Win.</p>

<p>We also took the opportunity to make some much needed tweaks to our variable naming - losing SSI's slightly rubbish manual namespacing, and my slightly rubbish Americanisms:</p>

<pre><code>var name="blq_footer_color"</code></pre><code></code>

<p>Becomes:</p>

<pre><code>$blq-&gt;footerColour;</code></pre><code></code>

<p>This did however leave us with two code bases, SSI and Forge, which proper programmers tell me is a Bad Thing, so...</p>

<h3>SSI stack interface on Forge</h3>

<p>...We had to find ways of migrating use of Barlesque on the SSI stack to Forge.</p>

<p>Unfortunately we couldn't realistically ask the last two years worth of sites released on the SSI stack to go back and update their Barlesque calls. Instead we built another simple layer that compiles all the SSI variables into a query string, using lots of not-very-sexy SSI like this:</p>

<pre><code>&lt;!--#if expr="$blq_footer_color" --&gt;
    &lt;!--#set var="blq_qs"
        value="${blq_qs}&amp;blq_footer_color=${blq_footer_color}" --&gt;
&lt;!--#endif --&gt;</code></pre><code></code>

<p>That query-strung request could then be proxied (again via a caching layer) to a new interface on Forge that mapped the SSI API values to the Forge ones. Once done, the existing SSI-based sites could be switched to Forge Barlesque without making any changes.</p>

<p>One neat trick here: We were able to collect the head, mast and foot content in a single call rather than three, by returning some html for the head, and two large SSI variables for the mast and the foot. A nice win.</p>

<p><a href="http://www.flickr.com/photos/mathampson/4483797356/" title="Keeping busy by MatHampson, on Flickr"><img src="http://farm5.static.flickr.com/4046/4483797356_c1923515b5.jpg" width="375" height="500" alt="Keeping busy" /></a></p>

<h3>The Forge webservice</h3>

<p>Finaly we migrated the SSI webservice to point at Forge. Not hard, just a proxy pass from SSI to a third Forge interface, and some <code>foreach($params as $key =&gt; $value){}</code> taking the place of setsplitvars.</p>

<p>All done.</p>

<p>Um. Actually not quite. Just for fun there's a fourth interface:</p>

<h3>Old Forge interface</h3>

<p>Remember I mentioned those early Forge sites, like Lab UK, that used the SSI webservice to get Barlesque off the old SSI stack? Well Barlesque just moved to Forge, so it would be a bit mad to still be going to the old servers to collect it, then being proxy-passed straight back. So we've rewritten that interface too, using the same configuration mapping array as the webservice and SSI interface to use Forge Barlesque directly.</p>

<p>Thus after 8 months we're finally back down to one codebase, and so we only had to write the new masthead once, and the same goes for all the exciting new features we have coming in the future too - heads up!</p>

<em>Mat Hampson was Senior Client Side Developer, BBC FM&T Intrernet Group.</em>]]></description>
         <dc:creator>Mat Hampson 
Mat Hampson
</dc:creator>
	<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2010/06/the_ins_and_outs_of_barlesque.html</link>
	<guid>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2010/06/the_ins_and_outs_of_barlesque.html</guid>
	<category>user experience &amp; design</category>
	<pubDate>Wed, 30 Jun 2010 15:00:00 +0000</pubDate>
</item>

<item>
	<title>From Barley To Barlesque</title>
	<description><![CDATA[<p><img alt="Feature from Private Eye's Birtspeak" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/barlesque_birtspeak.gif" width="430" height="337"></p>

<p>Hi - I'm Mat Hampson, the lead developer on a BBC project called Barlesque. (I know, I know: odd name. More about that later.)</p>

<p>This week, we've found the project featured in <a href="http://www.private-eye.co.uk/">Private Eye</a>'s Birtspeak 2.0 column <small>[Shurely shome mishtake - ed]</small> which, in case you're not familiar with it, is the regular column where Private Eye casts its satirical spotlight on a jargon-filled missive or announcement from the BBC.</p>

<p>Having read the Eye for years, being on the receiving end has been fun. Aside from impressing our mums by appearing in the national press, it's also demonstrated <a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2008/01/private_eye_1.html">again</a> how a paragraph that makes perfect sense to those of us making the product can look like gobbledegook to everyone else. Anyway, we thought it might be useful to offer up a translation, and perhaps explain a little bit about Barlesque along the way. </p>

<p>First, the email snippet in question:</p>

<blockquote>As you may be aware from the Barlesque mailing list, on May the 13th we are going to roll out a change to the Barley implementation used by DNA services in order to align it with the new global visual language being used across bbc.co.uk. This change will be carried out by the DNA team and will require no work on your part... See the attached PDF for details of the change ['Barley toolbar update - aligning legacy UK toolbars with the new visual language standard'].</blockquote>

<p>All clear? Well, we think so...</p>

<p><img alt="explore the bbc" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/explore_the_bbc.png" width="169" height="49">Barlesque is bbc.co.uk's new web page layout system. Without getting too technical and boring everyone to death (I'll save that for a post in our forthcoming developer blog), that means the masthead at the top, the footer at the bottom and some of the underlying setup of every new page appearing on the site, for example <a href="https://bbcbreakingnews.pages.dev/doctorwho/">on the new Doctor Who site</a>.</p>

<p><img alt="explore the bbc expanded" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/explore_the_bbc_expanded.png" width="430" height="128"></p>

<p>Barlesque replaces a system called Barley<sup>*</sup> (hence is Barley-esque - aha), which was designed and built just after the millennium and is used on hundreds of sites, including this one. Barley was a great product for its time, but it uses some really outdated technology. (<a href="http://en.wikipedia.org/wiki/Internet_Explorer_3">IE3</a> support? <a href="http://en.wikipedia.org/wiki/Table_%28HTML%29#Tables">Table</a> layouts? Nowadays that's comparable to using wattle and daub to build a house.)</p>

<p><img alt="bbc_toolbar_progression.png" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/bbc_toolbar_progression.png" width="430" height="50"></p>

<p>Another thing Barley does is use technological restriction to enforce consistency of design <small>[Still with us? - Ed]</small>: the page content is nestled inside a big HTML table with a limited set of widths, the navigation has a particular structure to its HTML, and so on. One of the main lessons learned since (as taught to me by <a href="http://www.paulhammond.org/">Paul Hammond</a>, its original lead developer) is that if you try to restrict designs like this, they will find new and unintended ways round your roadblocks - "Nature finds a way" as <a href="http://www.imdb.com/title/tt0107290/quotes#qt0244915">Jurassic Park so nearly says</a>.</p>

<p>And that's exactly what happened to Barley: In updating it last week (to make it more visually consistent with Barlesque), we've counted literally dozens of variants and half-copies of Barley that sites have been forced to make over the years (including one on our <a href="https://bbcbreakingnews.pages.dev/dna/hub/A785298">DNA platform</a><sup>**</sup> to which the Birtspeak column refers). </p>

<p>This causes a huge maintenance headache for us techies, so when the UXD (User Experience and Design) team devised a new <a href="http://en.wikipedia.org/wiki/Visual_language">"visual language"</a> for bbc.co.uk (<a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2008/04/news_and_sports_website_refres_1.html">as discussed when the News and Sport redesign launched</a>), we set out to build Barlesque to be as simple and flexible as possible in its implementation.</p>

<p>We launched the first version two months ago, and, while we're still improving it, it already includes:<ul><br />
<li><a href="http://validator.w3.org/">Valid</a>, <a href="http://en.wikipedia.org/wiki/Semantic_Web">semantic</a> <a href="http://en.wikipedia.org/wiki/XHTML">XHTML</a> and <a href="http://en.wikipedia.org/wiki/CSS">CSS</a> - so it contains less code and is more accessible than its predecessor.</li> <br />
<li>Support for many languages, useful behind the scenes technical tools and visual customisations. (Teal-coloured navigation? <a href="https://bbcbreakingnews.pages.dev/programmes/">No problem</a>. White footer? <a href="https://bbcbreakingnews.pages.dev/white/">Sure.</a>) That said, it also has...</li><br />
<li>A shallow learning curve for developers, since it works off-the-shelf, with none of the  display configuration set up.</li><br />
<li>Easy implementation for Indies (the source of many of the Barley variants) since it only requires one line adding to the Apache configuration to get going. </li><br />
<li>Finally, the ability to deliver other pan-bbc.co.uk systems, such as user authentication, and surveys, which in turn makes them easier to implement and maintain too.</li></ul> </p>

<p>Bundle this all together, and we think that Barlesque effectively removes the need for sites to make their own copies of the layout system. That means greater technical and visual consistency, quicker updates, and best of all, frees up precious developer time to work on more exciting things! </p>

<p>At least, that's the plan - watch this space.</p>

<p><sup>*</sup> <small>And as for Barley, that was named after a character from <a href="https://bbcbreakingnews.pages.dev/bbcfour/features/screen-wipe.shtml">Charlie Brooker</a>'s <a href="http://en.wikipedia.org/wiki/Not_safe_for_work">NSFW</a> spoof listings magazine TV Go Home, which gave rise to a Channel 4 sitcom called... <a href="http://www.channel4.com/entertainment/tv/microsites/N/nathanbarley/index.html">Nathan Barley</a>.</small></p>

<p><sup>**</sup> <small><a href="https://bbcbreakingnews.pages.dev/dna/hub/A785298">DNA</a> is the system we use to power <a href="https://bbcbreakingnews.pages.dev/messageboards/newguide/">our messageboards</a> and several of the BBC's other community-based sites like <a href="https://bbcbreakingnews.pages.dev/dna/h2g2/">H2G2</a>; the names DNA and H2G2 are derived from <a href="http://news.bbc.co.uk/1/hi/uk/1334092.stm">a British writer and one of his creations</a>.</small></p>

<p><em>Mat Hampson is Senior Client Side Developer, BBC FM&T Intrernet Group.</em></p>]]></description>
         <dc:creator>Mat Hampson 
Mat Hampson
</dc:creator>
	<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2008/05/barlesque.html</link>
	<guid>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2008/05/barlesque.html</guid>
	<category>user experience &amp; design</category>
	<pubDate>Tue, 20 May 2008 19:00:31 +0000</pubDate>
</item>


</channel>
</rss>

 
