Skip to content

Feed aggregator

Visionary Leadership: How To Be a Visionary Leader (Or at Least Look Like One)

J.D. Meier's Blog - Mon, 06/08/2015 - 16:41

“Remember this: Anticipation is the ultimate power. Losers react; leaders anticipate.” – Tony Robbins

Have you ever noticed how some leaders have a knack for "the art of the possible" and for making it relevant to the current landscape?

They are Visionary Leaders and they practice Visionary Leadership.

Visionary Leaders inspire us and show us how we can change the world, at least our slice of it, and create the change we want to be.

Visionary Leaders see things early and they connect the dots.

Visionary Leaders luck their way into the future.  They practice looking ahead for what's pertinent and what's probable.

Visionary Leaders also practice telling stories.  They tell stories of the future and how all the dots connect in a meaningful way.

And they put those stories of the future into context.  They don't tell disjointed stories, or focus on flavor-of-the-month fads.  That's what Trend Hoppers do.

Instead, Visionary Leaders focus on meaningful trends and insights that will play a role in shaping the future in a relevant way.

Visionary leaders tell us compelling stories of the future in a way that motivates us to take action and to make the most of what's coming our way.

Historians, on the other hand, tell us compelling stories of the past.

They excite us with stories about how we've "been there, and done that."

By contrast, Visionary Leaders win our hearts and minds with "the art of the possible" and inspire us to co-create the future, and to use future insights to own our destiny.

And Followers, well, they follow.

Not because they don't see some things coming.  But because they don't see things early enough, and they don't turn what they see into well-developed stories with coherence.

If you want to build your capacity for vision and develop your skills as a Visionary Leader, start to pay attention to signs of the future and connect the dots in a meaningful way.

With great practice, comes great progress, and progressing even a little in Visionary Leadership can make a world of difference for you and those around you.

You Might Also Like

7 Metaphors for Leadership Transformation

10 Free Leadership Skills for Work and Life

10 Leadership Ideas to Improve Your Influence and Impact

Emotional Intelligence is a Key Leadership Skill

Integrating Generalist

Categories: Blogs

#NoEstimates

Scrum Expert - Mon, 06/08/2015 - 16:00
Estimates are part of our daily live. Every single day we ask and answer questions like: “when will it be done?”, “how much does it cost?” and use that “data” to plan the future of our projects. Some of us using rigorously formalised processes with heaps of Excel sheets, some applying more agile methods like planning poker. While doing that, we do not realise how estimates could be harmful! #NoEstimates is about exploring alternative ways of planning our work, of assigning value to features and a different approach about what we ...
Categories: Communities

On Human Capital – HR and Agile

Agile For All - Bob Hartman - Mon, 06/08/2015 - 15:17
Human capital business diagram management strategy concept chart illustration

Human capital business diagram management strategy

What is Human Capital? 

Human capital is just one of an organisation’s intangible assets. It is basically all of the competencies and commitment of the people within an organization i.e. their skills, experience, potential and capacity. Other examples of intangible assets include: brand, software, design, working methods and customer relationships. The human capital asset captures all the people oriented capabilities we need for a business to be successful.

It’s important to remember, however, that individuals are only an asset insofar as they choose to invest their human capital in an organization, which should be encouraged by leadership…

Some people find the term Human Capital somewhat mechanistic, but human capital is not about describing people as economic units (like calling people “resources”), rather it is a way of viewing people as critical contributors to an organization’s success. This then throws the spotlight on how businesses invest in their human capital asset, in order for it to add value. For any commercial organisation, this is an important component to understand. If a company understands how its human capital contributes to their business success, it can then be measured and managed more effectively.

Human capital management is a reciprocal relationship between supply and demand: employees, contractors and consultants invest their own human capital into business enterprises and the business enterprises need to manage the supplier. Any organisation interested in its performance will naturally ask how well they are managing this asset to ensure maximum return on their investment. In the same way, all employees, contractors, consultants and providers of human capital want to ensure they are getting the appropriate return for their own human capital investing through salary, bonuses, benefits, and so on.

Understanding how and why people add value or not to an organisation is an important, and difficult, management skill for the 21st century.

Why is Human Capital an increasingly important issue? 

Human capital has never been more critical to competitiveness, because the world has changed. Over the last 20 years we have witnessed a revolution in the workforce, as well as in the workplace.

The Workplace 

Increasingly the developed world has evolved into a service and information economy. In an information economy, people are the critical asset and in a service economy many more outputs are intangible, as much as 80 per cent of a company’s worth is now tied to its people. Access to financial capital is no longer a source of competitive advantage; our competitiveness increasingly derives from know-how, or people’s abilities, skills and competence.

People, the human capital asset, with the right profile and capability provide an advantage, which is not easily replicated by competitors.

The Workforce 

At the same time, the labour force has also changed dramatically. Organisations know they need people to deliver value in new and different ways, and that those people they depend on have changed. For example, we see an aging, more diverse population, with more women entering the workforce, more dual-earner couples. However businesses can still struggle with a general shortage of the skills required in a service and information economy.

The war for talent in the human capital market place means businesses can’t take for granted that individuals will want to invest their own human capital in an organisation. Elements, other than traditional pay and job security, need to be put in place to attract and retain top talent.

These changes have culminated to ensure that human capital is becoming a major driver for organizational performance.

Forty-six per cent of Chief Executives say that finding good people and keeping them is their single biggest worry and most fear their employees are ill-equipped in terms of skills. The investment community is now probing human capital issues, yet most Chief Finance Officers say they have only a moderate understanding of the returns they get from what is often their largest single investment – people. Human capital then is a critical contributor to competitive advantage.

What is the challenge for organizations? 

Human capital may well now be the most critical source of competitive advantage, but it is also the most difficult to measure. If people are a company’s greatest asset, how do we quantify the value of this asset?

The phrase ‘our people are our greatest asset’ has become a tired cliché around which real cynicism has justifiably been created. The cynicism is based on the gap between what a business says and what it does. If an organization can’t prove that its people are its greatest asset, then it isn’t being measured and it can’t really be managed.

The quantifiable evaluation of human capital is a challenge and there is currently no accepted way of doing this. There is no single measure, independent of context, which can describe the impact of employee competencies and commitment on business performance. There are reliable methods for measuring the return on investment on physical capital, but not for human capital; it’s a new and evolving science.

Causality is the issue; it is very difficult to prove links between ‘cause’ and ‘effect’ in a complex working and social environment. Assigning causality is a challenge because a business context is a very different social environment, e.g. is customer satisfaction really improved because employee retention has improved, or is it because that business invested in better technology and improved their product? Is an organisation getting discretionary effort from its people because they have been allowed flexible working, or because they are being paid more than competitors’ offers, or even a mixture of both?

Correlations are not the same as causality either. The challenge for most organizations is that if the value of human capital can’t be quantified, where and how do they make the best investment in their asset, and how do they know what the return on that investment will be?

What does this mean for HR? 

The pressure on HR functions to perform is greater than ever because of the critical role human capital plays in an organization’s wealth, success and competitiveness today. If the role of HR is to optimize ‘people performance’ then businesses need to ask what ‘good’ HR looks like for their organization.

Increasingly it’s understood that a good HR function can add significant value and make a real contribution to an organisation’s performance, however looking at HR through a human capital lens puts further demands on the function. HR needs to make causal connections clear between their practices and business value. This means moving from describing good HR practice to proving it.

For decades HR has wanted greater legitimacy for their role; often without a seat at the top table. With human capital now being such a source of competitive advantage, the door is open for HR to bring to the table the value they have for many years been espousing.

But how do they do this?

The HR paradigm shift with Agile

If we accept human capital is one of the key assets driving creation of value, then HR is not a cost centre but an asset provider. It is a function that enables businesses to manage people better than other companies, but to prove this, HR needs to change its approach quite fundamentally, and we’ve been fortunate to touch on HR within Agile transformations, but it is only the beginning!

Most HR functions are on this route, in some form or other, already:

  • Moving from efficiency to effectiveness
  • Moving from cost to value-add
  • Moving from inputs to outputs
  • Moving from data collection to data analysis
  • Moving from traditional HR data to linking it to operational performance

Having this intelligence informs our answer to the question of what HR should be doing in order to deliver business impact.

Linking HR practice and individual or organisational performance is therefore at the heart of what HR needs to do so it can identify how HR policies translate into performance. As a minimum, HR should have reliable data in conventional areas, such as churn, absence, labor costs, time and costs of recruiting, etc but they must also have access to performance measures, such as production figures, sales targets, service level agreements and be able to make links between the two.

Increasing the capability of HR to deliver more commercially will be the key to demonstrating how HR can really add-value to an organisation.

What does this mean for Finance Directors and the CEO? 

The gap between a company’s tangible assets and its stock market value is growing. For many businesses the tangible assets on the balance sheet represent a small part of their stock market valuation or the value to a potential acquirer. In most organizations, reporting and evaluation of human capital is non-existent. As the world has changed and human capital has become more critical to competitiveness, it has exposed the limitations of traditional accounting practices in being able to identify the real value-adding components of an organisation. The issue is, if we don’t know how to measure intangible assets, how do we know whether to invest, or how much?

How do we link investment in the following areas to business performance?

  • Induction
  • Skills and technical training
  • Management training
  • Organizational roles
  • Process design
  • Workforce planning
  • Reward management
  • Retention management
  • Employee feedback
  • Performance management, etc

We know the evaluation and measurement of human capital is difficult and that it’s an evolving science, but for most Finance Directors, understanding the performance of their human capital investments is extremely weak compared to their understanding of any other asset in their business.

Many finance professionals see people as an operating cost, not as a source of value creation. They also then treat all expenditure on human capital as a cost to be minimized, as opposed to a cost that can be optimized. Without the measures and links, however, it is hard to know how to do the latter and who in the business is responsible for that: HR; Finance; or both?

There is also a difference between internal and external reporting. Increasingly, externally a company will be assessed on the basis of the amount of information it can provide about its internal labor market and how well that market serves its business objectives. External human capital reporting required of organisations today is still limited and is largely narrative, but this may well change.

The real challenge is how to move along the continuum, using HR analytics, to deliver a picture of how human capital investments create business value. To move from generating HR information, to reporting human capital and then measuring that asset, so it can be understood and used best.

Agile is more than just for the “product-building” or “service-building” aspects of a business.

It must holistically include the human-side. We invite you to dive deeper into these ideas as you go on your Agile journey.

The post On Human Capital – HR and Agile appeared first on Agile For All.

Categories: Blogs

Organize an Agile Release Train in SAFe

TV Agile - Mon, 06/08/2015 - 14:45
Dean Leffingwell discusses implementing the agile release train, which is the primary value delivery vehicle inside the scaled agile framework. Watch this video on http://www.informit.com/articles/article.aspx?p=2339657
Categories: Blogs

The piano analogy: some practice required

Thought Nursery - Jeffrey Fredrick - Sun, 06/07/2015 - 19:10

This year I’m training people in the theories of Chris Argyris, helping them to apply the concepts, and this raised some fun challenges. The challenge on my mind today is how to convince people that practice will be required before they can perform well? My current analogy is the piano.

After a quick search I can show you a three minute video of a 14-year old explaining how a grand piano works. If you’ve got an extra minute I could share a four minute animation that illustrates the mechanism in detail. You probably already know that in a piano the strings vibrate and that produces the sounds you hear. It would take moments to strike each key and allow you to hear each note. Having invested less than thirty minutes you could understand a piano and how it works. You can’t play it, but you know you can’t play it. You were unlikely to have mistaken understanding the concepts for being able to produce the result.

Action Science seems different.

I’ve introduced dozens of people to the topic through Roger Schwartz’s excellent Eight Behaviours for Smarter Teams, a sort of Shu-level guide to producing Mutual Learning behaviour. The response is typically positive, enthusiastic even, and general  agreement they should start behaving in a mutual learning way. However they also believe that now they understand mutual learning behaviour they can also produce mutual learning behaviour. They mistake understanding the concepts with being able to produce the result. Worse, their own incompetence makes them blind to their lack of skill.

So this is where the piano analogy comes into play. Everyone acknowledges the gap between understanding and performance. I use the piano analogy to set the expectation that practice will be required. Then we begin using the two-column case study to start retraining their ear, allowing them to begin hearing the difference between Model 1 and Model 2 behaviour for the first time. And when someone is discouraged by their performance, the analogy is there again to help them have realistic expectations: “How long have you been practicing the mutual learning approach? How long do you think it should take to retrain from a lifetime of habit and cultural norms?”

Do you have a technique you use to help set expectations for skill acquisition and maintaining motivation? If so I’d love to hear about it in the comments or on Twitter.

Categories: Blogs

No, I didn’t invent the Spotify model

Henrik Kniberg's blog - Sun, 06/07/2015 - 07:24

You know the saying “don’t shoot the messenger”? Well, that goes both ways – “don’t praise the messenger”. Well, OK, you can shoot or praise the messenger for the quality of the delivery – but not for the message content!

I’ve spent a few years working with Spotify and published a few things that have gained a surprizing amount of attention – especially the scaling agile article and spotify engineering culture video. This has come to be known as the “Spotify Model” in the agile world, although it wasn’t actually intended to be a generic framework or “model” at all. it’s just an example of how one company works. The reason why I shared this material is because my Spotify colleagues encouraged me to, and because, well, that’s what I do – help companies improve, by learning stuff and spreading knowledge.

Spotify engineering culture


Since then, many companies have been “copying” the Spotify model, which I found rather scary at first. But now I’ve met quite a number of those companies (and heard back from even more), and so far I have yet to see a case where a company ended up in a worse position than where they were. In fact, some have seen some huge improvements! Pretty surprising actually. So apparently, yes, companies can copy models from each other, and it can sometimes be helpful – mainly because it’s almost always valuable to look at your own organization and process with a critical eye, and take inspiration from others. As long as you adapt to your local context (which most do, eventually).

So, back to the messenger thing.

I’ve noticed, via various blogs and articles and presentations, that people sometimes seem to make the assumption that I invented the Spotify model. Well, I most certainly didn’t! I’m just the messenger. Everything I do at Spotify (and other clients) is collaborative. As coach and mentor I have no formal authority, so I have to work with and through other people. The Spotify model is the result of a lot of people collaborating and experimenting over time, and many aspects of the model were invented without my involvement at all. I certainly wouldn’t want to take credit from the people involved.

So, if you see or hear anyone making the claim that I invented the model, please point out that I didn’t, and refer them to this blog if there are any doubts.

Thanks!

/Henrik

Categories: Blogs

140 is the new 17

lizkeogh.com - Elizabeth Keogh - Sat, 06/06/2015 - 17:49
I took a break from Twitter.

A while back, I ran a series of talks on Respect for People. I talked about systems which encourage respect being those which are constrained or focused, transparent, and forgiving. I also outlined one system which had none of those, and would therefore have a tendency towards disrespect: Twitter.

Twitter is unforgiving, because it’s public. It isn’t transparent; 140 characters isn’t enough to even get a hint of motivation. It isn’t constrained, except by its 140 characters. And, in a week in which a lot of stuff happened offline, followed by yet another Twitter conversation that left me wondering why I bothered, I had enough.

I decided to take a break to work out what it was I actually valued about Twitter, and why I kept coming back to it, even though I knew it was the system at fault, not the people.

I worked it out. I know, now, what it is I’m looking for. And the best way to explain it is to look to a similarly constrained system: the Haikai no Renga.

I want more Haikai no Renga.

Back in the old days, the Japanese used to get together and have dinner parties.

At these dinner parties, they had a game they played. Do you remember those childhood games where one person would write a line of a story, then the next person would write a line then fold it over, then the next person, so they could only see the line that came before? And then, when the whole story unfolds, there are usually enough coincidences and ridiculousness to make everyone laugh?

This game was a bit like that, but it always started with a poem; and the poem was usually 17 syllables long, arranged as lines of 5, 7, 5 syllables.

Then the next person would add to the poem. Their addition would be 7, 7. The two verses, together, form a tanka. Then the next person would add a 5, 7, 5; and the next a 7, 7, and so on. The poem would grow and change from its original context, and everyone would laugh and have a good time.

This game became so popular that the people who were good at starting the game got called on for their first verse a lot, so they started collecting those verses. Finally, one guy called Shiki realised that those first verses were themselves an art form, and he coined the term haiku, being a portmanteau pun on the haikai no renga, meaning a humorous linked poem, and hokku, meaning first.

In Japanese, haiku work really well with 17 syllables; but in English I think they actually work better with about 13 to 15. That’s because there are aspects of haiku which are far more important than the syllable count.

There’s a word which sets some context, usually seasonal, called the kigo.  More important than that, though, is the kireji, or cutting word. This word juxtaposes two different concepts within those three short lines, and shows how they’re related. We sometimes show it in English with a bit of punctuation.

The important thing about the concepts is that they should be a little discordant. There should be context missing. The human brain is fantastic at creating relationships and seeing patterns, and it fills in that missing context for itself, creating something called the haiku moment.

My favourite example of this came from someone called Michael in one of my early workshops:

hot air
rushing past my face –
mind the gap!

(Michael, if you’re out there, please let me know your surname as I use this all the time and would like to credit you properly.)

If you live in London like I do, having a poem like that, with the subject matter outlined but not filled in, can make you feel suddenly as if you’re right there on the platform edge with the train coming in. You make the poem. It’s the same phenomenon that causes the scenes in books to be so much better than the movies; because your involvement in creating them really makes them come to life.

But because there’s not enough context, and because one person’s interpretation can differ from another, the haikai no renga changes. It moves from one subject to another. It can be surprising. It can be funny. It can be joyful. Each verse builds on what’s come before, and takes it into a new place.

Haikai no Renga is a bit like the “Yes, and…” game.

In the “Yes, and…” improv game, each person builds on what the person before has said.

There was a man who lived in a house with a green door.
Yes, and the door knocker was haunted.
Yes, and it was the ghost of a cat who used to live there.
Yes, and…

In the “Yes, and…” game, nobody calls out the person before. Nobody says, “Wait a moment! How can a door knocker be haunted? That makes no sense!”

Instead, they run with the ridiculousness. They make it into something playful, and carry it on, and gradually the sense emerges.

They don’t say, “No. You’re wrong. Stop.” They say, “Hah, that’s funny. Let’s run with that and see where it takes us.”

If people were to play this game on Twitter, they might do it by making requests for more details. “Yes, and what was it haunted by?” “Yes, and did the man own the cat?”

Or they might provide resources to enlightening information. “Yes, and have you read the stats on door knocker hauntings? .” “Yes, and do you remember that film where the door knockers spoke in riddles?”

Or they might just add another line, and see where it leads.

It starts with a Haiku.

Like the “Yes, and…” game, and like Improv, the haiku which kicks off the haikai no renga has to be an offer; something that the other players or poets can actually play on.

If a haiku were insulting to the other poets, or had some offensive content, then I imagine the poets wouldn’t play, and probably quite rightly you’d get an argument instead of a poem. Equally, though, if the haiku is too perfect, and too complete, then there’s no room for interpretation. There’s no room for other poets to look good, then make their own offers.

And this is where I think I can make a change to the way I’m using Twitter. If I state something as if it’s a fact, or I don’t leave the right kind of opening for conversation, then I won’t get the renga I’m looking for. It doesn’t even matter whether it’s true or not, or whether there’s context missing that other people don’t know about, or whether it’s a quote from someone else; if it’s not an offer, I won’t get the renga. If I’m writing something to make myself, or one of my friends, look knowledgeable and wise, I won’t get the renga. If I’m being defensive, I won’t get the renga. If I’m engaging someone who obviously doesn’t want the renga, well, then I won’t get the renga.

And I want the renga.

So that’s what I’m going to be trying to do. I’ll try to make tweets, in future, which are offers to you, my fellow Tweeters, to join in the game and play with the conversation and see if it takes us somewhere surprising and joyful. I’ll try to make tweets which invite the “Yes, and…” rather than the “No, but…”. And if I do happen to get the “No, but…”, as I’m sure will happen, then I’ll work out what to do at that point. At least, now, I know better what it is that I want.

If you want to play, come join me.

It’s just a tweet… but it could be poetry.


Categories: Blogs

Netty: Testing encoders/decoders

Mark Needham - Fri, 06/05/2015 - 23:25

I’ve been working with Netty a bit recently and having built a pipeline of encoders/decoders as described in this excellent tutorial wanted to test that the encoders and decoders were working without having to send real messages around.

Luckily there is a EmbeddedChannel which makes our life very easy indeed.

Let’s say we’ve got a message ‘Foo’ that we want to send across the wire. It only contains a single integer value so we’ll just send that and reconstruct ‘Foo’ on the other side.

We might write the following encoder to do this:

// Examples uses Netty 4.0.28.Final
public static class MessageEncoder extends MessageToMessageEncoder<Foo>
{
    @Override
    protected void encode( ChannelHandlerContext ctx, Foo msg, List<Object> out ) throws Exception
    {
        ByteBuf buf = ctx.alloc().buffer();
        buf.writeInt( msg.value() );
        out.add( buf );
    }
}
 
public static class Foo
{
    private Integer value;
 
    public Foo(Integer value)
    {
        this.value = value;
    }
 
    public int value()
    {
        return value;
    }
}

So all we’re doing is taking the ‘value’ field out of ‘Foo’ and putting it into the list which gets passed downstream.

Let’s write a test which simulates sending a ‘Foo’ message and has an empty decoder attempt to process the message:

@Test
public void shouldEncodeAndDecodeVoteRequest()
{
    // given
    EmbeddedChannel channel = new EmbeddedChannel( new MessageEncoder(), new MessageDecoder() );
 
    // when
    Foo foo = new Foo( 42 );
    channel.writeOutbound( foo );
    channel.writeInbound( channel.readOutbound() );
 
    // then
    Foo returnedFoo = (Foo) channel.readInbound();
    assertNotNull(returnedFoo);
    assertEquals( foo.value(), returnedFoo.value() );
}
 
public static class MessageDecoder extends MessageToMessageDecoder<ByteBuf>
{
    @Override
    protected void decode( ChannelHandlerContext ctx, ByteBuf msg, List<Object> out ) throws Exception { }
}

So in the test we write ‘Foo’ to the outbound channel and then read it back into the inbound channel and then check what we’ve got. If we run that test now this is what we’ll see:

junit.framework.AssertionFailedError
	at NettyTest.shouldEncodeAndDecodeVoteRequest(NettyTest.java:28)

The message we get back is null which makes sense given that we didn’t bother writing the decoder. Let’s implement the decoder then:

public static class MessageDecoder extends MessageToMessageDecoder<ByteBuf>
{
    @Override
    protected void decode( ChannelHandlerContext ctx, ByteBuf msg, List<Object> out ) throws Exception
    {
        int value = msg.readInt();
        out.add( new Foo(value) );
    }
}

Now if we run our test again it’s all green and happy. We can now go and encode/decode some more complex structures and update our test accordingly.

Categories: Blogs

Neo4j: Cypher – Step by step to creating a linked list of adjacent nodes using UNWIND

Mark Needham - Fri, 06/05/2015 - 00:17

In late 2013 I wrote a post showing how to create a linked list connecting different football seasons together using Neo4j’s Cypher query language, a post I’ve frequently copy & pasted from!

Now 18 months later, and using Neo4j 2.2 rather than 2.0, we can actually solve this problem in what I believe is a more intuitive way using the UNWIND function. Credit for the idea goes to Michael, I’m just the messenger.

To recap, we had a collection of football seasons and we wanted to connect adjacent seasons to each other to allow easy querying between seasons. The following is the code we used:

CREATE (:Season {name: "2013/2014", timestamp: 1375315200})
CREATE (:Season {name: "2012/2013", timestamp: 1343779200})
CREATE (:Season {name: "2011/2012", timestamp: 1312156800})
CREATE (:Season {name: "2010/2011", timestamp: 1280620800})
CREATE (:Season {name: "2009/2010", timestamp: 1249084800})
MATCH (s:Season)
WITH s
ORDER BY s.timestamp
WITH COLLECT(s) AS seasons
 
FOREACH(i in RANGE(0, length(seasons)-2) | 
    FOREACH(si in [seasons[i]] | 
        FOREACH(si2 in [seasons[i+1]] | 
            MERGE (si)-[:NEXT]->(si2))))

Our goal is to replace those 3 FOREACH loops with something a bit easier to understand. To start with, let’s run the first part of the query to get some intuition of what we’re trying to do:

MATCH (s:Season)
WITH s
ORDER BY s.timestamp
RETURN COLLECT(s) AS seasons
 
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | seasons                                                                                                                                                                                                                                                     |
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | [Node[1973]{timestamp:1249084800,name:"2009/2010"},Node[1972]{timestamp:1280620800,name:"2010/2011"},Node[1971]{timestamp:1312156800,name:"2011/2012"},Node[1970]{timestamp:1343779200,name:"2012/2013"},Node[1969]{timestamp:1375315200,name:"2013/2014"}] |
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

So at this point we’ve got all the seasons in an array going from 2009/2010 up to 2013/2014. We want to create a ‘NEXT’ relationship between 2009/2010 -> 2010/2011, 2010/2011 -> 2011/2012 and so on.

To achieve this we need to get the adjacent seasons split into two columns, like so:

2009/2010	2010/2011
2010/2011	2011/2012
2011/2012	2012/2013
2012/2013	2013/2014

If we can get the data into that format then we can apply a MERGE between the two fields to create the ‘NEXT’ relationship. So how do we do that?

If we were in Python we’d be calling for the zip function which we could apply like this:

>>> seasons = ["2009/2010", "2010/2011", "2011/2012", "2012/2013", "2013/2014"]
 
>>> zip(seasons, seasons[1:])
[('2009/2010', '2010/2011'), ('2010/2011', '2011/2012'), ('2011/2012', '2012/2013'), ('2012/2013', '2013/2014')]

Unfortunately we don’t have an equivalent function in Cypher but we can achieve the same outcome by creating 2 columns with adjacent integer values. The RANGE and UNWIND functions are our friends here:

return RANGE(0,4)
 
==> +-------------+
==> | RANGE(0,4)  |
==> +-------------+
==> | [0,1,2,3,4] |
==> +-------------+
UNWIND RANGE(0,4) as idx 
RETURN idx, idx +1;
 
==> +--------------+
==> | idx | idx +1 |
==> +--------------+
==> | 0   | 1      |
==> | 1   | 2      |
==> | 2   | 3      |
==> | 3   | 4      |
==> | 4   | 5      |
==> +--------------+
==> 5 rows

Now all we need to do is plug this code into our original query where ‘idx’ and ‘idx + 1′ represent indexes into the array of seasons. We use a range which stops 1 element early since there isn’t anywhere to connect our last season to:

MATCH (s:Season)
WITH s
ORDER BY s.timestamp
WITH COLLECT(s) AS seasons
UNWIND RANGE(0,LENGTH(seasons) - 2) as idx 
RETURN seasons[idx], seasons[idx+1]
 
==> +-------------------------------------------------------------------------------------------------------+
==> | seasons[idx]                                      | seasons[idx+1]                                    |
==> +-------------------------------------------------------------------------------------------------------+
==> | Node[1973]{timestamp:1249084800,name:"2009/2010"} | Node[1972]{timestamp:1280620800,name:"2010/2011"} |
==> | Node[1972]{timestamp:1280620800,name:"2010/2011"} | Node[1971]{timestamp:1312156800,name:"2011/2012"} |
==> | Node[1971]{timestamp:1312156800,name:"2011/2012"} | Node[1970]{timestamp:1343779200,name:"2012/2013"} |
==> | Node[1970]{timestamp:1343779200,name:"2012/2013"} | Node[1969]{timestamp:1375315200,name:"2013/2014"} |
==> +-------------------------------------------------------------------------------------------------------+
==> 4 rows

Now we’ve got all the adjacent seasons lined up we complete the query with a call to MERGE:

MATCH (s:Season)
WITH s
ORDER BY s.timestamp
WITH COLLECT(s) AS seasons
UNWIND RANGE(0,LENGTH(seasons) - 2) as idx 
WITH seasons[idx] AS s1, seasons[idx+1] AS s2
MERGE (s1)-[:NEXT]->(s2)
 
==> +-------------------+
==> | No data returned. |
==> +-------------------+
==> Relationships created: 4

And we’re done. Hopefully I can remember this approach more than I did the initial one!

Categories: Blogs

Getting Product Off the Shelf - The Launch Plan

Applied Frameworks - Thu, 06/04/2015 - 20:14

We’re currently supporting a startup client who plans to launch the first GA version of their product in 60 days. While everyone continues to work hard toward a successful release, they lack a comprehensive launch plan, which led to this post about the strategy and tactics of planning a launch.

Maiden launch of Shuttle Atlantis. Photo courtesy of NASA.

Maiden launch of Shuttle Atlantis. Photo courtesy of NASA.

Step 1: Set meaningful goals that unify effort across the entire company. Overall sales, new customer acquisition, product usage and other goals enable functional groups to plan specific actions.

Step 2: Determine the launch strategy, then identify the tactics and deliverables. A step-by-step checklist executed without a strategy could lead to wasted time and energy. At a minimum, identify who you’re targeting and why, how and when you will reach them and what you’ll need to be successful. Think of this as the mission statement and the goals as the intent.

Step 3: Nail the tactics. Now is the time to leverage a prioritized launch backlog in support of the goals and strategy. Consider the following backlog ideas listed by category. Note: You may need to decompose some of these big items into smaller items to be prioritized, completed and validated in short iterations.

Public Relations

  • Analyst collateral
  • Analyst briefings
  • Press briefings
  • Press release

Beta Program

  • Recruit beta customers
  • Execute beta program
  • Gather beta customer quotes

Collateral

  • Messaging
  • Datasheet
  • Brochure
  • Online demo video
  • Demo scenarios and scripts
  • White paper
  • FAQs
  • Competitor comparison

Web Marketing

  • Web site
  • Google, Yahoo, Bing ad programs
  • SEO
  • Social media plan and execution

Advertising

  • Print
  • Direct mail
  • Radio/TV
  • VAR/Channel

Customer

  • Existing customer notification/marketing
  • Training for existing customers
  • Update training for new customers
  • Release notes
  • User documentation
  • Administrator documentation

Internal 

  • Sales information sheet
  • Sales training
  • Sales presentation
  • Product pricing
  • Internal FAQs
  • Support training

Events

  • Industry events
  • In-person events
  • Webinars

Channel

  • Channel training
  • VAR demo purchase program
  • SPIF
  • Marketing programs

While this post provides broad guidance to plan a launch, a future post will dive much deeper into a whole product bill of materials.

Categories: Companies

Women in Agile Roundtable at RallyON

Rally Agile Blog - Thu, 06/04/2015 - 19:45

Being a woman in Agile — not to mention a woman in tech — can be a lonely experience. Women hold fewer than 25% of leadership roles at top tech companies, comprise less than 20% of all software developers, and represent just 6% of all CIOs.

Ironically, Agile’s fundamental principles of collaboration, adaptability to change, servant leadership, empathy, and attention to quality are areas where women excel. Research tells us that diverse teams perform better, and that companies with women in leadership roles have better business results. How can we better create better Agile workplaces that encourage active and vocal participation by women and encourage women to take more leadership roles?

I invite you to join me at the RallyON!™ 2015 Agile conference for a roundtable discussion (with women and men) on women’s participation in Agile and the future of technology. We want to hear from you about your experiences — your stories, tips, and aspirations. We’ll collect ideas for how to improve our workplaces, our teams, processes, and interactions, how to make Agile and tech more welcoming to people of diverse backgrounds, and how we can better capitalize on women’s participation.

DATE: Tuesday, June 16, 2015

TIME: 11:45 AM — 12:30 PM

PLACE: RallyON 2015, JW Marriott Phoenix Desert Ridge Resort & Spa, Expo Hall

I look forward to meeting you in Phoenix.

Angela Tucci
Categories: Companies

New Feature: Preventing Accidental Story Deletions

Pivotal Tracker Blog - Thu, 06/04/2015 - 19:03

Throughout the course of history, humanity has learned to develop new and improved ways to correct or mitigate its mistakes. In 1770, the first widely available rubber eraser replaced the use of crustless bread to get rid of errant marks. In 1942, an Iowan farmer became the first person to exclaim “Argh! Do-over!” after mistakenly plowing over his recently planted crops [citation needed]. And now, continuing in that great tradition, Pivotal Tracker is introducing a new feature intended to prevent accidental multiple story deletion.

Here’s a scenario that may be familiar: You’ve selected several stories, applied labels to them, selected more stories, and then hit the Delete button, not aware that you’re also accidentally deleting the previously selected stories.

As a preventive measure, we’ve introduced a “smart delete” confirmation feature that will help you to avoid this in the future. (We also considered a fuller, more complex undelete feature, and will dive into our thinking for not choosing that in a subsequent blog post.)

Screen-Shot-2015-06-04-at-9.46.54-AM

This confirmation will give you the chance to confirm or deny your decision, and hopefully avoid more accidental deletions. Tl;dr: Pivotal Tracker now integrates with crustless bread.

As this new feature rolls out, let us know if you encounter any issues by emailing tracker@pivotal.io. And be sure to follow us on Twitter and Facebook for future updates.

The post New Feature: Preventing Accidental Story Deletions appeared first on Pivotal Tracker.

Categories: Companies

The SAFe Leadership Retreat and the Power of Self-Organization

Agile Product Owner - Thu, 06/04/2015 - 18:52

Eight months ago, Martin Burns posted a message in the LinkedIn SPC Community of Practice titled “SAFe Leadership Retreat?”  The goals he stated were simple: (1) share ideas and experiences from a broad range of SAFe practitioners; (2) provide input into the direction of SAFe; and (3) build our community.

Inspired by this vision, Martin made this happen and approximately 40 people from 20 different companies across 4 continents made the journey to Crieff, Scotland the week of May 25th.  Did this self-organizing community accomplish its goals?  The answer is a resounding yes.

GOAL #1: SHARE IDEAS AND EXPERIENCES
Martin Burns, Ken Clyne, and Carl Vikman facilitated the Open Space and Lean Coffee sessions. Topics ranged from culture to Kanban to coordinating large value streams.  Though multiple sessions ran concurrently, we came back together for breakout summaries at the end of the retreat.  In addition, Stuart Young, a business visualization expert well-known in the Lean-Agile community, documented the sessions realtime.

SAFe Leadership Retreat Mural

GOAL #2: PROVIDE INPUT INTO THE DIRECTION OF THE FRAMEWORK
The Leadership Retreat began with a plenary session by Scaled Agile to articulate the company vision (Chris James), the state of the Framework (Dean Leffingwell), the future of professional development (Drew Jemilo), the Partner and SPCT programs (Jennifer Fawcett), and the development of the SAFe community (Carol McEwan).

The plenary session triggered many Open Space sessions which are now shaping the direction of SAFe 4.0, our role-based curriculum, and a deeper understanding of implementation success patterns.  We thank everyone for their contributions.

GOAL #3: BUILD OUR COMMUNITY
After Phil Gardiner took the group photo, we realized that our time together was coming to a close.  Before the closing dinner, Carl ran a retrospective which ended with the open-ended question, “How do we continue building the SAFe community after we leave?”

The next morning, on the bus ride to the Edinburgh airport, conversations continued.  We recognized that this self-organizing, face-to-face retreat built the “ba” which will enable us to fuel SAFe communities around the world.

SAFe Leadership Retreat Participants

Many thanks to Martin Burns and his wife, Lucy, for their hard work in bringing us together!

Cheers,
Drew, Dean, Chris, Jennifer, and Carol

Categories: Blogs

How the Words You Use Affect Your Team

Agile Management Blog - VersionOne - Thu, 06/04/2015 - 14:30

Words have a huge impact on team members affecting their work and ultimately your project, yet we often don’t put much thought into the words we use every day.

Check out some of the positive and negative connotations of traditional and agile project management words.

Waterfall Words vs. Agile Words

I recently went to my colleague Matt Badgley’s presentation Words Mean Things. It made me think about the words that we use in agile and how different they are than the words we used in Waterfall project management. So I compiled a list of words we use every day in project management and compared the waterfall words versus the agile words.

Scope Creep vs. Responding to Change

Scope Creep

 

 

 

 

 

 

 

 

Creep – verb

  1. Move slowly and carefully, especially in order to avoid being heard or noticed.
  2. (Of an unwanted and negative characteristic or fact) occur or develop gradually and almost imperceptibly.

Responding to Change

 

 

 

 

 

 

 

 

Respond – verb

  1. Say something in reply.

Scope creep in waterfall has such a negative feel. The word creep brings images of vines slowly engulfing your project. It makes the business analyst and customer the bad guys trying to sneak extra requirements into the project.

Where in agile, the Agile Manifesto says we should respond to change. Responding is proactively reacting to feedback from our customers. We’re responding to help the business and customer.

Post Mortem vs. Retrospective

Post Mortem

 

 

 

 

 

 

 

 

post•mor•tem

noun

  1. an examination of a dead body to determine the cause of death.

Retrospective

 

 

 

 

 

 

 

 

ret•ro•spect

noun

  1. a survey or review of a past course of events or period of time.

Traditionally you don’t do a post mortem until the end of the project; six months, nine months, or maybe a year. Typically this focuses on what went wrong and the root causes, no one changes their behavior because it’s too late.

Whereas retrospectives are held on a regular basis. We’re reflecting on how things are going in small chunks so we’re able to address issues early before they become a bad habit.

Meetings vs. Ceremonies

Meeting

 

 

 

 

 

 

 

 

meet•ing

noun

  1. an assembly of people, especially the members of a society or committee, for discussion or entertainment.
  2. a coming together of two or more people, by chance or arrangement.

Ceremony

 

 

 

 

 

 

 

 

cer•e•mo•ny

noun

  1. a formal religious or public occasion, typically one celebrating a particular event or anniversary.
  2. the ritual observances and procedures performed at grand and formal occasions.

Most people, especially developers, don’t want to go to a meeting. It feels like a waste of time.

Whereas the word ceremony brings to mind a celebration. People coming together to celebrate something. With Scrum we’re on a regular cadence, working as a team to review the product backlog, commitments and demos.

Requirements vs. User Stories

Requirement

 

 

 

 

 

 

 

 

re•quire•ment

noun

  1. a thing that is needed or wanted.
  2. a thing that is compulsory; a necessary condition.

User Stories

 

 

 

 

 

 

 

 

sto•ry

noun

  1. an account of imaginary or real people and events told for entertainment.
  2. an account of past events in someone’s life or in the evolution of something.

Requirements gives the sense that the discussion is over and you are required to do what has been set. It’s something that’s forced and you don’t have a choice, you have to do it.

Whereas with user stories, since the word user is in that phrase, it is pointing out that you are focusing on the user’s perspective. Then the story is about how that user is interacting with your product, what their pain points are with the product, and what you can do to make it better.

Conclusion

Agile words tend to have a much more positive connotation than waterfall words. This can greatly impact the mood of the team and be another factor to help your projects be more successful. More importantly, I think it shows how words we use every day without thinking can have a significant impact.

What other project management words are more positive in agile?

versionone-coaches-susan-evansAbout the Author
Susan Evans
SAFe Agilist, CSP, CSM, PMP, PMI-ACP

Susan has more than eight years of agile project management experience in software development. Prior to joining the company, she was an internal coach who optimized the usage of the VersionOne platform to help many non-collocated teams thrive in their agile processes. Susan focuses on enhancing team relationships, communication skills, conflict resolution, and processes to help create happy teams that deliver high quality.

Categories: Companies

Welcome to iceScrum.com!

IceScrum - Thu, 06/04/2015 - 12:24
Hello everybody, Our new website is the perfect opportunity to give a new start to this blog, so welcome to www.icescrum.com! Until now and for historical reasons we had two websites: – www.icescrum.org, dedicated to the open source version of iceScrum, – www.kagilum.com, dedicated to the professional features and services we have been developing for…
Categories: Open Source

#AgileCrete, Heraklion, Greece, July 16-18 2015

Scrum Expert - Thu, 06/04/2015 - 09:25
#AgileCrete is a three-day event focused on Agile software development that takes place in Heraklion, the main city of the island of Crete in Greece. The aim of the conference is to be a playground where coaches and development team members could gather to discuss and share ideas about all things Agile and Scrum. #AgileCrete follows the open space format for conferences. Open space is a simple methodology for self-organizing conference tracks. It relies on participation by people who have a passion for the topics to be discussed. There is no ...
Categories: Communities

The Five Measures Canvas for Agile Transformation

Leading Agile - Mike Cottmeyer - Wed, 06/03/2015 - 21:17
Canvas-sidebyside600 Overview

The Five Measures is a tool from Sun Tzu’s The Art of War. It is the first tool he introduces in the book and it lays the foundation for everything that follows in what is one of the most well known, and widely used sources, that offers guidance on how to cope with situations that involve challenges or will require some form of negotiation. Personally, I began studying and using the tools in The Art of War over 20 years ago. While the premise of the book is rooted in the idea of war, what it has to offer can be (and has been) applied far beyond that area. A search on Amazon will result in thousands of translations, adaptations and detailed examinations of the text that cover everything from raising children, to playing golf, to coping with the challenges many of us face day-to-day in an office setting.

In this post, my goal is to provide an brief explanation of what the Five Measures are, why they are so valuable and how they can be applied in Agile adoption. In working with teams and individuals who are adopting Agile, the Five Measures is something I use in preparation for working with both the Personal Agility Canvas and the PMO Agility Canvas (which will be covered in upcoming posts).

The Five Measures

The Five Measures forms the foundation on which every other concept and tool in the book is based. In any conflict, situational awareness, or context, is often the factor that sets things up for success or failure. So whether you are actually engaging in battle; entering into a negotiation over which projects to pursue and which to drop; or simply having a conversation with management about how to cope with one of the many challenges we face during Agile Transformation, developing a mindful understanding of your surroundings makes all the difference.

The Five Measures are:

  • The Tao
  • The Climate
  • The Ground
  • The Leadership
  • The Discipline

Because I have found that The Tao can often be tough to understand without context, I will start with explaining the other four elements first.

The Ground

In battle, the terrain on which you will engage your opponent can have a major impact on your strategy. Is the ground rocky or muddy? Will we gain an advantage because we are in a higher elevation than our opponent? How much visibility do we have into the battlefield? The Ground is where we enter into the negotiation and the more we know about it, the better our chances. In an office setting, this can be related to the organizational structure. In every organization there is a defined breakdown of power and responsibility. Person B reports to Person A and because of his/her role and title, there are specific things Person B is expected to be responsible for and certain things the organization expects them to take action on. If you were to collect an org. chart and a RACI matrix from your department or your HR department, this should provide you with the detail you need to understand how the ground on which you will engage shapes the scope of what you should be able to get done.

The Climate

If you were going into battle, understanding the terrain is not enough. You also have to factor what the weather will be like when you engage. Will we be engaging the opponent in a hot environment or a cold one? Will it be raining or dry? Will we engage in the daytime or will it be night? In a work environment, this relates to the political environment. In any company, overlaid on top of the org. chart is the political structure. For example, I may know that if I go directly to Senior Executive A, I am not likely to get the response I desire because of where I sit in the organizational structure. However, because Manager B is a rising star within the company, and seen as the one who is helping to shape the future of the company, I may be able to expect that by winning over Manager B and gaining their support, they will help strengthen my case when I do go to Senior Executive A.

I have worked in a number of office settings where the easiest way to get access to a specific person was through someone else – maybe an Admin that I make friends with so that they will find room for me in the schedule of the person I want to interact with. The Climate is where social engineering tools and techniques become very important. We have to understand who has sway, who does not, and how to leverage that information to our advantage.

In the context of Agile Transformation at a company level, understanding who holds what rank in the organization and who has the juice to be able to help strengthen our efforts towards adoption is a vital aspect of success.

The Leadership

Developing awareness of “how” your organization is led is a crucial factor. For example, what is the style of leadership employed by those in charge or the organization in general? Steve Jobs is a great example of a very charismatic, but (arguably) abusive leader. He had a vision that pulled people in. He pushed them very hard and together they did the impossible. Jobs asked this of them because of their devotion to him and his ideals.

I have had the great fortune to work for some leaders who led through trust. Often, when I asked for direction, I was just told to do whatever made the most sense. For the right kind of people, this can be a dizzying, but powerful motivator. I’ve also worked with leaders who were extremely command and control focused. While it would be easy to characterize some styles as good and some as bad, understanding The Five Measures is not about tagging things with a value judgment. It is simply about understanding. Studying the way your leadership inspires or motivates people to work (and change) adds another vital dimension to the context.

The Discipline

This is a breaking point for many organizations that want to adopt Agile. Whether it is at the Executive level or the Team level, the question to ask is, to what extent do we have the ability to do what we say we will do? The road to Agile is littered with bodies that fell victim to “Executive Read HBR article on Airplane” syndrome, where someone in a position of power read about the promise of Agile and directed portions of the company to “go be Agile” with no desire or ability to actually change how they, and the company, interact with the work.

In the context of war, this is simple… are the troops so disciplined that when things go sideways in battle, they will hold the line and let the training guide them, or, will they go running helter skelter in a state of panic. When our organization agrees to adopt a set of Agile practices like Scrum, do we have the discipline to actually keep our Daily Scrum meetings to 15 minutes? Does the business side have the discipline to not try to change the commitment in mid sprint. Does the Scrum team actually hold all the ceremonies and do they protect the way they work?

The Tao

The Tao can loosely be translated into “The Way”. This is at the center of The Five Measures. What is the culture of the organization? Is it one that is supportive of difficult change? Does the business make it’s decisions by burning tomorrow to save today? What is the value system in place? Tying this back to The Leadership and The Discipline, does the company (or client) culture demonstrate that it truly does support the idea of experimentation and learning from failure? Does leadership demonstrate that it has discipline to let the teams work iteratively to find the best way of delivering the most value despite the fact that learning how to do so is going to include a certain degree of failure along the way? Or, does the culture support change only so far as it does not demonstrate that it will have any negative cost impact? In short, what makes this company tick? It is somewhat more difficult to pin down than the other four measures, but each of them feeds into this one.

Practical Application

When I am working with clients who are pursuing Agile adoption, I use the Five Measures to develop context and situational awareness of what is going on around me and in what environment I am going to be trying to promote change. In many ways it is about developing mindfulness so that as the work of Agile Transformation begins, we can have an open, transparent conversation about what we are facing. In some ways it is like a pre-emptive Retrospect, helping us to observe and understand before we begin trying to promote change.

The Five Measures Canvas offers a visual representation of the tool and can be used individually, or in a group.

If you are interested in The Art of War and would like to learn more, here are the three translations I recommend for getting started:


ClearyThe Art of War – Translated by Thomas Cleary (Shambala Pocket Edition)

This is a great, lightweight introduction that offers a simple explanation of the ideas presented in the text. This is a great starting point if you are new to Sun Tzu.

 

 

WingThe Art of Strategy – A New Translation of Sun Tzu’s Classic The Art of War by R.L. Wing

R.L. Wing begins each chapter of the book with an overview of the subject and then explains it on multiple levels that I have found invaluable in my understanding of how the system works. For each chapter Wing explores: Conflict In The Self, Conflict In The Environment, Conflict With Another, and Conflict Among Leaders.

GagliardiSun Tzu’s The Art of War Plus Its Amazing Secrets by Gary Gagliardi

Once you become familiar with ideas in The Art of War, Gagliardi’s breakdown of how to they work and his diagrams explaining the approach provide great insight into how to employ the tools in everyday life.

The post The Five Measures Canvas for Agile Transformation appeared first on LeadingAgile.

Categories: Blogs

End-to-End Hypermedia: Building the Server

Jimmy Bogard - Wed, 06/03/2015 - 19:26

In the last post, we looked at choosing a hypermedia type. This isn’t the easiest of things to do, and can take quite a bit of effort to settle on a choice. On top of that, you very often need validation from a client consumer that your choice was correct. Unfortunately, even tools like Apiary.io aren’t sufficient, you really need to build your API to validate your API.

This isn’t completely unexpected. If I’m building any sort of software the only way of proving it is what I need is to actually use it.

In our case, we choose collection+json as our media type since we were mainly showing lists of things. It’s a fairly straightforward format, with out of the box support for ASP.NET Web API. There are a few NuGet packages that help with collection+json support:

  • CollectionJson.Server – includes a base controller class
  • CollectionJson.Client – includes a formatter
  • CollectionJson – just the object model with no dependencies

We first explored using these out-of-the-box, with the controller base class Server version:

public class FriendsController : CollectionJsonController<Friend>
{
    private IFriendRepository repo;

    public FriendsController(IFriendRepository repo, ICollectionJsonDocumentWriter<Friend> writer, ICollectionJsonDocumentReader<Friend> reader)
        :base(writer, reader)
    {
        this.repo = repo;
    }

    protected override int Create(IWriteDocument writeDocument, HttpResponseMessage response)
    {
        var friend = Reader.Read(writeDocument);
        return repo.Add(friend);
    }

    protected override IReadDocument Read(HttpResponseMessage response)
    {
        var readDoc = Writer.Write(repo.GetAll());
        return readDoc;
    }

    protected override IReadDocument Read(int id, HttpResponseMessage response)
    {
        return Writer.Write(repo.Get(id));
    }

    //custom search method   
    public HttpResponseMessage Get(string name)
    {
        var friends = repo.GetAll().Where(f => f.FullName.IndexOf(name, StringComparison.OrdinalIgnoreCase) > -1);
        var readDocument = Writer.Write(friends);
        return readDocument.ToHttpResponseMessage();
    }

    protected override IReadDocument Update(int id, IWriteDocument writeDocument, HttpResponseMessage response)
    {
        var friend = Reader.Read(writeDocument);
        friend.Id = id;
        repo.Update(friend);
        return Writer.Write(friend);
    }

    protected override void Delete(int id, HttpResponseMessage response)
    {
        repo.Remove(id);
    }
}

If we were implementing a very pure version of collection+json, this might be a good route. However, not all of the HTTP methods were supported for our operations, so we wound up not using this one.

Next, we looked at the Client package, which includes a formatter and some extensions around HttpResponseMessages and the like. That worked best for us – we didn’t really need to extend the model to support extra metadata. I had thought we did, but looking back, we went through several iterations and finally landed on the stock collection+json model.

When looking at Web API extensions for hypermedia, I tend to see three sets of extensions:

  • Object model that represents the media type and is easily serializable
  • Helpers for inside your controller
  • Base controller classes

The code inside of these isn’t that much, so you can always just grab code from GitHub for your media type or roll your own object models.

Building your models

The CollectionJson.Client package deals with two-way model building – writing documents and reading documents. Writing a document involves taking a DTO and building a collection+json document. Reading a document involves taking a collection+json document and building a model.

In my plain ol’ JSON APIs, building a web API endpoint looks almost exactly like an MVC one:

public class FooController : ApiController
{
    private readonly IMediator _mediator;

    public OrganizationController(IMediator mediator)
    {
        _mediator = mediator;
    }

    public IEnumerable<FooModel> Get()
    {
        return _mediator.Send(new FooQuery());
    }

    public IEnumerable<FooModel> Get(string id)
    {
        return _mediator.Send(new FooQuery{Id = id});
    }
}

With building out documents, I need to take those DTOs and build out my representations  (my collection+json documents). The collection+json client defines two interfaces to help make this possible:

public interface ICollectionJsonDocumentReader<TItem>
{
    TItem Read(IWriteDocument document);
}
public interface ICollectionJsonDocumentWriter<TItem>
{
    IReadDocument Write(IEnumerable<TItem> data);
}

To make my life a bit easier, I created a mediator just for collection+json readers/writers, as I like to have a single point in which to request read/write documents:

public interface ICollectionJsonDocumentMediator
{
    IReadDocument Write<TItem>(TItem item);
    IReadDocument Write<TItem>(IEnumerable<TItem> item);
    TItem Read<TItem>(IWriteDocument document);
}

Once again we see that the Mediator pattern is great for turning types with generic parameters into methods with generic parameters. Our mediator implementation is pretty straightforward:

public class CollectionJsonDocumentMediator : ICollectionJsonDocumentMediator {
    private readonly IContainer _container;

    public CollectionJsonDocumentMediator(IContainer container) {
        _container = container;
    }

    public IReadDocument Write<TItem>(IEnumerable<TItem> item) {
        var writer = _container.GetInstance<ICollectionJsonDocumentWriter<TItem>>();

        return writer.Write(model);
    }
    
    public IReadDocument Write<TItem>(TItem item) {
        var writer = _container.GetInstance<ICollectionJsonDocumentWriter<TItem>>();

        return writer.Write(model);
    }
    
    public TItem Read<TItem<(IWriteDocument writeDocument) {
        var reader = _container.GetInstance<ICollectionJsonDocumentReader<TItem>>();

        return reader.Read(writeDocument);
    }
}

In our controllers, building out the responses is fairly easy now, we just add a step before our MediatR mediator:

public class InstructorController : ApiController {
    private readonly IMediator _mediator;
    private readonly ICollectionJsonDocumentMediator _documentMediator;
    
    public InstructorController(
        IMediator mediator,
        ICollectionJsonDocumentMediator documentMediator) {
        _mediator = mediator;
        _documentMediator = documentMediator;
    }
    
    public async Task<HttpResponseMessage> Get([FromUri] Get.Query model) {
        var model = await _mediator.SendAsync(model);
    
        var document = _documentMediator.Write(model);
    
        return document.ToHttpResponseMessage();
    }
}

The MediatR part will be the same as we would normally have. What we’ve added is our collection+json step of taking the DTO from the MediatR step and routing this to our collection+json document mediator. The document writer is then pretty straightforward too:

public class Get {
    // Query, model and handler here
    
    public class DocumentWriter
        : ICollectionJsonDocumentWriter<Model> {
        
        private readonly HttpRequestContext _context;
        
        public DocumentWriter(HttpRequestContext context) {
            _context = context;
        }
        
        public IReadDocument Write(IEnumerable<Model> data) {
            var document = new ReadDocument {
                Collection = new Collection {
                    Href = _context.url.Link<InstructorController>(c => c.Get()),
                    Version = "1.0"
                }
            };
            
            foreach (var model in data) {
                var item = new Item {
                    Href = _context.Url.Link<InstructorController>(c => c.Get(new Query {Id = model.Id}))
                };
                item.Data.Add(new Data { Name = "last-name", Value = model.LastName, prompt = "Last Name"});
                item.Data.Add(new Data { Name = "first-name", Value = model.FirstMidName, prompt = "First Name"});
                item.Data.Add(new Data { Name = "hire-date", Value = model.HireDate.ToString("yyyy-MM-dd"), prompt = "Hire Date"});
                item.Data.Add(new Data { Name = "location", Value = model.OfficeAssignmentLocation, prompt = "Location"});
                
                item.Links.Add(new Link {
                    Href = _context.Url.Link<InstructorController>(c => c.GetCourses(new Courses.Query {Id = model.Id})),
                    Prompt = "Courses",
                    Rel = "courses"
                });
                document.Collection.Items.Add(item);
            }
            
            return document;
        }
    }
}

If you’ve followed my conventional HTML series, you might notice that the kind of information we’re putting into our collection+json document is pretty similar to the metadata we read when building out intelligent views. This helps close a gap I’ve found when building SPAs – I was much less productive building these pages than regular server-side MVC apps since I lost all that nice metadata that only lived on the server. Pre-compiling views can work, but additional metadata in hypermedia-rich media types works too.

For the write side, I could build something similar, including templates and the like. In fact, you can borrow our ideas from conventional HTML to build out helpers for our collection+json models. Since we have models built around read/write items:

public class Model
{
    public int? ID { get; set; }

    public string LastName { get; set; }
    [Display(Name = "First Name")]
    public string FirstMidName { get; set; }

    [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]
    public DateTime? HireDate { get; set; }

    [Display(Name = "Location")]
    public string OfficeAssignmentLocation { get; set; }
}

We can intelligently build out templates and data items:

public class Get {
    // Query, model and handler here
    
    public class DocumentWriter
        : ICollectionJsonDocumentWriter<Model> {
        
        private readonly HttpRequestContext _context;
        
        public DocumentWriter(HttpRequestContext context) {
            _context = context;
        }
        
        public IReadDocument Write(IEnumerable<Model> data) {
            var document = new ReadDocument {
                Collection = new Collection {
                    Href = _context.url.Link<InstructorController>(c => c.Get()),
                    Version = "1.0"
                }
            };
            
            foreach (var model in data) {
                var item = new Item {
                    Href = _context.Url.Link<InstructorController>(c => c.Get(new Query {Id = model.Id}))
                };
                item.Data.Add(model.ToData(m => m.LastName));
                item.Data.Add(model.ToData(m => m.FirstMidName));
                item.Data.Add(model.ToData(m => m.HireDate));
                item.Data.Add(model.ToData(m => m.OfficeAssignmentLocation));

                item.Links.Add(_context.Url.CollectionJsonLink<InstructorController>(c => c.GetCourses(new Courses.Query {Id = model.Id)));
                
                document.Collection.Items.Add(item);
            }
            document.Collection.Template.Data.BuildFrom<Post.Model>();
            
            return document;
        }
    }
}

Our document writers start to look somewhat similar to our Razor views. On the document reader side, it’s a similar exercise of pulling information out of the document, populating a DTO and sending down the MediatR pipeline. Just the reverse of our GET actions.

Altogether not too bad with the available extensions, but building the server API is just half the battle. In the next post, we’ll look at building a consuming client.

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

Categories: Blogs

Call for Agile2015 Lightning Talk Proposals

Scrum Expert - Wed, 06/03/2015 - 17:23
Do you have a great idea to share with fellow attendees? Can you do it in 3, 5 or 7 minutes? Let your voice be heard! ​Propose a Lightning Talk to Speak at the Agile2015 conference. Submit your proposal for a Lightning Talk and you could take the stage for a short talk during the Agile2015 conference. It’s fast, exciting, and a great way to engage with your fellow conference participants! Lightning Talks provide a lightweight, flexible opportunity for you to share your valuable experiences and knowledge: * Presentations may be a ...
Categories: Communities

Knowledge Sharing


SpiraTeam is a agile application lifecycle management (ALM) system designed specifically for methodologies such as scrum, XP and Kanban.